You are not logged in.

#1 2015-08-26 03:38:50

TidestManager1
Member
Registered: 2014-09-02
Posts: 8

[SOLVED] Custom systemd service file issues - Not really...

My goal is to press a few buttons on resume from sleep, to restart my window manager (Awesome WM) so that the screen is refreshed and no longer black (Dell latitude d600 needing maximum performance). I do know about the fix from the wiki page for the d600 but I don't want to reduce performance on this already old laptop.

I've almost gotten it working but my .service file errors out with a

● resume@mikey.service - User resume actions
   Loaded: loaded (/etc/systemd/system/resume@.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2015-08-25 21:20:08 MDT; 9min ago
  Process: 3714 ExecStart=/usr/bin/sleep 5; /usr/bin/xdotool key super+ctrl+r (code=exited, status=1/FAILURE)
 Main PID: 3714 (code=exited, status=1/FAILURE)

Aug 25 21:20:08 lyraLappy systemd[1]: Started User resume actions.
Aug 25 21:20:08 lyraLappy systemd[1]: resume@mikey.service: Main process exited, code=exited, status=1/FAILURE
Aug 25 21:20:08 lyraLappy systemd[1]: resume@mikey.service: Unit entered failed state.
Aug 25 21:20:08 lyraLappy systemd[1]: resume@mikey.service: Failed with result 'exit-code'.

and I'm not sure how to fix it.

Code for the resume@.service

[Unit]
Description=User resume actions
After=suspend.target

[Service]
User=%I
Type=simple
ExecStart=/usr/bin/sleep 5; /usr/bin/xdotool key super+ctrl+r

[Install]
WantedBy=suspend.target

Last edited by TidestManager1 (2015-08-26 05:57:15)

Offline

#2 2015-08-26 05:42:36

TidestManager1
Member
Registered: 2014-09-02
Posts: 8

Re: [SOLVED] Custom systemd service file issues - Not really...

Doing some research, I found this
And apparently I was doing it wrong.
So now I have a script in /usr/lib/systemd/system-sleep/ that kind of works...
Sorry for changing the topic a little bit, but how would I go about selecting the display for xdotool to use?

xdotool reports this
Can't open display (null)
Failed creating new xdo instance

EDIT: I figured it out!

su $USER -c "export DISPLAY=':0.0';/usr/bin/xdotool key super+ctrl+r"

Last edited by TidestManager1 (2015-08-26 05:56:30)

Offline

Board footer

Powered by FluxBB