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.

  1. Playlist download with yt-dlp with all my best settings, adding playlist index as track number.

  2. 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.

  3. Desktop file contents for when I need to create one for an appimage

  4. The script I used to bind audio output switching to a hotkey

  5. 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.

you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 7 months ago* (last edited 7 months ago) (2 children)

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.

  1. yt-dlp-lemon: Simple wrapper to yt-dlp with only a subset of options.
  2. unwrap: Wrapper to marry GNU Parallel and 7-Zip for archive extraction.
  3. biggest: List biggest files and folders.
  4. ?: cheat .sh - The only cheat sheet you need. (Note, commands name is just ?)
  5. woman: Preview list for man documents.

Besides my more simple scripts and aliases and functions.

6. system update and all updates:

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}"
done

  • source
  • hideshow 2 child comments
  • [–] 2 points 7 months ago

    That's so clever yet so simple, keep all the scripts in folder that's in PATH. I will deffo use that idea instead of a dedicated folder called scripts in my home folder.

  • source
  • parent