Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-28 Thread Ted Unangst
Jesper Wallin wrote: > On Tue, Aug 15, 2017 at 07:24:47PM -0400, Ted Unangst wrote: > > this looks good. will commit soon. > > > > (one nit, i'll correct, is man page options are upper case first.) > > Sorry if this comes on as a bit pushy, but any news here? I don't know > how 6.2-beta affects

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-28 Thread Jesper Wallin
On Tue, Aug 15, 2017 at 07:24:47PM -0400, Ted Unangst wrote: > this looks good. will commit soon. > > (one nit, i'll correct, is man page options are upper case first.) Sorry if this comes on as a bit pushy, but any news here? I don't know how 6.2-beta affects this, but maybe it would be nice to

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-16 Thread Jesper Wallin
On Tue, Aug 15, 2017 at 07:24:47PM -0400, Ted Unangst wrote: > this looks good. will commit soon. > > (one nit, i'll correct, is man page options are upper case first.) Noted for future reference. Thanks!

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-15 Thread Ingo Schwarze
Hi Ted, Ted Unangst wrote on Tue, Aug 15, 2017 at 07:42:39PM -0400: > Jesper Wallin wrote: >> On Sun, Aug 13, 2017 at 09:52:22AM +0200, Martijn van Duren wrote: >>> I've also been bitten by this a couple of times, but you can also solve >>> this via the sensorsd framework, which is how I've done

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-15 Thread Ted Unangst
Jesper Wallin wrote: > On Sun, Aug 13, 2017 at 09:52:22AM +0200, Martijn van Duren wrote: > > I've also been bitten by this a couple of times, but you can also solve > > this via the sensorsd framework, which is how I've done it. > > Yeah, someone on IRC also suggested sensorsd or even ksh and a

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-15 Thread Ted Unangst
Jesper Wallin wrote: > On Mon, Aug 14, 2017 at 05:12:05PM +0200, Klemens Nanni wrote: > > Personally I'd also prefer having this in apmd(8) rather than some other > > daemon or script. Some comments: > > > > You should pass optarg instead of errstr to error(). Either ways error() > > will still

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-15 Thread Jesper Wallin
On Mon, Aug 14, 2017 at 05:12:05PM +0200, Klemens Nanni wrote: > Personally I'd also prefer having this in apmd(8) rather than some other > daemon or script. Some comments: > > You should pass optarg instead of errstr to error(). Either ways error() > will still append since it uses err(3). This

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-15 Thread Craig Skinner
Hi Jesper/all, On Sun, 13 Aug 2017 14:13:42 +0200 Jesper Wallin wrote: > > ... someone on IRC also suggested sensorsd or even ksh and a > cronjob. I personally find it a bit too ducttapey though, especially > for a feature one would expect on a laptop. For what its worth, below is an unpriv

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-14 Thread Klemens Nanni
On Mon, Aug 14, 2017 at 11:21:03AM -0400, Ted Unangst wrote: > Klemens Nanni wrote: > > > + case 'z': > > > + autoaction = AUTO_SUSPEND; > > > + autolimit = strtonum(optarg, 1, 100, ); > > > + if (errstr != NULL) > > > +

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-14 Thread Ted Unangst
Klemens Nanni wrote: > > + case 'z': > > + autoaction = AUTO_SUSPEND; > > + autolimit = strtonum(optarg, 1, 100, ); > > + if (errstr != NULL) > > + error("invalid percent: %s", errstr); > > +

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-14 Thread Klemens Nanni
On Sun, Aug 13, 2017 at 02:13:42PM +0200, Jesper Wallin wrote: > On Sun, Aug 13, 2017 at 09:52:22AM +0200, Martijn van Duren wrote: > > I've also been bitten by this a couple of times, but you can also solve > > this via the sensorsd framework, which is how I've done it. > > Yeah, someone on IRC

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-13 Thread Jesper Wallin
On Sun, Aug 13, 2017 at 09:52:22AM +0200, Martijn van Duren wrote: > I've also been bitten by this a couple of times, but you can also solve > this via the sensorsd framework, which is how I've done it. Yeah, someone on IRC also suggested sensorsd or even ksh and a cronjob. I personally find it a

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-13 Thread Martijn van Duren
Hello Jesper, On 08/12/17 23:39, Jesper Wallin wrote: > Hello tech@ > > I've been stuck with fsck for way to many times now because of me > forgetting to connect the AC power. This patch will add -z and -Z > followed by the percentage. apmd will try to suspend or hibernate the > system if the AC

[patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-12 Thread Jesper Wallin
Hello tech@ I've been stuck with fsck for way to many times now because of me forgetting to connect the AC power. This patch will add -z and -Z followed by the percentage. apmd will try to suspend or hibernate the system if the AC is not connected and the estimated battery life goes below the