From 5974ae879e010e81ff7cd9b1d4425e632bd79b40 Mon Sep 17 00:00:00 2001 From: Random936 Date: Wed, 14 Feb 2024 21:38:42 -0800 Subject: [PATCH] Created dedicated wallapers.sh script and added betterlockscreen to i3 --- .config/i3/config | 25 ++++++------------------- .screenlayout/launch.sh | 19 +++++++------------ .screenlayout/wallpapers.sh | 10 ++++++++++ 3 files changed, 23 insertions(+), 31 deletions(-) create mode 100644 .screenlayout/wallpapers.sh diff --git a/.config/i3/config b/.config/i3/config index 7fe14d9..f5e1ffc 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -3,10 +3,9 @@ set $mod Mod4 # Set font font pango:monospace 8 -# Init i3 lock and enable autolock -exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork -exec --no-startup-id xset dpms 600 -exec --no-startup-id xautolock -time 10 -locker i3lock +# Configure betterlockscreen +exec --no-startup-id "betterlockscreen -l dim -u $HOME/Pictures" +bindsym $mod+Shift+x exec "betterlockscreen -l dim -w" # Use pactl to adjust volume in PulseAudio. set $refresh_i3status killall -SIGUSR1 i3status @@ -37,24 +36,12 @@ bindsym $mod+k focus up bindsym $mod+j focus down bindsym $mod+l focus right -# alternatively, you can use the cursor keys: -bindsym $mod+Left focus left -bindsym $mod+Down focus down -bindsym $mod+Up focus up -bindsym $mod+Right focus right - # move focused window bindsym $mod+Shift+h move left bindsym $mod+Shift+k move up bindsym $mod+Shift+j move down bindsym $mod+Shift+l move right -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right - # split in horizontal orientation bindsym $mod+semicolon split h @@ -155,11 +142,11 @@ bindsym l resize shrink width 10 px or 10 ppt bindsym $mod+r mode "resize" # Brightness keys setup -bindsym XF86MonBrightnessDown exec --no-startup-id "sudo $HOME/.scripts/brightness.sh -5" -bindsym XF86MonBrightnessUp exec --no-startup-id "sudo $HOME/.scripts/brightness.sh 5" +bindsym XF86MonBrightnessDown exec --no-startup-id "doas $HOME/.scripts/brightness.sh -5" +bindsym XF86MonBrightnessUp exec --no-startup-id "doas $HOME/.scripts/brightness.sh 5" # Window Cosmetic Changes -gaps inner 10 +gaps inner 5 new_window pixel 3 client.focused #555555 #555555 #ffffff #333333 #0000ff client.focused_inactive #333333 #222222 #888888 #292d2e #eeeeee diff --git a/.screenlayout/launch.sh b/.screenlayout/launch.sh index 74c1cd1..b1d1830 100755 --- a/.screenlayout/launch.sh +++ b/.screenlayout/launch.sh @@ -1,16 +1,11 @@ #!/bin/bash -# Load screen layout script if it exists -script="$HOME/.screenlayout/layout.sh" -if [ -f "$script" ]; then - $script -fi +function load_script() { + if [ -f "$1" ]; then + $1 + fi +} -# 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) +load_script "$HOME/.screenlayout/layout.sh" # screen layout script +load_script "$HOME/.screenlayout/wallpapers.sh" # wallpapers script -echo "$feh_command" -eval "$feh_command" diff --git a/.screenlayout/wallpapers.sh b/.screenlayout/wallpapers.sh new file mode 100644 index 0000000..3740c24 --- /dev/null +++ b/.screenlayout/wallpapers.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# 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"