From 20fb5304ed5da71a73cfdd41d553270ec0af451f Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 19 Apr 2020 10:13:15 +0200 Subject: Update status bar --- rc.lua | 57 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'rc.lua') diff --git a/rc.lua b/rc.lua index b6db451..6930da4 100644 --- a/rc.lua +++ b/rc.lua @@ -149,40 +149,43 @@ cpuwidget = lain.widgets.cpu({ settings = function() int_cpu_usage = tonumber(cpu_now.usage) widget:set_markup(markup("#cb66cb", "") .. cpu_now.usage .. "%") - end -}) + end, timeout=10}) -- MPD -- mpdwidget = lain.widgets.mpd() +gputemp = wibox.widget.textbox() +vicious.register(gputemp, vicious.widgets.thermal, {"sys"}, 5) + mpdwidget = wibox.widget.textbox() -- Register widget --- vicious.register(mpdwidget, vicious.widgets.mpd, --- function (mpdwidget, args) --- if args["{state}"] == "Stop" then --- return "" --- else --- if not (args["{Artist}"] == 'N/A') then --- if not (args["{Title}"] == 'N/A') then --- return markup.bold(args["{Artist}"]..' - '.. args["{Title}"]) .. " / " --- else --- return markup.bold(args["{Artist}"] ) .. " / " --- end --- else --- if not (args["{Title}"] == 'N/A') then --- return markup.bold(args["{Title}"]) .. " / " --- end --- return '' --- end --- end --- end, 10) +vicious.register(mpdwidget, vicious.widgets.mpd, + function (mpdwidget, args) + if args["{state}"] == "Stop" then + return "" + else + if not (args["{Artist}"] == 'N/A') then + if not (args["{Title}"] == 'N/A') then + return markup.bold(args["{Artist}"]..' - '.. args["{Title}"]) .. " / " + else + return markup.bold(args["{Artist}"] ) .. " / " + end + else + if not (args["{Title}"] == 'N/A') then + return markup.bold(args["{Title}"]) .. " / " + end + return '' + end + end + end, 5 +) -- MEM memwidget = lain.widgets.mem({ settings = function() int_mem_now_used = tonumber(mem_now.used) widget:set_markup(markup.fg.color("#dda", mem_now.used .. "M")) - end + end, timeout=5 }) @@ -207,9 +210,7 @@ volumewidget = lain.widgets.alsa({ vlevel = vlevel .. "%" end widget:set_markup(markup.fg.color("#ccaacc", vlevel)) - end -}) - + end , timeout=3}) -- Separators first = wibox.widget.textbox(markup.font("Terminus 4", " ")) @@ -228,7 +229,7 @@ local lastInt = '' local lastEssid = '' function act() - vicious.force({ mpdwidget, }) + -- vicious.force(mpdwidget) --{{ Batterie notification awful.spawn.easy_async("bash -c \"acpi | cut -d' ' -f3 \"", function(stdout, stderr, reason, exit_code) @@ -355,14 +356,14 @@ function act() elseif res == "" then myemailwidget:set_text ( "☠" ) else - myemailwidget:set_text ( "📧" ) + myemailwidget:set_text ( "📧" .. res) naughty.notify({ preset = naughty.config.presets.normal, title = "T'as un email", text = string.gsub(res, "\n", "") .. " new mails !" }) end end) - end + end act() -- cgit v1.2.3