fieldofclay / hyprland-workspaces Goto Github PK
View Code? Open in Web Editor NEWA multi-monitor aware Hyprland workspace widget
License: MIT License
A multi-monitor aware Hyprland workspace widget
License: MIT License
The README states this is multi-monitor aware, but I'm not seeing how to use it with multiple monitors. Can you provide an example? I did the following in my eww.yuck
to add my second monitor, but as you can likely tell from how I did it, the workspace numbers don't always stay in order if they're not in the same order as the monitors.
(deflisten monitor0 "hyprland-workspaces eDP-1")
(deflisten monitor1 "hyprland-workspaces DP-3")
(defwidget workspaces []
(eventbox :onscroll "hyprctl dispatch workspace `echo {} | sed 's/up/+/\' | sed 's/down/-/'`1"
(box :class "works"
:orientation "v"
:spacing 5
(for i in monitor0
(button
:onclick "hyprctl dispatch workspace ${i.id}"
:class "${i.class}"
"${replace(i.name, ':', '')}"
)
)
(for i in monitor1
(button
:onclick "hyprctl dispatch workspace ${i.id}"
:class "${i.class}"
"${replace(i.name, ':', '')}"
)
)
)
)
)
I thought about maybe having a separate script that is called by deflisten
that starts hyprland-workspaces
for all my monitors and then combines and sorts the output before sending it to eww, but I wanted to see if there's already a better solution first.
I also don't mind contributing a PR to this project that supports multiple monitors being provided when started. Again, just wanted to make sure I'm not overlooking something obvious.
Hi,
Using hyprland-workspaces and trying to get workspace information but the command exits with error due to a serialization issue in hyprland-rs.
Sample command:
hyprland-workspaces DP-1
[{"active":false,"class":"workspace-button w1","id":1,"name":"1"}]
thread 'main' panicked at 'Error parsing data whith serde: expected value at line 1 column 1', /home/patrik/.cargo/registry/src/github.com-1ecc6299db9ec823/hyprland-0.3.3/src/event_listener/mutable.rs:53:31
I discussed with the hyprland-rs team but they say it works as intended.
The data that is passed back is correct but the command terminates so the eww deflisten
will not pickup updates to the workspace layout.
Tested to rollback to hyprland-rs=0.3.2 and then it works again.
Hey,
it seems that the crate version in crates.io is outdated. This should easily be resolved by running cargo publish
. Otherwise running cargo install hyprland-workspaces
will lead to an outdated version being installed locally.
Kind regards,
ju6ge
hyprland-workspaces `hyprctl monitors | grep "ID $1" | awk '{print $2}'` | jq -a -c -M 'del(.[0] | select(.name == "special"))'
[{"active":true,"class":"workspace-button w1 workspace-active wa1","id":1,"name":"1"}]
A unknown event was passed into Hyprland-rs
PLEASE MAKE AN ISSUE!!
The event was: activespecial
[{"active":true,"class":"workspace-button w1 workspace-active wa1","id":1,"name":"1"}]
^C
put this or something to its effect in your hyprland config
bind = $mainMod SHIFT, f, movetoworkspace,special
bind = $mainMod, f, togglespecialworkspace
then toggle the special workspace while running hyprland-workspaces in a terminal and watch the logs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.