File: theme.pl

package info (click to toggle)
fdpowermon 1.19
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 148 kB
  • sloc: perl: 297; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 813 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copy this file to ~/.config/fdpowermon/theme.pl.
#
# If you don't like the 'default' theme, define a new one by copying
# /etc/fdpowermon/theme.cfg to ~/.config/fdpowermon/theme.cfg and
# renaming/adjusting the 'default' theme there to something new.
# Don't forget to replace "default" below with your new theme name.
#
# See the manpage fdpowermon(1) for full details on what you can do
# here.

# define a suspend action
sub suspend {
    system("sudo pm-suspend");
}

# initialize our theme, from /etc/fdpowermon/theme.cfg or
# ~/.config/fdpowermon/theme.cfg
my $theme = fdpowermon::theme::get_theme("default");

# on the discharge event for the lowest element in the list of steps (0 = first
# in the index, "d" for discharge), call the "suspend" sub defined above
$theme->set_event( 0, \&suspend, 'd' );