Askannz / optimus-manager

A Linux program to handle GPU switching on Optimus laptops.
MIT License
2.29k stars 169 forks source link

Would you support OpenRC ? #107

Closed galaxy001 closed 7 months ago

galaxy001 commented 5 years ago

I find this tool use org.freedesktop.systemd1, which makes it not working under Artix Linux.

Would you consider support OpenRC ?

Askannz commented 5 years ago

optimus-manager relies on Systemd because it needs an init system to hook itself into. It would probably be possible to adapt it for OpenRC (assuming it provides the features I need) but I have zero experience using it.

So it's on the TODO list I guess, but to be honest I'll probably focus on making optimus-manager compatible with more popular distros first (like Fedora).

anlorn commented 4 years ago

@Askannz Playing around with "optimus-manager" in "Gentoo" I find out that I can run it quite easily with OpenRC. I just need return True from "_is_service_active_dbus" here - https://github.com/Askannz/optimus-manager/blob/master/optimus_manager/checks.py

Returning "True" of course isn't an actual solution, it's more a hack to see if changing only this place is enough. But everything seems working. I can create a proper patch with check if the daemon is active.

Do you see any other places in code that could break due to the absence of systemd?

p.s. I also had to create openRC starting script similar to "optimus-manager.service" but it didn't require me to change any code of "optimus-manager" itself.

ghost commented 4 years ago

@anlorn Did you get it working without major issues? I will like to use it for openRC, can you upload the changes you did?

anlorn commented 4 years ago

@Diago87 I was using it for a while, didn't encounter any issues.

Mostly I was using version 1.2.2, but a ~week ago I switched to using HEAD of the repository.

I just prepared and created a PR to add openRC support - https://github.com/Askannz/optimus-manager/pull/282

p.s. Please be aware, that if you are using gentoo, for now you should take ebuilds from my local fork(you can find details in the PR description).

snekiepete commented 4 years ago

In Gentoo, when I am running rc-service optimus-manager start I am getting this error:

tart-stop-daemon: user `/usr/bin/optimus-manager-daemon' not found

please help/

xmine64 commented 3 years ago

For running optimus-manager on Artix, use this package from AUR: https://aur.archlinux.org/packages/optimus-manager-openrc-git/

karimrir1 commented 3 years ago

For running optimus-manager on Artix, use this package from AUR: https://aur.archlinux.org/packages/optimus-manager-openrc-git/

There is already ones in the official artix universe repository.

xmine64 commented 3 years ago

There is already ones in the official artix universe repository.

Yes, I just checked it and it's based on my PKGBUILD.

https://gitea.artixlinux.org/linuxer/Artix-Optimus/src/branch/master/optimus-manager-git/PKGBUILD

linuxergr commented 3 years ago

I have patched it for Artix and the link of the latest PKGBUILD is at https://gitea.artixlinux.org/Universe/optimus-manager-git, cause I moved it to our Universe repo.

Also, all relative services for OpenRC, Runit and s6, are there as separated packages (the Artix way)

xmine64 commented 3 years ago

I have patched it for Artix and the link of the latest PKGBUILD is at https://gitea.artixlinux.org/Universe/optimus-manager-git, cause I moved it to our Universe repo.

Also, all relative services for OpenRC, Runit and s6, are there as separated packages (the Artix way)

Yes I saw your work. You added support for different service managers and display managers. Your work contains part of mine and I'm excited to see that. I'm not an Artix user anymore but I wrote PKGBUILD for optimus-manager-openrc-git when I had Artix and used it myself. I tried to write service files for runit and s6 just for experiment, but I couldn't do it well. only OpenRC works properly.

linuxergr commented 3 years ago

Yes I saw your work. You added support for different service managers and display managers. Your work contains part of mine and I'm excited to see that. I'm not an Artix user anymore but I wrote PKGBUILD for optimus-manager-openrc-git when I had Artix and used it myself. I tried to write service files for runit and s6 just for experiment, but I couldn't do it well. only OpenRC works properly.

Yup, it was an expected behavior by your package, to work properly with OpenRC, but not possible to work for the rest of the inits. All DMs have to start in their own way for optimus to work, cause are providing the dependencies for the optimus service/init which in their turn starts the daemon, so a total population of 19 packages (including Artix packages specs for inits) and services was created by my side for that, not a real easy stuff.

xmine64 commented 3 years ago

Yup, it was an expected behavior by your package, to work properly with OpenRC, but not possible to work for the rest of the inits. All DMs have to start in their own way for optimus to work, cause are providing the dependencies for the optimus service/init which in their turn starts the daemon, so a total population of 19 packages (including Artix packages specs for inits) and services was created by my side for that, not a real easy stuff.

Yeah there's a need for that. Good luck btw.

es20490446e commented 7 months ago

Check this fix: https://github.com/Askannz/optimus-manager/pull/427

If not working, reopen.