diff --git a/bin/wallpaper.sh b/bin/wallpaper.sh index 48c0b96..8ef445b 100755 --- a/bin/wallpaper.sh +++ b/bin/wallpaper.sh @@ -1,20 +1,25 @@ #!/bin/bash +# Built for sway with optional dependancy on swaybg for ease of setting + wallpapers_dir=~/.local/share/wallpapers finder="rofi-dmenu Wallpaper" +cur_wallpaper="$HOME/.wallpaper" -cd "$wallpapers_dir" - +# selection mode if [ "$1" == "-s" ] ; then + cd "$wallpapers_dir" + selection=$(find -L -type f -printf '%P\n' | $finder) if [ -n "$selection" ] ; then # didnt exit, overwrite wallpaper - ln -sf "$wallpapers_dir/$selection" "$HOME/.wallpaper" + ln -sf "$wallpapers_dir/$selection" "$cur_wallpaper" fi fi -# fill in wallpaper on each dispaly -for display in $(swaymsg -t get_outputs | gojq '.[].name' | tr -d '"') -do - swaymsg output "$display" bg "$HOME/.wallpaper" fill '#000000' -done +# check that available wallpaper exists +if [ ! -f "$cur_wallpaper" ] ; then + echo "No wallpaper found" && exit 1 +fi + +swaymsg output "*" bg "$cur_wallpaper" fill '#000000' diff --git a/gui/sway/base b/gui/sway/base index fb1fc9c..3aa7dcd 100644 --- a/gui/sway/base +++ b/gui/sway/base @@ -13,6 +13,7 @@ smart_gaps on # background exec_always wallpaper.sh +# waybar bar { swaybar_command waybar } @@ -23,7 +24,7 @@ assign [class="Brave-browser"] 2 # launching default apps exec st -e tmux -exec brave +exec --no-startup-id brave # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod @@ -41,7 +42,7 @@ exec swayidle -w \ # lock 'swaylock -f --screenshots --effect-blur 10x3 --clock' # lock the screen -bindsym $mod+q exec "swaylock -f --screenshots --effect-blur 10x3 --clock --indicator --timestr" +bindsym $mod+q exec "swaylock -f --screenshots --effect-blur 10x3 --clock --indicator" # bindsym $mod+q exec sleep 1 && killall -SIGUSR1 swayidle # kill focused window @@ -168,4 +169,3 @@ mode "resize" { } bindsym $mod+r mode "resize" -