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

Support for systemd #29

Closed
blueyed opened this issue May 17, 2015 · 10 comments
Closed

Support for systemd #29

blueyed opened this issue May 17, 2015 · 10 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented May 17, 2015

systemd does not use pm-utils, so autorandr is not being run after resuming.

The following could be installed into /etc/systemd/system/autorandr-resume.service:

[Unit]
Description=autorandr resume hook
After=sleep.target

[Service]
ExecStart=/etc/pm/sleep.d/40autorandr thaw

[Install]
WantedBy=sleep.target

It would also be possible to use the user's systemd instance instead, but
that part seems to in flux currently, with regard to having $DISPLAY and $XAUTHORITY available in there (https://wiki.archlinux.org/index.php/Systemd/User#Environment_variables).

@blueyed
Copy link
Contributor Author

blueyed commented May 17, 2015

Would it be preferred to use the user's systemd instance (via the user's config), or is it meant to be installed system-wide?

(When installing it system-wide, it could also be put into /etc/systemd/user though (as a user service, for all users).

@blueyed
Copy link
Contributor Author

blueyed commented May 17, 2015

An alternative might be to install a script/symlink into /usr/lib/systemd/system-sleep (https://wiki.archlinux.org/index.php/Power_management#Hooks_in_.2Fusr.2Flib.2Fsystemd.2Fsystem-sleep), running autoranrd when the "post" argument is used.

@phillipberndt
Copy link
Owner

I use autorandr from my user home and frankly never put too much thought into this.. just go ahead and create a pull request with your start scripts, I'll merge it.

However I'd like to organize the additional scripts/files a bit better. How about moving

  • bash_completion -> contrib/bash_completion
  • pm-utils -> contrib/pm-utils
  • udev -> contrib/udev
  • your systemd stuff -> contrib/systemd

and adjusting the makefile to auto-detect the system type and adjust the hotplug-target accordingly?! (We could rename $INSTALL_PATH to $PREFIX while we're at it..)

@blueyed
Copy link
Contributor Author

blueyed commented May 17, 2015

👍

@blueyed
Copy link
Contributor Author

blueyed commented May 18, 2015

I use autorandr from my user home

Are you using udev rules then? AFAIK these cannot be configured in local/user config?
(but you can call a user's script of course)

@phillipberndt
Copy link
Owner

I have my own udev rule in place, that calls a script from my home, just not the one from the repo ☺

@kepi
Copy link
Contributor

kepi commented Jul 31, 2015

👍

phillipberndt added a commit that referenced this issue Nov 11, 2015
…e Makefile to autodetect the system

systemd service file contributed by github user @blueyed. see #29.
@phillipberndt
Copy link
Owner

I've included the service file from this bug now.

@Konfekt
Copy link

Konfekt commented Jul 3, 2016

Just curious why there is no

After=sleep.target suspend.target

? Does sleep.target include the suspend.target?

@blueyed
Copy link
Contributor Author

blueyed commented Jul 3, 2016

@Konfekt
IIRC that's the case, but I could not easily find it in the man pages now.

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

No branches or pull requests

4 participants