diff --git a/home/user/.config/sway/bindings.conf b/home/user/.config/sway/bindings.conf index 4239972..93981b5 100644 --- a/home/user/.config/sway/bindings.conf +++ b/home/user/.config/sway/bindings.conf @@ -31,7 +31,7 @@ bindsym --release XF86Go exec --no-startup-id pactl set-source-mute @DEFAULT_SOU bindsym $mod+XF86AudioMicMute exec --no-startup-id pactl list short sources | awk '/input.*RUNNING/ {system("pactl set-source-mute " $1 " toggle")}' ## Find and mute mics -bindsym --to-code $mod+s exec ~/.config/sway/scripts/swap_workspaces.sh +bindsym --to-code $mod+s exec ~/.config/sway/scripts/swap-workspaces.sh bindsym --to-code $mod+Shift+q kill bindsym --to-code $mod+Shift+r reload @@ -103,8 +103,8 @@ mode $exitmode { bindsym --to-code e exit bindsym --to-code r exec --no-startup-id reboot bindsym --to-code s exec --no-startup-id shutdown -h now - bindsym --to-code u exec --no-startup-id systemctl suspend; mode "default" - bindsym --to-code l exec swaylock -f; mode "default" + bindsym --to-code u exec ~/.config/sway/scripts/lock-telegram.sh && systemctl suspend; mode "default" + bindsym --to-code l exec ~/.config/sway/scripts/lock-telegram.sh && swaylock -f; mode "default" bindsym --to-code b exec magick canvas:none PNG:- | feh --class black -YFx -; mode "default" bindsym --to-code Shift+r exec --no-startup-id systemctl reboot --firmware-setup diff --git a/home/user/.config/sway/scripts/lock-telegram.sh b/home/user/.config/sway/scripts/lock-telegram.sh new file mode 100755 index 0000000..4a987fb --- /dev/null +++ b/home/user/.config/sway/scripts/lock-telegram.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +TELEGRAM_WINDOW=$(swaymsg -t get_tree | jq -r '.. | select(.app_id? == "org.telegram.desktop") | .id' | head -n 1) + +if [ -z "${TELEGRAM_WINDOW}" ]; then + echo "Telegram_not_found!" + exit 0 +fi + +swaymsg "[con_id=${TELEGRAM_WINDOW}] focus" + +sleep 0.2 + +wtype -M ctrl l + +swaymsg workspace back_and_forth + +exit 0 diff --git a/home/user/.config/sway/scripts/swap_workspaces.sh b/home/user/.config/sway/scripts/swap-workspaces.sh similarity index 100% rename from home/user/.config/sway/scripts/swap_workspaces.sh rename to home/user/.config/sway/scripts/swap-workspaces.sh diff --git a/install-hooks/sway/pre-install b/install-hooks/sway/pre-install index 1948aa3..66e0659 100755 --- a/install-hooks/sway/pre-install +++ b/install-hooks/sway/pre-install @@ -1,3 +1,3 @@ #!/bin/sh -echo "pacman -S sway swaybg i3blocks waybar swaylock swayidle wl-clipboard ydotool grim slurp mako wlr-randr rofi jq brightnessctl" +echo "pacman -S sway swaybg i3blocks waybar swaylock swayidle wl-clipboard ydotool grim slurp mako wlr-randr rofi jq brightnessctl wtype"