lock tg on locking sway

This commit is contained in:
thek4n 2026-04-15 13:38:14 +03:00
parent 45d25d6ac0
commit e3a9e470f5
4 changed files with 22 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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"