Does anybody else have a library of saved commands/scripts? What’s in it? How do you organize it? Is there anything you’d want to share that other people might find helpful?
I do. I keep it in VS Code and store complicated (for me) stuff that I can’t remember or worry I might not.
-
Playlist download with yt-dlp with all my best settings, adding playlist index as track number.
-
Ffmpeg metadata cleaner for music. Searching title for a bunch of specific strings to remove, setting the band, album, etc. and saving these in a new folder.
-
Desktop file contents for when I need to create one for an appimage
-
The script I used to bind audio output switching to a hotkey
-
How to use ADB for when android blocks sideloading the normal way and I inevitably forget what Android Debug Bridge is or how to use it.
Linux Mint btw. Also yes, I am a noob.
I do write scripts and commands (and Bash aliases or functions) all the time. The scripts live in ~/.local/bin and are executable like any other program, as that directory is in my PATH variable. I have a projects directory where I archive them, and some of them are uploaded to my Github account. Some of them are later rewritten in Python and get a life on its own.
- yt-dlp-lemon: Simple wrapper to yt-dlp with only a subset of options.
- unwrap: Wrapper to marry GNU Parallel and 7-Zip for archive extraction.
- biggest: List biggest files and folders.
- ?: cheat .sh - The only cheat sheet you need. (Note, commands name is just
?) - woman: Preview list for man documents.
Besides my more simple scripts and aliases and functions.
6. system
updateand allupdates:alias update='eos-update --yay' alias updates='eos-update --yay ; flatpak update ; flatpak uninstall --unused ; rustup self update ; rustup update'7. Or a recent script to convert files to mp3 format:
tomp3#!/usr/bin/env bash for file in "${@}"; do output="${file%.*}.mp3" if [[ -f "${output}" ]]; then continue fi ffmpeg -i "${file}" -b:a 320k "${output}" doneUsually have kind of staging public area, and after some refinements some scripts are moved to its own repository and can be installed using bash package manager. Not my own invention but contains not yet merged code that can install scripts from github or gitlab
Available scripts:
- Forrest tools: Tools aimed at simplify program execution
- Git mindset: extra git commands, can be used by
git <tab>and will expand to show available commands - OS Mindset: All those useful snippets in one place (Linux and MacOS commands)
Heres my ~/.bin directory:
https://github.com/promitheas17j/dotfiles/tree/main/dot_bin
Hopefully thats what youre asking for.
My favourite ones are:
- bspwm-minimise.sh and bspwm-restore.sh which allow me to have window minimisation functionality in bspwm, which to my knowledge doesn’t exist natively
- check_last_update.sh which I have in my .zshrc and gives me a count of packages available to update with some basic colouring, as well as if I have a kernel mismatch and need to restart
One that Im still working on but will for sure be my favourite once its done is parse_keybinds.sh and keybind_cheatsheet.sh, which go through some of the software I have and parse their config files to extract all the keybinds into a file with a specific format. The latter script then launches a rofi menu where I can fuzzy search keybinds based on software name and what I want to do but cant remember the binding for. So far Ive got sxhkd and lf, but I consider it a work in progress because I want to also parse neovim bindings, but sxhkd and lf are single file configs while neovim has bindings in multiple files spread across multiple subdirectories in its config directory.
I was going give my joke answer about how I just made a bash script to mount all my hard drives to mnt/[directories 1-13], instead of just mounting it through F-Stab, but this is NOTHING compared to your examples…
I use obsidian with the self hosted live sync plugin and have a couchdb instance setup on my homelab server. With external access via ssl certs (the only way to access couchdb outside a local network is to get real certs). Now I can hit my notes from all my devices and systems. While it’s not ‘scripts’ exactly it contains a ton of documentation for things I do, plan to do and have done.
Also use it as a store house for links to various things that I intend to pull in and refactor for my own use later. Or links to other larger repositories (book of secret knowledge, etc), stuff I’ve made public on GitHub like rules.d tutorials for some keyboards with web configuration.
I think the only actual script I have on there is:
for f in *.mp3 *.m4a *.m4b *.opus; do [ -e "$f" ] || continue pre="${f%.*}" mkdir -p "$pre" mv "$f" "$pre/" doneMade it for moving loose audiobook files into individual folders.
I have a personal wiki instance hosted for that purpose. I collect knowlege in it, that I might need later and forget. Although I might not use dokuwiki, if I had so start the wiki again (would go to markdown).
For anything more complicated than an alias, I tend to suck it up and write a program. I used to keep launcher scripts in ~/bin but I’ve recently taken to creating package manager packages for them. I’ve learned how to do that with NixOS and Arch Linux and I peeked at the Debian documentation.
I have a .scripts folder in home with a bunch of things. Most of them are for backups, aka they just rsync a bunch of things from different places into one place on my backup drive. I also have one called get_trailers that I can run in my Radarr folder which takes the names of any movie folders in there and uses yt-dlp to search and grab the trailers from Youtube and puts them in the correct folders alongside the movie.




