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)"
}
Ooooou I got a couple :3
This one is just a basic mirror fixing thing cuz sometimes I go a while without updating pacman:
alias fixpkg='rate-mirrors --protocol https arch | sudo tee /etc/pacman.d/mirrorlist && sudo pacman -Syy'
This function I made to create virtual audio sinks so I can route audios via qpw and play earrape into discord calls if I want XD
create_vsink() { local sink_name=${1:-vsink} # Default sink name is 'vsink' if no input is provided local description=${2:-"Virtual Sink"} # Default description pactl load-module module-null-sink sink_name="$sink_name" sink_properties=device.des> echo "Virtual sink '$sink_name' created with description '$description'." }
Simple parser function I made that makes a whole repo using my git key so it’s not just locally created I kinda forgot why I made it tbh:
git_clone() { local url="${1#https://}" # Remove "https://" if present git clone "https://$git_key@$url" }
Awesome mpv function I made that allows for real time pitch+speed shifting via hotkeys and is flexible with extra parameters and shit:
mpv_pitch() { if [[ -z "$1" ]]; then echo "Usage: mpv_pitch <file> [mpv-options]" return 1 fi local file="$1" shift mpv --input-conf=/dev/stdin "$file" "$@" <<EOF SHIFT+RIGHT add audio-pitch-correction 0; add pitch 0.01; add speed 0.01 # Decrease pit> SHIFT+LEFT add audio-pitch-correction 0; add pitch -0.01; add speed -0.01 # Increase pit> EOF }
Automatic audio router for firefox audio streams that uses the aforementioned create_sink function to make a specific sink that I can use carla on to mix and make cool shit out of haha
firefox_crush() { create_vsink CrunchSink "CrunchSink" firefox --name firefox-vc & (while true; do SINK_INPUT_ID=$(pactl list sink-inputs short | grep "firefox" | awk '{print $1}') if [[ -n "$SINK_INPUT_ID" ]]; then pactl move-sink-input "$SINK_INPUT_ID" CrunchSink break fi sleep 0.25 done) & }