OC by @als@lemmy.blahaj.zone

A while ago I made a tiny function in my ~/.zshrc to download a video from the link in my clipboard. I use this nearly every day to share videos with people without forcing them to watch it on whatever site I found it. What’s a script/alias that you use a lot?

# Download clipboard to tmp with yt-dlp
tmpv() {
  cd /tmp/ && yt-dlp "$(wl-paste)"
}
  • christopher@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    8 hours ago

    I am using Music Player Daemon, and I use the following script to turn gPodder into a client. My music is in ~/Music and I put the podcasts in ~/Music/Podcasts. The script works for both streaming or downloaded podcasts.

    [~]$ cat bin/mpcut.sh
    #!/bin/bash
    if [ "$(echo "$1" | cut -b-4)" = "http" ]; then
        /usr/bin/mpc pause
        /usr/bin/mpc insert "$1"
        /usr/bin/mpc toggle
        /usr/bin/notify-send -i gpodder "$1 inserted to next spot in playlist."
    else
        /usr/bin/mpc pause
        /usr/bin/mpc add "Podcasts/$(echo "$1" | cut -d"/" -f6-)"
        /usr/bin/mpc toggle
        /usr/bin/notify-send -i gpodder "$(echo "$1" | cut -d"/" -f7-)" "added to end of playlist."
    fi
    

    Audio Player in gPodder preferences is set to this: /home/christopher/bin/mpcut.sh %F

    I have an application shortcut Super-G set to this in xfce4-keyboard-settings: env GTK_THEME=Adwaita-dark GPODDER_HOME=/home/christopher/.config/gPodder/ GPODDER_DOWNLOAD_DIR=/home/christopher/Music/Podcasts/ /usr/bin/gpodder

    or you could use an alias: alias gpodder='GTK_THEME=Adwaita-dark GPODDER_HOME=/home/christopher/.config/gPodder/ GPODDER_DOWNLOAD_DIR=/home/christopher/Music/Podcasts/ /usr/bin/gpodder --verbose'