fixing swaybg and brave getting merked on reboot

This commit is contained in:
spinach 2024-02-27 15:58:03 -05:00
parent d7810071cd
commit 89d863c084
2 changed files with 16 additions and 11 deletions

View File

@ -1,20 +1,25 @@
#!/bin/bash #!/bin/bash
# Built for sway with optional dependancy on swaybg for ease of setting
wallpapers_dir=~/.local/share/wallpapers wallpapers_dir=~/.local/share/wallpapers
finder="rofi-dmenu Wallpaper" finder="rofi-dmenu Wallpaper"
cur_wallpaper="$HOME/.wallpaper"
cd "$wallpapers_dir" # selection mode
if [ "$1" == "-s" ] ; then if [ "$1" == "-s" ] ; then
cd "$wallpapers_dir"
selection=$(find -L -type f -printf '%P\n' | $finder) selection=$(find -L -type f -printf '%P\n' | $finder)
if [ -n "$selection" ] ; then if [ -n "$selection" ] ; then
# didnt exit, overwrite wallpaper # didnt exit, overwrite wallpaper
ln -sf "$wallpapers_dir/$selection" "$HOME/.wallpaper" ln -sf "$wallpapers_dir/$selection" "$cur_wallpaper"
fi fi
fi fi
# fill in wallpaper on each dispaly # check that available wallpaper exists
for display in $(swaymsg -t get_outputs | gojq '.[].name' | tr -d '"') if [ ! -f "$cur_wallpaper" ] ; then
do echo "No wallpaper found" && exit 1
swaymsg output "$display" bg "$HOME/.wallpaper" fill '#000000' fi
done
swaymsg output "*" bg "$cur_wallpaper" fill '#000000'

View File

@ -13,6 +13,7 @@ smart_gaps on
# background # background
exec_always wallpaper.sh exec_always wallpaper.sh
# waybar
bar { bar {
swaybar_command waybar swaybar_command waybar
} }
@ -23,7 +24,7 @@ assign [class="Brave-browser"] 2
# launching default apps # launching default apps
exec st -e tmux exec st -e tmux
exec brave exec --no-startup-id brave
# Use Mouse+$mod to drag floating windows to their wanted position # Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod floating_modifier $mod
@ -41,7 +42,7 @@ exec swayidle -w \
# lock 'swaylock -f --screenshots --effect-blur 10x3 --clock' # lock 'swaylock -f --screenshots --effect-blur 10x3 --clock'
# lock the screen # 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 # bindsym $mod+q exec sleep 1 && killall -SIGUSR1 swayidle
# kill focused window # kill focused window
@ -168,4 +169,3 @@ mode "resize" {
} }
bindsym $mod+r mode "resize" bindsym $mod+r mode "resize"