From 24d57001df4cb1f3ed8bca4615c63c6a79c7a68a Mon Sep 17 00:00:00 2001 From: "s0wlz (Matthias Puchstein)" Date: Sat, 28 Feb 2026 20:17:07 +0100 Subject: [PATCH] hypr/autostart: route joplin and teamspeak to named workspaces --- dot_config/autostart/joplin-desktop.desktop | 11 ++++++++ dot_config/autostart/teamspeak.desktop | 11 ++++++++ dot_config/hypr/hyprland.d/60-rules.conf | 5 +++- .../hypr/hyprland.d/70-keybinds.conf.tmpl | 3 +++ dot_config/waybar/config.tmpl | 1 + dot_local/bin/executable_hypr-joplin-toggle | 25 +++++++++++++++++++ 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 dot_config/autostart/joplin-desktop.desktop create mode 100644 dot_config/autostart/teamspeak.desktop create mode 100644 dot_local/bin/executable_hypr-joplin-toggle diff --git a/dot_config/autostart/joplin-desktop.desktop b/dot_config/autostart/joplin-desktop.desktop new file mode 100644 index 0000000..f67987e --- /dev/null +++ b/dot_config/autostart/joplin-desktop.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Joplin +Comment=Joplin for Desktop +Exec=/usr/bin/joplin-desktop +Terminal=false +Icon=joplin-desktop +StartupWMClass=@joplin/app-desktop +Type=Application +Categories=Office; +MimeType=x-scheme-handler/joplin; +SingleMainWindow=true diff --git a/dot_config/autostart/teamspeak.desktop b/dot_config/autostart/teamspeak.desktop new file mode 100644 index 0000000..6876472 --- /dev/null +++ b/dot_config/autostart/teamspeak.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Type=Application +StartupNotify=false +Name=TeamSpeak +Icon=teamspeak-client +Comment=TeamSpeak Voice Communication Client +Categories=Audio;Chat;Network; +StartupWMClass=TeamSpeak +MimeType=x-scheme-handler/ts3server;x-scheme-handler/teamspeak; +Exec=teamspeak %u diff --git a/dot_config/hypr/hyprland.d/60-rules.conf b/dot_config/hypr/hyprland.d/60-rules.conf index 36212c8..62d6792 100644 --- a/dot_config/hypr/hyprland.d/60-rules.conf +++ b/dot_config/hypr/hyprland.d/60-rules.conf @@ -82,13 +82,16 @@ workspace = special:passwordmgr, on-created-empty:bitwarden-desktop ## ========== Communication ========== # Comms -windowrule = match:class ^(info\.mumble\.Mumble|discord|TeamSpeak|teamspeak3|vesktop)$, workspace name:comms +windowrule = match:class ^(info\.mumble\.Mumble|discord|vesktop|teamspeak-client|TeamSpeak|TeamSpeak 3|teamspeak3)$, workspace name:comms # Element windowrule = match:class ^(Element)$, workspace name:element ## ========== Mail ========== windowrule = match:class ^(org\.mozilla\.Thunderbird)$, workspace name:mail +## ========== Notes ========== +windowrule = match:class ^(@joplin/app-desktop)$, workspace name:joplin + ## ========== Multimedia ========== windowrule = match:class Spotify, workspace 10 diff --git a/dot_config/hypr/hyprland.d/70-keybinds.conf.tmpl b/dot_config/hypr/hyprland.d/70-keybinds.conf.tmpl index 3c9c172..7eb452e 100644 --- a/dot_config/hypr/hyprland.d/70-keybinds.conf.tmpl +++ b/dot_config/hypr/hyprland.d/70-keybinds.conf.tmpl @@ -65,6 +65,9 @@ bind = $mainMod, D, exec, hypr-comms-toggle # Mail bind = $mainMod SHIFT, A, exec, hypr-mail-toggle +# Notes +bind = $mainMod SHIFT, D, exec, hypr-joplin-toggle + # Gaming bind = $mainMod, S, exec, hypr-steam-toggle diff --git a/dot_config/waybar/config.tmpl b/dot_config/waybar/config.tmpl index 8cd1805..95f8a31 100644 --- a/dot_config/waybar/config.tmpl +++ b/dot_config/waybar/config.tmpl @@ -77,6 +77,7 @@ "comms": "", "element": "", "mail": "", + "joplin": "", "steam": "", "default": "", "special": "" diff --git a/dot_local/bin/executable_hypr-joplin-toggle b/dot_local/bin/executable_hypr-joplin-toggle new file mode 100644 index 0000000..cdb3606 --- /dev/null +++ b/dot_local/bin/executable_hypr-joplin-toggle @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +joplin_ws="name:joplin" +joplin_name="joplin" + +active_name="" +if json="$(hyprctl -j activeworkspace 2>/dev/null)"; then + if command -v jq >/dev/null 2>&1; then + active_name="$(printf '%s' "$json" | jq -r '.name // empty')" + else + active_name="$(printf '%s' "$json" | sed -n 's/.*"name":"\\([^"]*\\)".*/\\1/p')" + fi +fi + +if [[ -z "$active_name" ]]; then + active_name="$(hyprctl activeworkspace 2>/dev/null | sed -n 's/.*(\\(.*\\)).*/\\1/p' | head -n1)" +fi + +if [[ "$active_name" == "$joplin_name" || "$active_name" == "$joplin_ws" ]]; then + hyprctl dispatch workspace previous +else + hyprctl dispatch moveworkspacetomonitor "$joplin_ws" current + hyprctl dispatch workspace "$joplin_ws" +fi