diff --git a/TARGETS.sh b/TARGETS.sh index 0492d6e..6a9582b 100644 --- a/TARGETS.sh +++ b/TARGETS.sh @@ -13,7 +13,7 @@ git:.config/git .local/bin/ga ranger:.config/ranger gpg: i3:.xinitrc .xprofile .Xresources .config/i3 .config/i3blocks .config/rofi .config/picom .local/bin/slm .local/bin/slm_rofi.sh .local/bin/power_rofi.sh .local/bin/i3_switch_workspace.sh .config/mimeapps.list .local/bin/screenshot .local/bin/i3_swap_workspaces .local/bin/i3blocks_helper .local/bin/switch-layout %pomodoro -sway:.config/sway .config/i3blocks .config/mako .config/mimeapps.list .local/bin/screenshot .local/bin/i3blocks_helper %pomodoro +sway:.config/sway .config/i3blocks .config/mako .config/mimeapps.list .local/bin/screenshot .local/bin/i3blocks_helper .local/bin/layout_change_handler .Xresources %pomodoro pomodoro: bat:.config/bat font: diff --git a/home/user/.config/i3blocks/config b/home/user/.config/i3blocks/config index 429c0c5..58d4ec6 100644 --- a/home/user/.config/i3blocks/config +++ b/home/user/.config/i3blocks/config @@ -53,8 +53,7 @@ signal=10 [language] command=i3blocks_helper language -interval=1 -signal=11 +signal=1 [time] command=i3blocks_helper time diff --git a/home/user/.config/sway/autostart.conf b/home/user/.config/sway/autostart.conf index d1ad5f3..a44f75e 100644 --- a/home/user/.config/sway/autostart.conf +++ b/home/user/.config/sway/autostart.conf @@ -2,10 +2,12 @@ # Sway autostart exec swayidle -w \ - timeout 1800 'swaylock -f' \ + timeout 1800 'swaylock --ignore-empty-password --show-failed-attempts -f' \ timeout 1805 'swaymsg "output * power off"' \ resume 'swaymsg "output * power on"' # Notifications #systemctl --user enable --now dbus.service exec --no-startup-id mako + +exec --no-startup-id layout_change_handler diff --git a/home/user/.config/sway/bindings.conf b/home/user/.config/sway/bindings.conf index f5c9535..f990b8b 100644 --- a/home/user/.config/sway/bindings.conf +++ b/home/user/.config/sway/bindings.conf @@ -99,7 +99,7 @@ mode $exitmode { bindsym --to-code r exec reboot bindsym --to-code s exec shutdown -h now bindsym --to-code u exec systemctl suspend; mode "default" - bindsym --to-code l exec $i3lock_cmd; mode "default" + bindsym --to-code l exec swaylock --ignore-empty-password --show-failed-attempts; mode "default" bindsym --to-code b exec magick canvas:none PNG:- | feh -YFx -; mode "default" bindsym Escape mode "default" diff --git a/home/user/.config/sway/other.conf b/home/user/.config/sway/other.conf index d62ae6f..a589cf6 100644 --- a/home/user/.config/sway/other.conf +++ b/home/user/.config/sway/other.conf @@ -29,3 +29,7 @@ bar { position bottom status_command i3blocks } + +output * bg "$(find ~/.wallpaper -type f | shuf -n 1)" fill + +exec_always test -f ~/.Xresources && xrdb -merge ~/.Xresources diff --git a/home/user/.local/bin/layout_change_handler b/home/user/.local/bin/layout_change_handler new file mode 100755 index 0000000..1dc0cbc --- /dev/null +++ b/home/user/.local/bin/layout_change_handler @@ -0,0 +1,8 @@ +#!/bin/sh + +swaymsg -m -t SUBSCRIBE "['input']" | \ +jq --unbuffered -r '.change' | while read -r line; do + if echo "${line}" | grep -q "xkb_layout"; then + pkill -RTMIN+1 i3blocks + fi +done