From 0e00351b3a8d0120a8eebf55c4dbeb88c27eb91e Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 23 Jun 2019 07:02:34 +0200 Subject: Toggle email notification --- rc.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rc.lua b/rc.lua index 6d58ff6..04439e0 100644 --- a/rc.lua +++ b/rc.lua @@ -205,11 +205,12 @@ mybatwidget = wibox.widget.textbox ('') mynetworkwidget = wibox.widget.textbox ('') notify_bat = true +notify_email = true local lastIp = '' local lastInt = '' -function act() +function act() vicious.force({ mpdwidget, }) --{{ Batterie notification awful.spawn.easy_async("bash -c \"acpi | cut -d' ' -f3 \"", @@ -321,7 +322,7 @@ function act() awful.spawn.easy_async( "bash -c \"which hasMail > /dev/null 2>&1 && hasMail\"", function(res, stderr, reason, exit_code) - if res == "0\n" then + if res == "0\n" or notify_email == false then myemailwidget:set_text ( "" ) elseif res == "" then myemailwidget:set_text ( "☠" ) @@ -674,6 +675,13 @@ awful.key({ modkey, "Shift" }, "s", hotkeys_popup.show_help, {descriptio end, {description = "Toggle battery warning", group = "awesome"}), + awful.key({ modkey, "Shift" }, "e", function () + notify_email = not notify_email + naughty.notify({ preset = naughty.config.presets.normal, timeout=1, + text = "Notification d'email : " .. ( notify_email and "activée" or "désactivée" )}) + + end, + {description = "Toggle email warning", group = "awesome"}), awful.key({ modkey, "Control" }, "t", showHideWibox), -- cgit v1.2.3