u/Herbo

Better workspace switcher for multi-monitor setups

If you're running a multi-monitor setup in omarchy and want to cycle through workspaces on each monitor independently using a mouse button or keybind, the built-in dispatchers don't quite cut it:

  • workspace e+1 cycles through all workspaces across all monitors
  • focusworkspaceoncurrentmonitor still pulls workspaces assigned to other monitors

So I put together a small script that only cycles through workspaces already on the active monitor, and opens a fresh empty workspace if there's only one.

Open up a terminal and paste the following:

cat > ~/.local/bin/workspace-cycle.sh << 'EOF'
#!/bin/bash
DIRECTION=$1  # "next" or "prev"

# Get active monitor and its current workspace
MONITOR=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true)')
CURRENT=$(echo $MONITOR | jq -r '.activeWorkspace.id')
MONITOR_NAME=$(echo $MONITOR | jq -r '.name')

# Get all workspaces on this monitor, sorted
WORKSPACES=$(hyprctl workspaces -j | jq -r --arg m "$MONITOR_NAME" \
    '[.[] | select(.monitor == $m)] | sort_by(.id) | .[].id')

IDS=($WORKSPACES)
COUNT=${#IDS[@]}

# If only one workspace on this monitor, open a new empty one
if [ "$COUNT" -le 1 ]; then
    hyprctl dispatch workspace empty
    exit 0
fi

# Find next/prev in list
for i in "${!IDS[@]}"; do
    if [ "${IDS[$i]}" = "$CURRENT" ]; then
        if [ "$DIRECTION" = "next" ]; then
            TARGET=${IDS[$(( (i + 1) % COUNT ))]}
        else
            TARGET=${IDS[$(( (i - 1 + COUNT) % COUNT ))]}
        fi
        hyprctl dispatch workspace $TARGET
        break
    fi
done    
EOF
chmod +x ~/.local/bin/workspace-cycle.sh

Then add to your ~/.config/hypr/bindings.conf:

bind = SHORTCUT_KEY1, SHORTCUT_KEY2, exec, ~/.local/bin/workspace-cycle.sh next
bind = SHORTCUT_KEY1, SHORTCUT_KEY2, exec, ~/.local/bin/workspace-cycle.sh prev

Not sure what your shortcut key/mouse button is called? Run wev and press it to find out.

reddit.com
u/Herbo — 1 day ago
▲ 20 r/omarchy

TIP: How to Find Key Names for Rebinding Using "wev"

If you've ever wanted to rebind keys in Omarchy but couldn't figure out the exact key names to use in your config, here's a simple trick that solves that problem entirely.

Steps

  1. Open a terminal
  2. Run: wev
  3. Press any key or button you're interested in
  4. Look for the sym field in the output — that's your key name

Keys worth considering for rebinding

There are quite a few keys that sit largely unused on a typical keyboard and are great candidates for repurposing:

Menu — the context menu key (usually between Right Alt and Right Ctrl)
Control_R — Right Control
Alt_R — Right Alt
Scroll_Lock — almost universally unused these days
Pause / Break — another relic most people never touch

What is wev?

wev (Wayland Event Viewer) is a small utility that listens for and prints input events in real time — keyboard presses, mouse clicks, scroll wheel movement, you name it. Every time you interact with your input devices, wev logs the details to the terminal, including the exact key name you'll need for rebinding. It's the most reliable way to get the correct name for whatever key you're working with.

Hope this helps someone!

reddit.com
u/Herbo — 3 days ago