#!/usr/bin/bash # generate ids from 1-100, remove the ids of existing workspaces, take the # first of the remaining numbers and you have the first available workspace id FIRST_AVAILABLE=$(hyprctl workspaces -j | jq '[range(1; 100)] - map(.id) | .[0]') hyprctl dispatch workspace $FIRST_AVAILABLE