From 63770c0d613d628f7a7a0c0a7a66a61cf8651aab Mon Sep 17 00:00:00 2001 From: JaeYoo-Im Date: Thu, 11 Apr 2024 21:17:39 +0900 Subject: [PATCH] random wallpaper env selection. --- .config/bspwm/bspwmrc | 6 +++--- scripts/random_wallpaper.sh | 37 ++++++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 0fd1892..5857b12 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -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 diff --git a/scripts/random_wallpaper.sh b/scripts/random_wallpaper.sh index f5e71e7..73747a5 100755 --- a/scripts/random_wallpaper.sh +++ b/scripts/random_wallpaper.sh @@ -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"