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

Add uwsm instructions #850

Merged
merged 52 commits into from
Nov 11, 2024
Merged

Add uwsm instructions #850

merged 52 commits into from
Nov 11, 2024

Conversation

izmyname
Copy link
Contributor

@izmyname izmyname commented Nov 7, 2024

hyprwm/Hyprland#8376 and hyprwm/Hyprland#8339 discussion

Probably, need to add another page to mention uwsm with short instructions. Startup or something

Corrections, reviews and suggestions are welcome.

@izmyname
Copy link
Contributor Author

izmyname commented Nov 7, 2024

Also, @Vladimir-csp tagging you to review in case I forgot to mention something.

Copy link
Member

@fufexan fufexan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even know why these two are here. They're automatically set by Hyprland. As for XDG_SESSION_DESKTOP, what uses it?

- `env = XDG_CURRENT_DESKTOP,Hyprland`
- `env = XDG_SESSION_TYPE,wayland`

@Vladimir-csp
Copy link
Contributor

I think this section needs to be integrated in some shape or form. The "full experience" is to place compositor unit in session.slice and run apps as units via uwsm app or analogs, this way uuctl and fumon tools also become more useful.

@Vladimir-csp
Copy link
Contributor

Vladimir-csp commented Nov 7, 2024

I don't even know why these two are here. They're automatically set by Hyprland.

IIRC Hyprland passes them through if not mentioned in config, but already present in the environment (typical for DM/SM setup). ...yep

As for XDG_SESSION_DESKTOP, what uses it?

Systemd uses it, described in man pam_systemd.

@izmyname
Copy link
Contributor Author

izmyname commented Nov 7, 2024

I think this section needs to be integrated in some shape or form. The "full experience" is to place compositor unit in session.slice and run apps as units via uwsm app or analogs, this way uuctl and fumon tools also become more useful.

Makes sense to put it on a specific page I mentioned in the initial comment. Although, honestly, I didn't try uwsm app and not 100% sure how it works.

@izmyname
Copy link
Contributor Author

izmyname commented Nov 7, 2024

Oops, I messed up this one.

@Vladimir-csp
Copy link
Contributor

Systemd-managed session implies running apps in units. If something is spawned directly by Hyprland, it will be a part of compositor's unit which is not ideal (to say the least). Also it is recommended to put compositor into session.slice (for its resources and priorities), which most apps should not be in. See man systemd.special.
Compositor can be placed into session.slice by adding -S to uwsm start or having UWSM_USE_SESSION_SLICE=true in user's environment (profile or environment.d).

Apps (also things that do not have a systemd unit, run continuously, and are not related to the compositor) need to be wrapped in units by executing them via uwsm app or uwsm-app or app2unit, or directly via systemd-run --user .... Examples:

# run some continuous session-related script
exec-once = exec uwsm app -a some-ipc-script ~/bin/my-ipc-script.sh
# fuzzel launcher
bind = SUPER, R, exec, exec fuzzel --launch-prefix='uwsm app --`
# run qterminal
bind = SUPER, T, exec, exec uwsm app qterminal.desktop
# run pcmanfm
bind = SUPER, E, exec, exec uwsm app pcmanfm-qt.desktop

Unit type is scope by default, because it behaves like simple commands. But it can be switched to service to gain more flexibility and journald logging. -t service argument for uwsm app or UWSM_APP_UNIT_TYPE=service in environment to set default.

uwsm app also puts units into custom *-graphical.slices that receive deactivation action during shutdown.

@izmyname
Copy link
Contributor Author

izmyname commented Nov 7, 2024

