From 03648b3d9f177227df40129bed22558f6924b91c Mon Sep 17 00:00:00 2001 From: spl3g Date: Wed, 18 Mar 2026 18:01:41 +0300 Subject: so.. v2 i guess --- modules/homeModules/attachments/hypr-scripts/toggle-tg.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 modules/homeModules/attachments/hypr-scripts/toggle-tg.sh (limited to 'modules/homeModules/attachments/hypr-scripts/toggle-tg.sh') diff --git a/modules/homeModules/attachments/hypr-scripts/toggle-tg.sh b/modules/homeModules/attachments/hypr-scripts/toggle-tg.sh new file mode 100755 index 0000000..44ed52d --- /dev/null +++ b/modules/homeModules/attachments/hypr-scripts/toggle-tg.sh @@ -0,0 +1,14 @@ +#!/bin/sh +TG_CLASS=org.telegram.desktop + +tg_workspace=$(hyprctl clients -j | jq -e ".[] | select((.class | contains(\"${TG_CLASS}\"))) | .workspace.id") +if [[ -z $tg_workspace ]]; then + telegram-desktop +elif [[ $tg_workspace -eq $(hyprctl activeworkspace -j | jq -e '.id') ]]; then + hyprctl dispatch pin class:$TG_CLASS + hyprctl dispatch movetoworkspacesilent special:magic,class:$TG_CLASS +else + hyprctl dispatch movetoworkspacesilent +0,class:$TG_CLASS + hyprctl dispatch pin class:$TG_CLASS + hyprctl dispatch focuswindow +fi -- cgit v1.2.3