bayasdev / envycontrol

Easy GPU switching for Nvidia Optimus laptops under Linux
MIT License
1.22k stars 62 forks source link

[Feature request] XDM support #61

Open porschemad911 opened 2 years ago

porschemad911 commented 2 years ago

I (and perhaps others) use XDM. It would be nice to have an xrandr script generated into say /etc/X11/Xsession.d/90envycontrol_nvidia-xrandr if the detected display manager is xdm.

porschemad911 commented 2 years ago

@geminis3 I have implemented changes locally. If you are ok with adding this feature, I can do a pull request. I'm no Github expert, but think I would need some access granted to push my working branch up:

$ git push --set-upstream origin 61-xdm-support
remote: Permission to geminis3/envycontrol.git denied to porschemad911.
fatal: unable to access 'https://github.com/geminis3/envycontrol.git/': The requested URL returned error: 403
bayasdev commented 2 years ago

@geminis3 I have implemented changes locally. If you are ok with adding this feature, I can do a pull request. I'm no Github expert, but think I would need some access granted to push my working branch up:

$ git push --set-upstream origin 61-xdm-support
remote: Permission to geminis3/envycontrol.git denied to porschemad911.
fatal: unable to access 'https://github.com/geminis3/envycontrol.git/': The requested URL returned error: 403

No, just fork this repo on your account and send a PR.

Thank you.

porschemad911 commented 2 years ago

Hmmm in _check_display_manager(), when running XDM on Debian Bullseye the regex doesn't behave properly. I was expecting it to give me xdm, but it actually gives me:

Display manager is: xdm" ]'

$ cat /etc/systemd/system/display-manager.service
[Unit]
Description=X-Window Display Manager
After=systemd-user-sessions.service

[Service]
# temporary safety check until all DMs are converted to correct
# display-manager.service symlink handling
ExecStartPre=/bin/sh -c '[ "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/bin/xdm" ]'
ExecStart=/usr/bin/xdm -nodaemon

Maybe it needs to specifically target the ExecStart line.

bayasdev commented 1 year ago

Will take a look into it