You are not logged in.

#1 2013-07-05 13:43:31

Bruce Connor
Member
Registered: 2012-04-23
Posts: 4

[SOLVED] Run hook on external monitor connect/disconnect

I want to run a script whenever I connect or disconnect an external monitor from my laptop.
Is there a hook I can create somewhere to achieve this?

Last edited by Bruce Connor (2013-07-16 16:03:03)

Offline

#2 2013-07-05 14:15:27

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: [SOLVED] Run hook on external monitor connect/disconnect

Take a look at srandrd, it does EXACTLY what you want smile Just put

srandrd /path/to/script

in your .xinitrc and you're good to go

Offline

#3 2013-07-05 22:14:18

Bruce Connor
Member
Registered: 2012-04-23
Posts: 4

Re: [SOLVED] Run hook on external monitor connect/disconnect

Unfortunately that doesn't seem to be working for me. =/

I've inserted

echo "Action was $SRANDRD_ACTION" >> $HOME/srandrd.out

into the script to attempt some debugging but I get no output. My guess is that the script isn't being run at all.

Last edited by Bruce Connor (2013-07-05 22:14:49)

Offline

#4 2013-07-16 16:01:56

Bruce Connor
Member
Registered: 2012-04-23
Posts: 4

Re: [SOLVED] Run hook on external monitor connect/disconnect

And of course, I just decided to try it again and now it works.
smile

Thanks for the tip.

Offline

Board footer

Powered by FluxBB