1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-09 19:11:15 +02:00

scripts: renamed many scripts and added options; added loopback

This commit is contained in:
2024-05-18 04:27:54 +02:00
parent b25a478cfa
commit f662768a04
14 changed files with 124 additions and 40 deletions

15
.local/bin/tools/wallpaper Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
# Based on a script by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg"
trueloc="$(readlink -f "$1")" &&
case "$(file --mime-type -b "$trueloc")" in
image/* ) ln -f "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
inode/directory ) ln -f "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
esac
xwallpaper --zoom "$bgloc"