unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* How to set default screen brightness?
@ 2019-06-15 17:00 Jesse Gibbons
  2019-06-15 17:41 ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 6+ messages in thread
From: Jesse Gibbons @ 2019-06-15 17:00 UTC (permalink / raw)
  To: help-guix

My Librem 13 laptop battery lasts much longer with a lower screen
brightness. When it runs gnome on guix (and I haven't tried any other
de) I have to turn down the brightness every time. This is not so with
my other partition running PureOS. Is there a way to configure a
default screen brightness in guix/gnome?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set default screen brightness?
  2019-06-15 17:00 How to set default screen brightness? Jesse Gibbons
@ 2019-06-15 17:41 ` Tobias Geerinckx-Rice
  2019-06-15 19:22   ` Jesse Gibbons
  0 siblings, 1 reply; 6+ messages in thread
From: Tobias Geerinckx-Rice @ 2019-06-15 17:41 UTC (permalink / raw)
  To: Jesse Gibbons; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

Jesse,

Jesse Gibbons wrote:
> My Librem 13 laptop battery lasts much longer with a lower 
> screen
> brightness. When it runs gnome on guix (and I haven't tried any 
> other
> de) I have to turn down the brightness every time. This is not 
> so with
> my other partition running PureOS. Is there a way to configure a
> default screen brightness in guix/gnome?

Guix doesn't have a notion of ‘default’ screen brightness because 
it doesn't know anything about brightness.

My guess is that PureOS uses systemd; systemd provides a 
backlight.service that reads the backlight brightness at shutdown, 
stores it to disc, and writes that value back to the device at 
next start-up.

It would be a relatively trivial service to add, but that hasn't 
been done yet :-)

We do already provide a simple, script-friendly abstraction tool¹:

  $ guix install light
  $ sudo light -S 50 # percentage

It can even run setuid.

Kind regards,

T G-R

[1]: As opposed to manually reading and writing `find /sys -path 
*backlight*brightness*`.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set default screen brightness?
  2019-06-15 17:41 ` Tobias Geerinckx-Rice
@ 2019-06-15 19:22   ` Jesse Gibbons
  2019-06-15 19:30     ` Pierre Neidhardt
  2019-06-15 20:48     ` Tobias Geerinckx-Rice
  0 siblings, 2 replies; 6+ messages in thread
From: Jesse Gibbons @ 2019-06-15 19:22 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix

On Sat, 15 Jun 2019 19:41:13 +0200
Tobias Geerinckx-Rice <me@tobias.gr> wrote:

> Jesse,
> 
> Jesse Gibbons wrote:
> > My Librem 13 laptop battery lasts much longer with a lower 
> > screen
> > brightness. When it runs gnome on guix (and I haven't tried any 
> > other
> > de) I have to turn down the brightness every time. This is not 
> > so with
> > my other partition running PureOS. Is there a way to configure a
> > default screen brightness in guix/gnome?  
> 
> Guix doesn't have a notion of ‘default’ screen brightness because 
> it doesn't know anything about brightness.
> 
> My guess is that PureOS uses systemd; systemd provides a 
> backlight.service that reads the backlight brightness at shutdown, 
> stores it to disc, and writes that value back to the device at 
> next start-up.
> 
> It would be a relatively trivial service to add, but that hasn't 
> been done yet :-)
> 
> We do already provide a simple, script-friendly abstraction tool¹:
> 
>   $ guix install light
>   $ sudo light -S 50 # percentage
> 
> It can even run setuid.
> 
> Kind regards,
> 
> T G-R
> 
> [1]: As opposed to manually reading and writing `find /sys -path 
> *backlight*brightness*`.

Thanks. I think I can add a service using the `light` tool.
Administrators will likely prefer to install it on anything with a
display that runs on battery power, so I might contribute it in
gnu/services/pm.scm if nobody beats me to it.
-Jesse

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set default screen brightness?
  2019-06-15 19:22   ` Jesse Gibbons
@ 2019-06-15 19:30     ` Pierre Neidhardt
  2019-06-15 20:48     ` Tobias Geerinckx-Rice
  1 sibling, 0 replies; 6+ messages in thread
From: Pierre Neidhardt @ 2019-06-15 19:30 UTC (permalink / raw)
  To: Jesse Gibbons, Tobias Geerinckx-Rice; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 109 bytes --]

Please do, I've been wanting to work on this for a while ;)

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set default screen brightness?
  2019-06-15 19:22   ` Jesse Gibbons
  2019-06-15 19:30     ` Pierre Neidhardt
@ 2019-06-15 20:48     ` Tobias Geerinckx-Rice
  2019-06-15 23:03       ` Jesse Gibbons
  1 sibling, 1 reply; 6+ messages in thread
From: Tobias Geerinckx-Rice @ 2019-06-15 20:48 UTC (permalink / raw)
  To: Jesse Gibbons; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

Jesse,

Jesse Gibbons wrote:
> Thanks. I think I can add a service using the `light` tool.

Yeah, I currently call it from my .xsession, which is horrible…
A proper service would be most welcome.

> Administrators will likely prefer to install it on anything with 
> a
> display that runs on battery power, so I might contribute it in
> gnu/services/pm.scm

Ew.  We actually have that poorly-named file :-(

> if nobody beats me to it.

Go for it!

I still wonder whether it would be possible (and worth it) to do 
this without external dependencies (i.e. basically reimplementing 
‘light’ in Scheme), so I won't be stepping directly on your toes 
in the meantime.

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set default screen brightness?
  2019-06-15 20:48     ` Tobias Geerinckx-Rice
@ 2019-06-15 23:03       ` Jesse Gibbons
  0 siblings, 0 replies; 6+ messages in thread
From: Jesse Gibbons @ 2019-06-15 23:03 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix

On Sat, 15 Jun 2019 22:48:18 +0200
Tobias Geerinckx-Rice <me@tobias.gr> wrote:

> Jesse,
> 
> Jesse Gibbons wrote:
> > Thanks. I think I can add a service using the `light` tool.  
> 
> Yeah, I currently call it from my .xsession, which is horrible…
> A proper service would be most welcome.
> 
> > Administrators will likely prefer to install it on anything with 
> > a
> > display that runs on battery power, so I might contribute it in
> > gnu/services/pm.scm  
> 
> Ew.  We actually have that poorly-named file :-(
I agree the filename is cringeworthy. Unfortunatley it will be difficult
to change the file name now because it will break a lot of end-user OS
definitions and documentation.
> 
> > if nobody beats me to it.  
> 
> Go for it!
> 
> I still wonder whether it would be possible (and worth it) to do 
> this without external dependencies (i.e. basically reimplementing 
> ‘light’ in Scheme), so I won't be stepping directly on your toes 
> in the meantime.
It would be nice to script the commands in shepherd. All it needs to do
is read/write the value in the hardware either using syscalls or in a
virtual file it finds in /sys, and keep track of the value in a
designated location (something like /etc/light.d/backlight) when the
daemon is started/stopped, correct? The only potential problem I see is
it probably wouldn't work on a non-linux kernel like hurd or bsd; that
can be fixed when the need arises.
> Kind regards,
> 
> T G-R

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-15 23:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-15 17:00 How to set default screen brightness? Jesse Gibbons
2019-06-15 17:41 ` Tobias Geerinckx-Rice
2019-06-15 19:22   ` Jesse Gibbons
2019-06-15 19:30     ` Pierre Neidhardt
2019-06-15 20:48     ` Tobias Geerinckx-Rice
2019-06-15 23:03       ` Jesse Gibbons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).