diff --git a/.config/i3/config b/.config/i3/config index e7a51cf..d37b391 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -165,8 +165,6 @@ client.focused_inactive #333333 #222222 #888888 #292d2e #eeeeee client.unfocused #333333 #222222 #888888 #292d2e #eeeeee # Startup Applications -exec --no-startup-id "$HOME/.screenlayout/launch.sh" # load xrandr screen layout -exec --no-startup-id "xmodmap $HOME/.Xmodmap" # update capslock key exec --no-startup-id "lxpolkit &" # start authentication agent (prompt) exec --no-startup-id "xcompmgr &" # startup composition manager (transparency) exec --no-startup-id "polybar" # status bar diff --git a/.screenlayout/launch.sh b/.screenlayout/launch.sh index b3525f4..74c1cd1 100755 --- a/.screenlayout/launch.sh +++ b/.screenlayout/launch.sh @@ -1,9 +1,16 @@ #!/bin/bash +# Load screen layout script if it exists script="$HOME/.screenlayout/layout.sh" - if [ -f "$script" ]; then $script fi -feh --bg-scale $HOME/Pictures/wallpaper.jpg +# Dynamically load background with feh +feh_command="feh --bg-fill" +while read resolution; do + feh_command="$feh_command ~/Pictures/wallpaper-$resolution.jpg" +done < <(xrandr | grep ' connected' | grep -oP '[0-9]+x[0-9]+\+[0-9]+\+[0-9]+' | cut -d '+' -f 1) + +echo "$feh_command" +eval "$feh_command" diff --git a/.xinitrc b/.xinitrc index 9b9b2d7..23e0431 100644 --- a/.xinitrc +++ b/.xinitrc @@ -28,7 +28,6 @@ if [ -d /etc/X11/xinit/xinitrc.d ]; then unset f fi -feh --bg-scale $HOME/Pictures/wallpaper.jpg & -$HOME/.screenlayout/launch.sh & /usr/libexec/polkit-gnome-authentication-agent-1 & +$HOME/.screenlayout/launch.sh & exec dbus-launch --exit-with-session i3