refactor lock-telegram.sh script
This commit is contained in:
parent
e3a9e470f5
commit
98522f5056
@ -1,9 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
TELEGRAM_WINDOW=$(swaymsg -t get_tree | jq -r '.. | select(.app_id? == "org.telegram.desktop") | .id' | head -n 1)
|
TELEGRAM_WINDOW="$(
|
||||||
|
swaymsg -t get_tree | \
|
||||||
|
jq -r '.. | select(.app_id? == "org.telegram.desktop") | .id' | \
|
||||||
|
head -n 1
|
||||||
|
)"
|
||||||
|
|
||||||
|
readonly TELEGRAM_WINDOW
|
||||||
|
|
||||||
|
|
||||||
if [ -z "${TELEGRAM_WINDOW}" ]; then
|
if [ -z "${TELEGRAM_WINDOW}" ]; then
|
||||||
echo "Telegram_not_found!"
|
echo "Error: Telegram not found"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user