optimus-manager icon indicating copy to clipboard operation
optimus-manager copied to clipboard

Make it easy to install and package on multiple distros

Open ofenerci opened this issue 5 years ago • 9 comments

I wonder It is possible to make "optimus-manager" to be available for Debian.

ofenerci avatar Oct 04 '19 17:10 ofenerci

@Askannz anything about this? I believe this can be very interesting.

Mario156090 avatar Oct 05 '19 00:10 Mario156090

Yes it would possible, since there is no fundamental difference between Debian and Archlinux that would prevent it from working.

However it would be an extra platform to support on my end, and I'll also have to find a way to ship an equivalent to the gdm-prime package for Debian. Not to mention making sure that there is no conflict in version requirements (Debian tends to use older packages). There was already an issue the other day about optimus-manager being broken on Gentoo due to an outdated Python interpreter.

TLDR: possible: yes, one the TODO list: yes, but I can't make any promise due to the additional work required.

Askannz avatar Oct 20 '19 00:10 Askannz

Yeah having this on Debian would be very nice, as we don't have even prime-select that Ubuntu has: https://bugs.debian.org/875959 .

Talkless avatar Nov 06 '19 18:11 Talkless

Please have support for debian.

eminfedar avatar Dec 01 '19 21:12 eminfedar

I successfully install this on Deepin OS which is Debian, just setup from source code and move the conf files from builld floder to the system. I use like below:

python3 setup.py build
python3 setup.py install
#!/usr/bin/bash
mkdir -p $pkgdir/etc/sddm.conf.d/
mkdir -p $pkgdir/usr/lib/systemd/logind.conf.d/
mkdir -p $pkgdir/etc/lightdm/lightdm.conf.d/
mkdir -p $pkgdir/etc/optimus-manager/
cp modules/optimus-manager.conf "$pkgdir/usr/lib/modprobe.d/optimus-manager.conf"
cp systemd/optimus-manager.service "$pkgdir/usr/lib/systemd/system/optimus-manager.service"
cp optimus-manager.conf "$pkgdir/usr/share/optimus-manager.conf"
cp systemd/logind/10-optimus-manager.conf "$pkgdir/usr/lib/systemd/logind.conf.d/10-optimus-manager.conf"
cp var/startup_mode "$pkgdir/var/lib/optimus-manager/startup_mode"
cp var/requested_mode "$pkgdir/var/lib/optimus-manager/requested_mode"
cp scripts/prime-switch-boot "$pkgdir/usr/bin/prime-switch-boot"
cp scripts/prime-switch "$pkgdir/usr/bin/prime-switch"
cp scripts/prime-offload "$pkgdir/usr/bin/prime-offload"
cp login_managers/sddm/20-optimus-manager.conf "$pkgdir/etc/sddm.conf.d/20-optimus-manager.conf"
cp login_managers/lightdm/20-optimus-manager.conf  "$pkgdir/etc/lightdm/lightdm.conf.d/20-optimus-manager.conf"
cp config/xorg-intel.conf "$pkgdir/etc/optimus-manager/xorg-intel.conf"
cp config/xorg-nvidia.conf "$pkgdir/etc/optimus-manager/xorg-nvidia.conf"
cp config/xsetup-intel.sh "$pkgdir/etc/optimus-manager/xsetup-intel.sh"
cp config/xsetup-nvidia.sh "$pkgdir/etc/optimus-manager/xsetup-nvidia.sh"
cp config/nvidia-enable.sh "$pkgdir/etc/optimus-manager/nvidia-enable.sh"
cp config/nvidia-disable.sh "$pkgdir/etc/optimus-manager/nvidia-disable.sh"

image

At last, I install the optimus-manager-qt from src. image

But it maynot turn down the nvidia at all, I feel that my battery lost too fast.

toddwyl avatar Mar 08 '20 03:03 toddwyl

Any solution not turning down nvidia?

ofenerci avatar Apr 13 '20 18:04 ofenerci

https://github.com/Askannz/optimus-manager may explain why: "Note : Do not install this program by cloning this repository and running setup.py, or by using pip directly. Doing so will only install the Python package but leave out important files that optimus-manager needs"

alex-noname avatar Aug 28 '21 19:08 alex-noname

I'm trying to build optimus-manager for a different distro, detailed build instructions would be nice or at least an explanation what is required how to make the software work.

miklosakos avatar Feb 11 '22 20:02 miklosakos

Maybe something for the future but, would setup.py be improved if it got split into a the script and a setup.cfg file like how it is documented into setuptools? - https://setuptools.pypa.io/en/latest/userguide/declarative_config.html

I've had this idea because Debian-likes can benefit from stdeb - https://pypi.org/project/stdeb/, which is able to read the install_requires=['mesa-utils-bin', 'x11-xserver-utils', 'python3', 'python3-dbus'] from a setup.py or the equivalent configuration on lets say setup_debian.cfg and directly build debian packages from a python setuptools script

This could be the starting point for creating an infrastructure to build debian packages, having a setup.py and one config file per distro family maybe?

Or, someone could make a debian package specification that will just manually copy files like it was done by @toddwyl , and add the following packages on the "required" specification: mesa-utils-bin, x11-xserver-utils, python3, python3-dbus

nwildner avatar Jul 26 '24 10:07 nwildner