simplified workspaces

This commit is contained in:
2026-03-16 13:14:41 +01:00
parent 59be243b0d
commit 17c577c9ac
7 changed files with 6 additions and 156 deletions

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
comms_ws="name:comms"
comms_name="comms"
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" == "$comms_name" || "$active_name" == "$comms_ws" ]]; then
hyprctl dispatch workspace previous
else
hyprctl dispatch moveworkspacetomonitor "$comms_ws" current
hyprctl dispatch workspace "$comms_ws"
fi

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
element_ws="name:element"
element_name="element"
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" == "$element_name" || "$active_name" == "$element_ws" ]]; then
hyprctl dispatch workspace previous
else
hyprctl dispatch moveworkspacetomonitor "$element_ws" current
hyprctl dispatch workspace "$element_ws"
fi

View File

@@ -1,25 +0,0 @@
#!/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

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
mail_ws="name:mail"
mail_name="mail"
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" == "$mail_name" || "$active_name" == "$mail_ws" ]]; then
hyprctl dispatch workspace previous
else
hyprctl dispatch moveworkspacetomonitor "$mail_ws" current
hyprctl dispatch workspace "$mail_ws"
fi

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
spotify_ws="name:spotify"
spotify_name="spotify"
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" == "$spotify_name" || "$active_name" == "$spotify_ws" ]]; then
hyprctl dispatch workspace previous
else
hyprctl dispatch moveworkspacetomonitor "$spotify_ws" current
hyprctl dispatch workspace "$spotify_ws"
fi

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
steam_ws="name:steam"
steam_name="steam"
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" == "$steam_name" || "$active_name" == "$steam_ws" ]]; then
hyprctl dispatch workspace previous
else
hyprctl dispatch moveworkspacetomonitor "$steam_ws" current
hyprctl dispatch workspace "$steam_ws"
fi