Add scripts for better wallpapers management

This commit is contained in:
Wiktor Zykubek 2020-05-10 11:05:02 +02:00
parent d9d3334a29
commit 170bbb670a
4 changed files with 31 additions and 7 deletions

8
.config/sxiv/exec/key-handler Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env sh
while read -r file
do
case "$1" in
"w") setwall "$file" &;;
esac
done

View File

@ -7,12 +7,9 @@
# Load .Xresources # Load .Xresources
xrdb ~/.Xresources xrdb ~/.Xresources
# Wallpaper
if [ "$HOSTNAME" == "pc" ];then # wallpaper
feh --bg-fill --randomize /home/samedamci/.config/wallpapers/1920x1080/ & setwall &
elif [ "$HOSTNAME" == "laptop" ];then
feh --bg-fill --randomize /home/samedamci/.config/wallpapers/1366x768/ &
fi
killall -q sxhkd killall -q sxhkd
while pgrep -u $UID -x sxhkd >/dev/null; do killall -q sxhkd; done while pgrep -u $UID -x sxhkd >/dev/null; do killall -q sxhkd; done
@ -32,7 +29,7 @@ setxkbmap -layout 'pl' -option caps:swapescape &
xsetroot -cursor_name left_ptr & # change the cursor shape from "x" to normal xsetroot -cursor_name left_ptr & # change the cursor shape from "x" to normal
# dwm bar # dwm bar
~/.local/bin/scripts/dbar & dbar &
# Not reload # Not reload
[[ -z $(pgrep udiskie) ]] && udiskie & [[ -z $(pgrep udiskie) ]] && udiskie &

9
.local/bin/scripts/choosewall Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
if [ "$(cat /etc/hostname)" = "pc" ]; then
res="1920x1080"
elif [ "$(cat /etc/hostname)" = "laptop" ]; then
res="1366x768"
fi
find ~/.config/wallpapers/"$res"/* | shuf | sxiv - -tb

10
.local/bin/scripts/setwall Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
[ "$1" ] && { feh --bg-fill "$1" && exit 1; }
if [ "$(cat /etc/hostname)" = "pc" ]; then
feh --bg-fill --randomize /home/samedamci/.config/wallpapers/1920x1080/ &
elif [ "$(cat /etc/hostname)" = "laptop" ]; then
feh --bg-fill --randomize /home/samedamci/.config/wallpapers/1366x768/ &
fi