Yukiharu YABUKI の tDiary
このtDiaryを検索します。
2019-09-06 Debian related video [長年日記]
_ [Debian] youtube video:What are Debian maintainer scripts?
Debian packageのメンテナースクリプトについて理解を深めたい場合や、技術英語について触れてみたい。場合は見てみると良いでしょう。
この動画は再生するとあなたのyoutubeアカウントに記録が残ります。
_ [Debian] fdpowermon
fdpowermon/fdpowermon at master · yoe/fdpowermon Thinkpadで、電池容量が一定以下になったら、suspendやaplayで音を出して状態を知りたいので、使っているが、上手く動かせていない。うーん。 ~/.config/fdpowermon/theme.plに下記を置いて実行している。
# 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 {
# /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Suspend boolean:true
system("/usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Suspend boolean:true");
}
sub beep {
system("/usr/bin/aplay /usr/share/games/wesnoth/1.14/sounds/bell.wav");
}
# initialize our theme, from /etc/fdpowermon/theme.cfg or
# ~/.config/fdpowermon/theme.cfg
# my $theme = fdpowermon::theme::get_theme("mytheme");
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( 1, \&suspend, 'd' );
$theme->set_event( 2, \&beep, 'd' );
[ツッコミを入れる]