this post was submitted on 23 Jun 2025
64 points (97.1% liked)

Linux

8038 readers
745 users here now

A community for everything relating to the GNU/Linux operating system

Also check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
 

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)"
}
you are viewing a single comment's thread
view the rest of the comments
[–] christopher@programming.dev 2 points 1 day 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'