fix low battery
This commit is contained in:
@@ -29,6 +29,7 @@ namespace
|
||||
Proc child;
|
||||
|
||||
Cmd amixer("amixer");
|
||||
Cmd low_battery_notify("notify-send", "--urgency=critical", "Battery Low");
|
||||
}
|
||||
|
||||
extern "C"
|
||||
@@ -176,6 +177,10 @@ extern "C"
|
||||
{
|
||||
new_stat += "🔋";
|
||||
remaining = battery_remaining("BAT0");
|
||||
|
||||
// Low battery warning
|
||||
if(remaining && atoi(charge.c_str()) < 15)
|
||||
run(low_battery_notify); // todo: use lib notify
|
||||
}
|
||||
else
|
||||
new_stat += "🔌";
|
||||
@@ -305,6 +310,7 @@ extern "C"
|
||||
size_t link_begin = link.find('-');
|
||||
if(link_begin != string::npos)
|
||||
{
|
||||
// Extract link
|
||||
Cmd open_bookmark(BROWSER);
|
||||
link = link.substr(link_begin+1);
|
||||
open_bookmark += link.c_str();
|
||||
|
||||
Reference in New Issue
Block a user