Some shell scripts I've written/gathered which I use on my linux setup on a daily basis. I use zsh as my main shell, 99% of the scripts will work on bash though. I'm not anal about remaining POSIX compliant. If you absolutely must repurpose any of the scripts for a POSIX shell I assume you are capable of doing so.
IMPORTANT: Many of the scripts rely on variables I set in my ~/.profile
contained in my dotfiles. Some scripts use external programs, I do mention (as much as I can recall) which programs are required within the scripts.
Simply copy-pasta to your own scripts dir, or clone this repo and add them to your $PATH
. For the latter method do:
cd ~
git clone https://github.com/sarrost/scripts
Add the following line to your ~/.profile
. It will allow the scripts to be executed from within any working dir:
...
export PATH="$PATH:$(du -L "$HOME/scripts/scripts" | cut -f2 | tr '\n' ':' | sed 's/:*$//')"
...
To test if everything is working correctly open up a new terminal and do:
cd ~
testpath
If the above doesn't work please make sure you properly set the $PATH
variable in your ~/.profile
. If the scripts refuse to execute do, give them all execute permissions.
chmod +x -R ~/scripts/scripts
Many of the scripts are designed to be used with other programs, such as vim, vifm, zsh, fzf, tmux, etc. See my dotfiles for how I integrate the scripts.
- albumtag - tag albums
- audioinfo - print song info
- backlightwrap - adjust backlight brightness
- backup - backup a file
- cf - quickly access files
- cf_fzf - select config/special file with fzf menu and print it
- cleanempty - remove empty files and directories
- comptontoggle - toggle compton
- cssfont - import web font into project and print css definition
- dec2hex - convert a decimal to hex
- deci - sensibly print float with two decimal points
- def - search up word in dictionary
- devour - open files with default programs
- dirs_fzf - select directory from fzf menu and print it
- dmenu_emoji - select emoji and copy to clipboard
- dmenu_mount - mount usb devices
- dmenu_mpd - play songs
- dmenu_pass - select a password from a menu and copy it to the clipboard for a few seconds
- dmenu_record - record video/audio
- dmenu_umount - unmount usb devices
- dockerpurge - purge all docker images/containers
- dunsttoggle - toggle dunst
- ext - extract files from archives
- ffmgif - convert video to gif
- genalbumtag - generate files for tagging albums
- gencssfont - generate css definitions for a web font and it's variants
- gennumseq - generate numbered sequence
- genpreviews - generate thumbnail previews for video and gif files.
- genscriptsumm - print script summaries for
README.md
- genshortcuts - generate dir shortcuts
- grepcssfont - grep definition for web font and it's variants
- help - quickly access help files in wiki
- hex2dec - convert a hex to decimal
- journal - manage personal journal entries
- keyboardtoggle - toggle laptop keyboard
- mpcvolumewrap - manipulate mpd volume
- n - nnn wrapper
- nn - custom nnn launch environment
- perms - recursively normalize permissions
- pickcolor - pick color on screen and copy to clipboard
- pwdclipboard - copy the working dir to the clipboard
- remapkeys - ramap certain keys
- renetwork - restart network
- screenkeytoggle - toggle screenkey
- screenshot - take screenshots
- setwallpaper - set the desktop background
- statusbar_backlight - print backlight level
- statusbar_batcapacity - print the current battery capacity
- statusbar_batstatus - print battery status as icon
- statusbar_clock - print the current time
- statusbar_cpuusage - print the cpu usage for all cores
- statusbar_memavail - print available memory
- statusbar_memused - print current memory usage
- statusbar_music - print song details and music volume
- statusbar_news - print unread rss feed updates
- statusbar_today - print the current date
- statusbar_volume - print the system volume level
- syncmail - sync email
- systray - wrapper for stalonetray
- tag - add metadata to audio file
- termcolor256 - print 256 terminal colors
- termcolortable - print color codes in table
- testpath - check if containing dir is in
$PATH
- torrentadd - add and start torrent
- torrentcomplete - send notification when torrent is finished
- ueberimg - preview media as image in terminal
- uebernnn - prepare ueberzug environment for nnn instance
- up - quickly update system packages
- vid_merge - merge video and audio back together
- vid_split - split audio and video
- vifmimg - use ueberzug to draw images in vifm
- vifmrun - run vifm with ueberzug integration
- vifmsplittoggle - cycle toggle split in vifm
- volumewrap - manipulate system volume
- vpwd - set terminal virtual pwd
- vpwd_cf - quickly access files
- vpwd_nvim - edit files in nvim
- vpwd_vifm - vi file manager
- vs - quickly create and edit script
- zan - read man pages using zathura
I wanted a seperate repo for my scripts, it seemed redundant to have sync the scripts to another dir.
- Herbert Magaya herbert.magaya@protonmail.com