aboutsummaryrefslogtreecommitdiff
path: root/home-manager/homeModules/attachments/hypr-scripts
diff options
context:
space:
mode:
authorspl3g <spleefer6@yandex.ru>2025-05-02 19:58:38 +0300
committerspl3g <spleefer6@yandex.ru>2025-05-02 19:58:38 +0300
commitfe8e04a4a3ba2439423620a9dcc9b0791b3c3fd6 (patch)
tree9f3ea38546fe59cb679811003277671ede102a9c /home-manager/homeModules/attachments/hypr-scripts
parentdce1f40f9b80bc221d1b960efced2369384a278f (diff)
feat(hyprland): add a script to toggle tg
Diffstat (limited to 'home-manager/homeModules/attachments/hypr-scripts')
-rwxr-xr-xhome-manager/homeModules/attachments/hypr-scripts/toggle-tg.sh12
-rwxr-xr-xhome-manager/homeModules/attachments/hypr-scripts/toggle-vpn.sh2
2 files changed, 13 insertions, 1 deletions
diff --git a/home-manager/homeModules/attachments/hypr-scripts/toggle-tg.sh b/home-manager/homeModules/attachments/hypr-scripts/toggle-tg.sh
new file mode 100755
index 0000000..1960f47
--- /dev/null
+++ b/home-manager/homeModules/attachments/hypr-scripts/toggle-tg.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+tg_workspace=$(hyprctl clients -j | jq -e '.[] | select((.class | contains("org.telegram.desktop"))) | .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
+else
+ hyprctl dispatch movetoworkspacesilent +0,class:org.telegram.desktop
+ hyprctl dispatch pin class:org.telegram.desktop
+fi
diff --git a/home-manager/homeModules/attachments/hypr-scripts/toggle-vpn.sh b/home-manager/homeModules/attachments/hypr-scripts/toggle-vpn.sh
index c7f42be..8775f39 100755
--- a/home-manager/homeModules/attachments/hypr-scripts/toggle-vpn.sh
+++ b/home-manager/homeModules/attachments/hypr-scripts/toggle-vpn.sh
@@ -65,9 +65,9 @@ if [[ -z "${TOKEN}" ]]; then
fi
STATUS=$(get_status $TOKEN)
-echo $STATUS > $TMP_PATH
if [[ $1 == "waybar" ]]; then
+ echo $STATUS > $TMP_PATH
check_status
dbus-monitor --profile "interface='${DBUS_INTERFACE}',member='${DBUS_MEMBER}'" |