I did try some test commands earlier but they were not working, but now
its working all of a sudden so im clueless to why it wasnt working in
the first place. Thanks for the help.

On Thu, Jul 25, 2019 at 09:18:57PM -0000, Stuart Henderson wrote:
> On 2019-07-25, cheddar-cheeze <ched...@jiyu.moe> wrote:
> > I am working on setting up sensorsd so that i can automatically turn on
> > my display when docking my laptop, but on doing so sensorsd does not
> > execute my shell script. In syslogd sensord shows the sensors being
> > tripped so i am confused on why the shell script will no execute.
> >
> > #/etc/sensorsd.conf
> > hw.sensors.acpidock0.indicator0:command=/etc/sensorsd/dock %2
> >
> >
> > #/etc/sensorsd/dock
> > #!/bin/sh
> >
> > if [ $1 = "On" ]
> > then
> >         xrandr --output VGA-1 --auto --right-of LVDS-1
> > elif [ $1 = "Off" ]
> > then
> >         xrandr --output VGA-1 --off
> > fi
> >
> >
> 
> Are you sure that sensorsd doesn't run your script? Have it do something
> that always happens ('touch /tmp/somefile' or something) to be sure.
> 
> If it is running but isn't working as you expect, that's not a surprise
> because a script started by sensorsd won't normally have access to your X
> session. You can try something like
> 
> su username -c "env DISPLAY=:0 xrandr --output [...]"
> 
> 

Reply via email to