Hi Job,

Job Snijders wrote on Mon, Nov 27, 2017 at 03:12:10PM +0000:

> I'm tweaking how my laptop behaves depending on whether it is pluggde
> into AC or not. Any hints or alternative suggestions are welcome.
> 
> This is my config:
> 
> /etc/sensorsd.conf:
> 
>     acpiac0.indicator0:command=/etc/sensorsd/ac_power %2

I am using:

  hw.sensors.acpiac0.indicator0:low=1:command=/etc/sensorsd/acpiac %2 %3 %4

The "%3 %4" is just useful for debugging, you don't need it.
But are you sure you can omit "hw.sensors."?
The sensorsd.conf(5) manual only says:

  Sensors may be specified by their full hw.sensors sysctl(8)
  variable name or by type, with the full name taking precedence.

The string "acpiac0.indicator0" seems to be neither.

> and this is the script:
> 
>     #!/bin/sh
> 
>     echo $1 >> /root/test

Using logger(1) might feel more professional ;-).

For example, i'm using:

  logger -p daemon.info -t acpiac status=$1 low=$2 high=$3

Yours,
  Ingo

>     case $1 in
>         On)
>             /sbin/sysctl -w machdep.lidaction=0
>             ;;
>         Off)
>             /sbin/sysctl -w machdep.lidaction=1
>             ;;
>         *)
>             echo "unknown state $1"
>             exit 1
>             ;;
>     esac
> 
> I'd expect the lidaction to change when I plug my X270 into AC, or
> unplug it, but nothing seems to happen. Running 'sensorsd -d -c 1'
> didn't output anything. /root/test stays empty.

Reply via email to