mirror of
https://github.com/zedsalim/debian-z.git
synced 2026-02-11 12:09:34 +00:00
Initial Commit
This commit is contained in:
parent
f18da1cc25
commit
a5bc6b13c5
96 changed files with 6936 additions and 0 deletions
34
config/scripts/wallpaper-single-display.sh
Executable file
34
config/scripts/wallpaper-single-display.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# script requires sxiv and feh
|
||||
|
||||
# background directory
|
||||
bgdir="$HOME/.config/wallpapers"
|
||||
|
||||
# current wallpaper so the lockscreen script will match
|
||||
cbg="$HOME/.config/wallpapers/ign_astronaut.png"
|
||||
|
||||
|
||||
# reads stdout of sxiv mark after quitting (Mark with m and q to quit)
|
||||
# (currently reads last wallpaper selected no matter how many you select)
|
||||
choice="$(sxiv -t -o -r "$bgdir")"
|
||||
choicenum="$(echo "$choice" | wc -l)"
|
||||
|
||||
# If no choice for wallpaper was made, exit the script
|
||||
[ -z "$choice" ] && exit 0
|
||||
[ "$choicenum" == 1 ] && lastwp="$(echo "$choice")"
|
||||
[ "$choicenum" -gt 1 ] && lastwp="$(echo "$choice" | tail -n1)"
|
||||
|
||||
# Check if feh is installed and set the command accordingly
|
||||
if [ -x "$(command -v feh)" ]; then
|
||||
set="feh --bg-fill"
|
||||
else
|
||||
echo "feh is not installed. Please install feh to set wallpapers."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$set "$lastwp" && cp "$lastwp" "$cbg"
|
||||
|
||||
echo "#!/bin/bash" > ~/.config/scripts/last-single-wallpapers.sh
|
||||
|
||||
echo feh --bg-fill "$lastwp" >> ~/.config/scripts/last-single-wallpapers.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue