random wallpaper env selection.

This commit is contained in:
2024-04-11 21:17:39 +09:00
parent 8edbaa5024
commit 63770c0d61
2 changed files with 27 additions and 16 deletions

View File

@ -72,8 +72,8 @@ bspc rule -a \* state=tiled
#fi
# TODO heres polybar
if [[ $JUPCID == "HWDEV" ]]; then
polybar panel-bspwm --config=~/.config/polybar/config.ini
else
if [[ $JUPCID == "HOME-DESKTOP" ]]; then
polybar panel-bspwm-1 & polybar panel-bspwm-2
else
polybar panel-bspwm --config=~/.config/polybar/config.ini
fi

View File

@ -4,17 +4,28 @@
wal_dir=~/walls/normal
# random wallpaper
files=()
while IFS= read -r -d $'\0'; do
files+=("$REPLY")
done < <(find $wal_dir -type f -name "*" -print0)
randomfile=$(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")
echo $randomfile
if [[ $JUPCID == "HOME-DESKTOP" ]]; then
files=()
while IFS= read -r -d $'\0'; do
files+=("$REPLY")
done < <(find $wal_dir -type f -name "*" -print0)
randomfile=$(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")
echo $randomfile
files=()
while IFS= read -r -d $'\0'; do
files+=("$REPLY")
done < <(find $wal_dir -type f -name "*" -print0)
randomfile2=$(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")
echo $randomfile2
feh --bg-max "$randomfile" --bg-max "$randomfile2"
else
files=()
while IFS= read -r -d $'\0'; do
files+=("$REPLY")
done < <(find $wal_dir -type f -name "*" -print0)
randomfile=$(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")
echo $randomfile
feh --bg-max "$randomfile"
fi
files=()
while IFS= read -r -d $'\0'; do
files+=("$REPLY")
done < <(find $wal_dir -type f -name "*" -print0)
randomfile2=$(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")
echo $randomfile2
feh --bg-max "$randomfile" --bg-max "$randomfile2"