Add the "improved-workspace-indicator" GNOME extension

This commit is contained in:
Alexander Hess 2026-10-20 15:41:58 +02:00
commit f52d4e4cc6
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
6 changed files with 124 additions and 5 deletions

View file

@ -0,0 +1,38 @@
#!/bin/sh
# Jump to the first empty workspace
#
# Triggered by <Super>n
# as defined in [org/gnome/settings-daemon/plugins/media-keys]
# in ~/.config/gnome-settings/key-bindings.ini
#
# Note: This assumes that only the main monitor has workspaces enabled
# (see ~/.local/bin/move-window-to-empty-workspace)
set -eu
occupied=$(wmctrl -l) || exit 1 # fail safe
occupied=$(echo "$occupied" | awk '{print $2}' | sort -u)
total=$(wmctrl -d | wc -l)
# 0-based index for the first workspace
i=0
while [ "$i" -lt "$total" ]; do
if ! echo "$occupied" | grep -qx "$i"; then
exec wmctrl -s "$i"
fi
i=$((i + 1))
done
command -v notify-send >/dev/null \
&& notify-send 'Workspaces' 'No empty workspace available'
exit 1