IMHO, needs to be shortened and simplified, so we could add a quick instruction ( see https://wiki.hyprland.org/Useful-Utilities/). Long version is better to be put somewhere in readme on uwsm side, so we could provide a link to it.

Speaking of adding another page for uwsm @fufexan should it be done by me, in this pr, or somehow else? Alternately, though, we could put uwsm in "Other" or "Must have" section

@fufexan
Copy link
Member

fufexan commented Nov 7, 2024

You can create a new page under Useful Utilities in this PR.

@izmyname
Copy link
Contributor Author

izmyname commented Nov 7, 2024

Oh wait, I just noticed Hyprland wiki already mentions uwsm. https://wiki.hyprland.org/Useful-Utilities/Other/

Should I keep the new page or leave just that mention?

@fufexan
Copy link
Member

fufexan commented Nov 7, 2024

Keep the new page, and remove the mention from Other.

@izmyname
Copy link
Contributor Author

izmyname commented Nov 7, 2024

Okay, done. I'll revisit the page later to add installation instructions and links to other wiki pages, if needed.

@izmyname
Copy link
Contributor Author

izmyname commented Nov 8, 2024

use uwsm app -- wl-paste --watch cliphist store

Uh, I'm an idiot. My bad.

Why not have them on separate lines?

Force of habit

UPD: chaining multiple commands within one exec-once works, btw

@Vladimir-csp
Copy link
Contributor

Also, should we use uwsm app with flatpak apps, taking into account xdph doesn't implement org.freedesktop.Background?

No ATM, since flatpak handles units its own way.

And can we use one exec-once entry to launch several programs with uwsm app, like exec-once = uwsm app foo & uwsm app bar&?

It's shell, so why not.

@izmyname
Copy link
Contributor Author

izmyname commented Nov 9, 2024

No ATM, since flatpak handles units its own way.

Plus, things like telegram and easy effects are meant to be autostarted with xdg-autostart, using desktop entries, but xdph doesn't allow that, for now.

Also, another problem I should probably report to uwsm github (will do it tomorrow) - Hyprland no longer exits via loginctl command, immediately. All systemd services are stopped, but Hyprland, itself (and flatpak apps) stays active with its default wallpaper placeholder, for like a minute or two, before logging me out. I'll try to reproduce it tomorrow, though.

As for the PR, itself - I'll add an example exec-once command in the wiki and, if everything else is ok, it's ready for merging.

Copy link
Contributor

@Vladimir-csp Vladimir-csp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nothing that can't be fixed later.

@Vladimir-csp
Copy link
Contributor

Plus, things like telegram and easy effects are meant to be autostarted with xdg-autostart, using desktop entries, but xdph doesn't allow that, for now.

Why?

@izmyname
Copy link
Contributor Author

izmyname commented Nov 9, 2024

Plus, things like telegram and easy effects are meant to be autostarted with xdg-autostart, using desktop entries, but xdph doesn't allow that, for now.

Why?

Because of lacking org.freedesktop.Background implemetation. The settings within flatpaks simply won't allow creating a desktop entry.

@Vladimir-csp
Copy link
Contributor

Ah, you mean flatpak itself can not put entries into ~/.config/autostart due to portal issues?

@izmyname
Copy link
Contributor Author

izmyname commented Nov 9, 2024

Exactly. Additionally, in case of Easy Effects - if I try to access its settings and get a warning about lacking access to Background implementation - it won't stay as a background process, after I open it, then close, so I have to reset its settings in order to be able both daemonize and access it.

@izmyname
Copy link
Contributor Author

izmyname commented Nov 9, 2024

@fufexan tagging for the final (probably) review

@izmyname izmyname requested a review from fufexan November 10, 2024 12:37
Copy link
Member

@fufexan fufexan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting looks ok to me. Content-wise it's also good. Will defer to @Vladimir-csp for any content inconsistencies.

Hyprland builds fine without it. Also, Arch maintainers removed it from Hyprland PKGBUILD in extra repo.
@izmyname
Copy link
Contributor Author

I removed gdb make dependency for Arch from installation page. Hyprland builds just fine without it, and Arch dropped it for their PKGBUILD in extra repo.

@fufexan fufexan merged commit 1741c32 into hyprwm:main Nov 11, 2024
@izmyname
Copy link
Contributor Author

izmyname commented Nov 12, 2024

Exactly. Additionally, in case of Easy Effects - if I try to access its settings and get a warning about lacking access to Background implementation - it won't stay as a background process, after I open it, then close, so I have to reset its settings in order to be able both daemonize and access it.

Hm. I've just realized I'm exploiting a vulnerability to bypass portal background permission and daemonize Easy Effects. Curious.

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