diff --git a/vene.cpp b/vene.cpp index 964668f..1005e02 100644 --- a/vene.cpp +++ b/vene.cpp @@ -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();