diff options
-rw-r--r-- | rc.lua | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -202,6 +202,9 @@ mynetworkwidget = wibox.widget.textbox ('') notify_bat = true +local lastIp = '' +local lastInt = '' + function act() vicious.force({ mpdwidget, }) --{{ Batterie notification @@ -259,12 +262,29 @@ function act() function(interface, stderr, reason, exit_code) if not ( interface == "" or interface == "\n") then interface = string.gsub(interface, "\n", "") + if not (interface == lastInt) then + naughty.notify({ preset = naughty.config.presets.normal, + title = "ip change", + text = "Changement d'interface " .. lastInt .. " to " + .. interface, + timeout=20}) + lastInt = interface + end + awful.spawn.easy_async("bash -c \"ip r | grep 'dev " .. interface .. "' | grep src | head -n 1 | sed 's/.*src/src/' | cut -d' ' -f 2 | cut -z -f1\"", function(ip, stderr2, reason3, exit_code3) toShow = "" if not ( ip == "" or ip == "\n") then ip = string.gsub(ip, "\n", "") toShow = ip .. "@" + if not (ip == lastIp) then + naughty.notify({ preset = naughty.config.presets.normal, + title = "ip route", + text = "Changement de route " .. lastIp .. + " to " .. ip, + timeout=20}) + lastIp = ip + end end awful.spawn.easy_async("bash -c \"iwconfig" .. interface .. "2>&1 | grep " .. interface .. " | cut -d'\\\"' -f 2 \"", function(essid, stderr2, reason2, exit_code2) @@ -554,7 +574,7 @@ awful.key({ modkey, "Shift" }, "s", hotkeys_popup.show_help, {descriptio awful.util.spawn("roxterm -e bash -c \"mpd;mpc random on;mpc repeat on;ncmpcpp\"") end, {description = "MPD", group = "awesome"}), awful.key({ modkey}, "F2", function () - awful.util.spawn("roxterm -e mutt") end, + awful.util.spawn("roxterm -e fish -c mutt") end, {description = "mutt", group = "awesome"}), awful.key({ modkey, "Mod1"}, "f", function () awful.util.spawn("firefox") end, |