Skip to content

feat: add hyprland support and leave space for other compositors#1

Open
Matra-Master wants to merge 1 commit intocodeafridi:mainfrom
Matra-Master:wayland_support
Open

feat: add hyprland support and leave space for other compositors#1
Matra-Master wants to merge 1 commit intocodeafridi:mainfrom
Matra-Master:wayland_support

Conversation

@Matra-Master
Copy link
Copy Markdown

The change to start_overlay.sh is about not asking for xdotool in a wayland environment.

Then for function get_active_pid() used XDG variables to get the session type and desktop. First if session is wayland and then if desktop is hyprland.
I made a match-case so others can include their own desktops. I have only hyprland and don't want to make cases that I'm not able to test myself.

Please check if your X11 session keeps working as expected. I supposed it still works for you.

--
I started this change with AI to get the idea and then ended up changing things manually to optimize the hyprland command and to put a match-case for others.

The main thing is not using xdotool in a wayland environment. That's
what the script change does.

Then for function `get_active_pid()` used XDG variables to get the
session type and desktop. First if session is wayland and then if
desktop is hyprland.
I made a match-case so others can include their own desktops. I have
only hyprland and don't want to make cases that I'm not able to test
myself.
@codeafridi
Copy link
Copy Markdown
Owner

This is a good addition but before merging one important change is that the current implementation uses grep -P with shell=True which is fragile and depends on external tools. It would be better to use:

hyprctl activewindow -j

and parse the JSON output in Python instead.

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.

2 participants