diff options
| author | spl3g <spleefer6@yandex.ru> | 2025-08-12 00:52:56 +0500 |
|---|---|---|
| committer | spl3g <spleefer6@yandex.ru> | 2025-08-12 00:52:56 +0500 |
| commit | 5772551755e22c8c138dcb72f2900a82423a3384 (patch) | |
| tree | 6c4148603e945cc897f696259d0596a9360007fb /home-manager/homeModules/attachments/hypr-scripts | |
| parent | 955db0ddf78416812e2d7fcf429370322b32698b (diff) | |
feat(hyprland): improve the tg-toggle script
Diffstat (limited to 'home-manager/homeModules/attachments/hypr-scripts')
| -rwxr-xr-x | home-manager/homeModules/attachments/hypr-scripts/toggle-tg.sh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/home-manager/homeModules/attachments/hypr-scripts/toggle-tg.sh b/home-manager/homeModules/attachments/hypr-scripts/toggle-tg.sh index 1960f47..44ed52d 100755 --- a/home-manager/homeModules/attachments/hypr-scripts/toggle-tg.sh +++ b/home-manager/homeModules/attachments/hypr-scripts/toggle-tg.sh @@ -1,12 +1,14 @@ #!/bin/sh +TG_CLASS=org.telegram.desktop -tg_workspace=$(hyprctl clients -j | jq -e '.[] | select((.class | contains("org.telegram.desktop"))) | .workspace.id') +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:org.telegram.desktop - hyprctl dispatch movetoworkspacesilent special:magic,class:org.telegram.desktop + hyprctl dispatch pin class:$TG_CLASS + hyprctl dispatch movetoworkspacesilent special:magic,class:$TG_CLASS else - hyprctl dispatch movetoworkspacesilent +0,class:org.telegram.desktop - hyprctl dispatch pin class:org.telegram.desktop + hyprctl dispatch movetoworkspacesilent +0,class:$TG_CLASS + hyprctl dispatch pin class:$TG_CLASS + hyprctl dispatch focuswindow fi |
