Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyprland monitor property should be mapped <Number, Monitor> #41

Closed
Frontear opened this issue Aug 14, 2023 · 2 comments
Closed

Hyprland monitor property should be mapped <Number, Monitor> #41

Frontear opened this issue Aug 14, 2023 · 2 comments

Comments

@Frontear
Copy link

Frontear commented Aug 14, 2023

Why? Window takes a monitor property and uses a number to determine which monitor id should be used. It breaks the logical following for Hyprland.monitors to not be mapped via numbers, because it makes it harder to try and perform any kinds of connections or setup based on a specific monitor.

Example: I want to position my bar 1% from the top and left-right. Because I can't do this via GTK css nor (from what I can find) with ags as is, I need to use Hyprland.monitors["MONITOR"].width/.height to access the properties needed for calculation, then dynamically rewrite the Window.margin property. However, because I can only access the monitors with a "name", I now need to manually loop through to find id == 0, then get its width/height props. It's just strange, please make one or the other, preferrably numbers because thats more portable across systems (laptops have eDP-1, pcs have HDMI-A-1, and who knows what else, but numbers are consistent).

EDIT:

Scratch that I can't even access window.margin from a setup call haha, are there ways to accomplish what im trying to do here?

Aylur added a commit that referenced this issue Aug 14, 2023
@Aylur
Copy link
Owner

Aylur commented Aug 14, 2023

It started out like that because the events emitted by Hyprland are by name, not id, but I agree that it makes more sense.

If you want to set margin from setup you have to use gtk-layer-shell directly for now, because just like ags.Widget, ags.Window is just a parser, have a look at the source for reference.
I am working on a new version where everything is subclassed so you will be able to use window.margin after construction too.

@Frontear
Copy link
Author

Did spot the source, will do, since the setup object is a Gtk.Window i should be able to directly use it in any Gtk functions. Thanks for the swift changes!

@Aylur Aylur closed this as completed Aug 24, 2023
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

No branches or pull requests

2 participants