dotfiles/home/user/.config/sway/scripts/lock-telegram.sh
2026-04-15 13:38:14 +03:00

19 lines
326 B
Bash
Executable File

#!/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