tool

nixos update shell script

2024 Jun 23 #tool

I use a nix flakes setup to manage my system as a whole, so I have a flake.lock in my dotfiles which makes up 50% of my commits to just update it. I wrote these scripts to help make updating my system a bit nicer.

Xonotic now-playing MPD script

2022 Nov 27 #tool

First off, the script:

xon_mpc_artist="$(mpc status -f "%artist%" | head -n1 | sed 's/;/;/g' | sed 's/\^/^^/g')"
xon_mpc_title="$(mpc status -f "%title%" | head -n1 | sed 's/;/;/g' | sed 's/\^/^^/g')"
xon_mpc_album="$(mpc status -f "%album%" | head -n1 | sed 's/;/;/g' | sed 's/\^/^^/g')"

if [ "$playing" = true ]; then
echo "say /me ^8np^7 ^x6b6$xon_mpc_artist ^xa44${xon_mpc_title:0:60} ^x345$xon_mpc_album" | head -n1 > "$HOME/.local/share/xonotic/.xonotic/data/np.cfg"
else
echo "" > "$HOME/.local/share/xonotic/.xonotic/data/np.cfg"
fi

And on the xonotic side, it’s just bind n "exec np.cfg".

Reverse Image Search

2021 Aug 01 #tool

Many times have I come across an image with no source given, and no signature visible, or someone else is asking where a particular image comes from. I’m writing this in the hopes that next time you post an image you found without a source, you spend the 5 minutes it takes to at least look to see where it came from.

yt-dlp scripts

#tool

I use yt-dlp in order to be able to view videos from channels I follow offline, and wrote this set of scripts in order to help manage it.