summaryrefslogtreecommitdiffstats
path: root/bin/hyprland
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-01-07 12:00:08 -0500
committerJon Santmyer <jon@jonsantmyer.com>2024-01-07 12:00:08 -0500
commit7b79203f54853733d4fae88943829d0e24e6e49f (patch)
treea352d199fad7453332b9308a6295164157729f27 /bin/hyprland
parent184bd30bcb303104a4981ac742d8f8961c5477e7 (diff)
downloadnix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.gz
nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.bz2
nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.zip
massive overhaul
Diffstat (limited to 'bin/hyprland')
-rwxr-xr-xbin/hyprland/workspace13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/hyprland/workspace b/bin/hyprland/workspace
new file mode 100755
index 0000000..8be4593
--- /dev/null
+++ b/bin/hyprland/workspace
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+activemonitor=$(hyprctl monitors -j | jq '.[] | select(.focused == true).id')
+activemonitorname=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')
+passivemonitor=$(hyprctl monitors -j | jq '.[] | select(.focused == false).id')
+activews=$(hyprctl monitors -j | jq '.[] | select(.focused == true).activeWorkspace.id')
+passivews=$(hyprctl monitors -j | jq '.[] | select(.focused == false).activeWorkspace.id')
+
+[[ $1 -eq $passivews ]] && [[ $passivemonitor != "$activemonitor" ]] && (hyprctl dispatch swapactiveworkspaces "$activemonitor $passivemonitor")
+hyprctl dispatch moveworkspacetomonitor "$1 $activemonitor"
+hyprctl dispatch focusmonitor "$activemonitor"
+hyprctl dispatch workspace "$1"
+hyprctl hyprpaper wallpaper "$activemonitorname,/etc/nixos/config/hypr/wallpaper.png"