Giter Site home page Giter Site logo

Comments (5)

CorvetteCole avatar CorvetteCole commented on July 18, 2024 1

Just want to chime in and say I agree with @maximbaz , particularly with regards to describing graphical-session.target as a contract

from wluma.

maximbaz avatar maximbaz commented on July 18, 2024 1

If you think it's valuable I'd be happy to accept a PR adding a short note about this caveat in README, but since it's not really specific to wluma, but to all GUI apps that you want to start with systemd (e.g. waybar), perhaps it would be more beneficial to document it on a place like arch wiki for your desktop or window manager.

from wluma.

maximbaz avatar maximbaz commented on July 18, 2024 1

Closing as answered and non-actionable, but any further comments, questions or PRs for README improvements are always welcome 🙂

from wluma.

maximbaz avatar maximbaz commented on July 18, 2024

Hello!

Thanks for bringing this topic up!

First of all, you are totally right in saying that not all display or window managers start graphical-session.target. A typical reason for this that I've seen is that systemd is just one of many init systems, and it doesn't feel right to hardcode systemd-specific things into a display or window manager that does not depend on systemd specifically in any way. Heck, I couldn't even get sway to put a 6-line file in the contrib directory, that would help people start the graphical-session.target! Today I use Hyprland, and it is the same story. Believe me, I am very familiar with the problem 😁

Having said that, in my mind, not starting the graphical-session.target on a system that does use systemd is a violation of a contract, established when you agreed to use systemd. It's a way to manage dependencies, and for any GUI app (not just wluma) that wants to only start on a graphical system, depending on graphical-session.target is the right thing to do.

That is to say, when you and I use systemd, and a display/window manager that doesn't start graphical-session.target, it is our responsibility to do it. It's not actually that hard, you need to start the target when DM or WM launches (example) and stop it when it exits (example). This will help with all other GUI apps that you start with systemd (common example could be a bar like waybar), and would bring all the same benefits you saw when you changed to default.target (stop on crash, auto-restart, etc).

You will see in the links I provided, that we create <app>-session.target (sway-session.target / hyprland-session.target), that binds to graphical-session.target - this is optional but recommended, in case you ever have a systemd dependency that can only run in your particular WM and not just any display session.

Now, does wluma actually require a wlroots compositor to be up and running on launch? Yes, to take screen contents into consideration when picking the best brightness value to set. While this feature can be disabled in config, it is enabled by default, and I consider it a key differentiator of this particular app compared to anything else on the market, that can at most take ALS into account. And when you have the feature enabled, wluma will actually crash on startup, as it fails to find a display session, so it will crash in the default config, and it will crash for the majority of people.

I don't disagree with the benefits of using wluma on a TTY, or on a non-wlroots display manager for that matter - it was the whole reason to make the feature toggleable! It's just that the config is static today, and you can't switch to TTY mode without also adjusting the default config (and so the default systemd service unit).

So, would the default wluma.service benefit from switching to base.target? Not at the moment. If we can make the setting dynamic, such that wluma can start on TTY and use only ALS, later detect that wlroots-based display manager was started and begin to take screen contents into account, and similarly switch back and continue working when display session was closed, then it would totally make sense to define only the minimally necessary dependency in the systemd unit! Until then, I believe the default unit should continue to match the default config.

It was a wonderful question, thanks again for asking, I hope I managed to give you at least somewhat of an answer than it deserves! Don't hesitate to ask if you have further comments 😉

from wluma.

hvitoi avatar hvitoi commented on July 18, 2024

That makes total sense, thanks for your detailed response. And thanks for the reference to the dotfiles.

Unfortunately for wlroots compositors and display managers it's not very clear that this target must be handled by the user itself (creation and startup).

I even tested it with sddm thinking that it would automagically start up this target but also not. So this "issue" might something common for wluma users.

from wluma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.