#hyprland #unix-socket #workspace #monitor #sockets #setup #multi-monitor

app hyprsome

A small CLI apps that allows to make Hyprland's workspaces work like Awesome in multi-monitor setup

10 releases

0.1.12 May 12, 2024
0.1.11 Apr 9, 2023
0.1.10 Mar 9, 2023
0.1.7 Feb 10, 2023
0.1.6 Oct 17, 2022

#132 in Unix APIs

Download history 14/week @ 2024-08-12 21/week @ 2024-08-19 20/week @ 2024-08-26 20/week @ 2024-09-02 7/week @ 2024-09-09 19/week @ 2024-09-16 69/week @ 2024-09-23 28/week @ 2024-09-30 40/week @ 2024-10-07 26/week @ 2024-10-14 16/week @ 2024-10-21 21/week @ 2024-10-28 30/week @ 2024-11-04 21/week @ 2024-11-11 30/week @ 2024-11-18 24/week @ 2024-11-25

106 downloads per month

GPL-3.0 license

19KB
456 lines

Hyprsome

Hyprsome is a binary that interacts with Hyprland's Unix socket to make workspaces behave similarly to AwesomeWM in a multi-monitor setup.

If you're focused on a monitor and press SUPER+[1-9], you'll only switch to the workspaces that are bound to that monitor.

It is inspired by Swaysome, which does a similar thing for Sway.

Installation

cargo install hyprsome

Usage

Once the binary is installed, you can modify your ~/.config/hypr/hyprland.conf to accomodate it. Here is an example of a dual monitor setup:

monitor=DP-1,1920x1080@60,0x0,1.33
monitor=DP-1,transform,1
workspace=DP-1,1
monitor=HDMI-A-1,3440x1440@100,813x0,1
workspace=HDMI-A-1,11

Most noteworthy thing here is the 'workspace' keyword that I use to bind a default workspace for each monitor.

Then you can bind workspaces to your different monitors.

It is very important that you bind your workspaces in order.

Check the results of hyprctl monitors. Bind workspaces from 1 to 9 on your monitor that has 0 as an id.

Then just bind workspaces by prefixing numbers by the id of the monitor they're bound to.

Here, HDMI-A-1's id is 1, so I bind workspaces from 11 to 19 to it.

  workspace=1,monitor:DP-1
  workspace=2,monitor:DP-1
  workspace=3,monitor:DP-1
  workspace=4,monitor:DP-1
  workspace=5,monitor:DP-1

  workspace=11,monitor:HDMI-A-1
  workspace=12,monitor:HDMI-A-1
  workspace=13,monitor:HDMI-A-1
  workspace=14,monitor:HDMI-A-1
  workspace=15,monitor:HDMI-A-1

Then it's just a matter of making sure your regular workspace keybinds call hyprsome.

bind=SUPER,1,exec,hyprsome workspace 1
bind=SUPER,2,exec,hyprsome workspace 2
bind=SUPER,3,exec,hyprsome workspace 3
bind=SUPER,4,exec,hyprsome workspace 4
bind=SUPER,5,exec,hyprsome workspace 5

bind=SUPERSHIFT,1,exec,hyprsome move 1
bind=SUPERSHIFT,2,exec,hyprsome move 2
bind=SUPERSHIFT,3,exec,hyprsome move 3
bind=SUPERSHIFT,4,exec,hyprsome move 4
bind=SUPERSHIFT,5,exec,hyprsome move 5

Limitations

This is alpha software and my first program in Rust, bugs are bound to happen but nothing that will break your system.

Some features are most likely missing.

You can only have 9 workspaces per monitor as of now.

I haven't worked on supporting monitor hot-plug at all. It may work but it's unlikely.

Dependencies

~11–22MB
~346K SLoC