button and script to create and switch to a new workspace

This commit is contained in:
2025-06-19 09:52:45 +02:00
parent 85483b87de
commit 9aea7f501b
6 changed files with 70 additions and 32 deletions

View File

@@ -1,4 +0,0 @@
#!/usr/bin/env bash
# https://github.com/end-4/dots-hyprland/blob/main/.config/ags/scripts/hyprland/workspace_action.sh
hyprctl dispatch "$1" $(((($(hyprctl activeworkspace -j | jq -r .id) - 1) / 10) * 10 + $2))

11
.scripts/workspace-new.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
# get highest workspace ID
max_id=$(hyprctl workspaces | grep '^workspace ID ' | awk '{print $3}' | sort -n | tail -1)
# case not found default to 0
if [ -z "$max_id" ]; then
max_id=0
fi
hyprctl dispatch workspace $((max_id + 1))