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.

  • thingsiplay@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    5 hours ago

    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
    
    • fozid@feddit.uk
      link
      fedilink
      arrow-up
      2
      ·
      3 hours 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.