forked from yoe/fdpowermon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.pl
More file actions
23 lines (19 loc) · 813 Bytes
/
theme.pl
File metadata and controls
23 lines (19 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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' );