1

I like the screensavers, but when on battery power the blank one makes more sense. How could I configure the system to use the blank one when on battery power and other more colourful ones when on mains?

To clarify: The options to set different timeouts for battery/mains are fine; I am looking to set different screensavers (no screen content on battery power, interesting colourful stuff when on mains power).

nsandersen
  • 273
  • 1
  • 5
  • 14
  • I am not asking about timeouts, but the screen saver content. – nsandersen Jun 08 '19 at 13:31
  • 0h ok.. i will remove the link.. screensaver means are you using any custom ones? – PRATAP Jun 08 '19 at 13:35
  • Thank you. The X screen saver ones. But I would be happy to use the blank screen gnome one when on battery. – nsandersen Jun 08 '19 at 14:32
  • 1
    You're using xscreensaver so this might start you toward an answer To get the battery state: upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep statewill return discharging if your system is running on battery. xscreensaver configuration is in ~/.xscreensaver. The property you're looking for in this file is mode. The optional values are one, blank, and random. So we need to find a notification of battery state change then a little sed piece to modify the xscreensaver configuration when the battery state changes. – Stephen Boston Jun 09 '19 at 15:42

0 Answers0