From 61a6147c6bf5d695ab13875174fb88ff0c3b3d33 Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 15 Nov 2018 18:25:05 +0100 Subject: [PATCH] don't print bat widget if no bat status --- awesome/.config/awesome/rc.lua | 4 +++- awesome/.config/awesome/themes/default/theme.lua | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index 4d70f24..8ad53a3 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -193,7 +193,7 @@ lain.widget.contrib.redshift:attach( end ) -local mpdicon = wibox.widget.imagebox(beautiful.mpd) +local mpdicon = wibox.widget.imagebox(beautiful.mpd_icon) local mpd = lain.widget.mpd({ settings = function() mpd_notification_preset = { @@ -228,6 +228,8 @@ local bat = lain.widget.bat({ if bat_now.status then perc = perc .. " " .. bat_now.status + else + return end widget:set_markup(markup.fontfg(beautiful.font, beautiful.fg_normal, perc .. " ")) diff --git a/awesome/.config/awesome/themes/default/theme.lua b/awesome/.config/awesome/themes/default/theme.lua index 2ffe26d..ca0885e 100644 --- a/awesome/.config/awesome/themes/default/theme.lua +++ b/awesome/.config/awesome/themes/default/theme.lua @@ -129,8 +129,7 @@ theme.cpu_icon = icon_dir.."cpu.png" theme.net_up = icon_dir .. "net_up.png" theme.net_down = icon_dir .. "net_down.png" theme.spr_right = icon_dir .. "spr_right.png" - -theme.mpd = icon_dir .. "mpd.png" +theme.mpd_icon = icon_dir .. "mpd.png" -- Generate Awesome icon: theme.awesome_icon = theme_assets.awesome_icon(