Skip to content

Enables Hyprland to move whole workspaces to another monitor - #47

Closed
jonashan wants to merge 1 commit into
omacom:devfrom
jonashan:move-workspace-to-monitor
Closed

jonashan wants to merge 1 commit into
omacom:devfrom
jonashan:move-workspace-to-monitor

Conversation

@jonashan

@jonashan jonashan commented Jul 3, 2025 •

Copy link
Copy Markdown

This PR introduces the ability to move the current workspace to a different monitor, either by specifying the monitor directly or by cycling through monitors using the arrow keys.

While single-monitor setups are increasingly popular, some users (myself included 😉) still rely on multi-monitor workflows. This feature makes it easier to organize and shift workspaces between monitors efficiently.

Implementation Details

This feature builds on the existing Hyprland command hyprctl dispatch moveworkspacetomonitor. To support it, I added a few lightweight Bash scripts to:

  • Identify connected monitor IDs
  • Retrieve the current active workspace number

These scripts provide the necessary context for workspace movement logic.

Tested on a dual-monitor setup.

Keybindings

  • Move to monitor 1–9: SHIFT + SUPER + ALT + [1–9]
  • Move workspace to the monitor left of the current: SHIFT + SUPER + ALT + Left Arrow
  • Move workspace to the monitor right of the current: SHIFT + SUPER + ALT + Right Arrow

How to Test

After installing Arch Linux, run the following command:
wget -qO- https://raw.githubusercontent.com/jonashan/omarchy/refs/heads/move-workspace-to-monitor-test/boot.sh | bash

@dhh
dhh changed the base branch from master to dev July 5, 2025 00:07
@jonashan

jonashan commented Jul 11, 2025 •

Copy link
Copy Markdown
Author

I'll fix merge conflict later today.

@jonashan
jonashan force-pushed the move-workspace-to-monitor branch 2 times, most recently from 6dacb04 to c0a5857 Compare July 11, 2025 17:51
@jonashan
jonashan force-pushed the move-workspace-to-monitor branch from c0a5857 to e653b58 Compare July 11, 2025 18:03
@jonashan jonashan closed this Jul 11, 2025
@jonashan jonashan reopened this Jul 11, 2025
@jonashan

Copy link
Copy Markdown
Author

Merge conflicts fixed.

@dhh

dhh commented Jul 13, 2025

Copy link
Copy Markdown
Contributor

I think this is really clever, but it's also quite a lot of code. I'd love to see this as an Omarchy plugin instead. Trying to think how we could best do that. Maybe we add something like ~/.config/omarchy/plugins/workspace-mover, which can have a bin/ and a config/hypr/*.conf folders. Then we have Omarchy automatically add those directories to path + include the confs. And then we could have something like omarchy-plugin-install [url] to do the initial install, and then have an index in the manual for them.

This is sorta similar to what @npenza has been working on for custom themes. This is a great use case to try it out. Kinda like Rails engines!

@jonashan

Copy link
Copy Markdown
Author

Makes sense! I can work on an omarchy plugin installer next week when I'm home from vacation with the kids 😊. If I understand you right @dhh, the changes in this PR should be placed in a separate repo for the plugin itself, right?

@dhh

dhh commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

Correct, yes. I think the setup we have with the new theme installer is a good pattern to follow 👌

@dhh

dhh commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

Will close this for now then in anticipation.

@dhh dhh closed this Jul 16, 2025
@jonashan jonashan mentioned this pull request Jul 19, 2025
@douglascamata

douglascamata commented Jul 20, 2025 •

Copy link
Copy Markdown

@jonashan couldn't this be done in a much more simple way just using maybe a submap and movecurrentworkspacetomonitor with the directional parameter? For instance, I have this config:

# Move workspaces to different monitors
bind = SUPER SHIFT, M, submap, workspacetomonitor
submap = workspacetomonitor
bind = , H, movecurrentworkspacetomonitor, l
bind = , H, submap, reset
bind = , L, movecurrentworkspacetomonitor, r
bind = , L, submap, reset
bind = , escape, submap, reset
bind = , catchall, submap, reset
submap = reset

It could easily be adapted to make the submap specific binds repeatable, plus binds for J and K can be added for the up and down directions.

In my case, I use two monitors so all I need is left/right move and they are non-repeatable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants