hypr/autostart: route joplin and teamspeak to named workspaces

This commit is contained in:
2026-02-28 20:17:07 +01:00
parent dadad155b2
commit 24d57001df
6 changed files with 55 additions and 1 deletions

View File

@@ -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