diff --git a/freedesktop/utils.lua b/freedesktop/utils.lua index c5247c3..f9358e7 100644 --- a/freedesktop/utils.lua +++ b/freedesktop/utils.lua @@ -190,7 +190,7 @@ function parse_desktop_file(arg) end end - if program.Exec then + if program.Exec and program.Name then local cmdline = program.Exec:gsub('%%c', program.Name) cmdline = cmdline:gsub('%%[fmuFMU]', '') cmdline = cmdline:gsub('%%k', program.file) diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker index 2ee55b6..989f7a3 100644 --- a/rc.lua.powerarrow-darker +++ b/rc.lua.powerarrow-darker @@ -31,6 +31,7 @@ require("settings.variables") iptraf = terminal .. " -g 180x54-20+34 -e sudo iptraf-ng -i all " musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp " +yahoo_oid = "2972" -- Tags and layouts require("settings.tags") @@ -54,6 +55,15 @@ mytextclock = awful.widget.textclock(" %a %d %b %H:%M") -- calendar lain.widgets.calendar:attach(mytextclock, { font_size = 10 }) +-- Weather +weathericon = wibox.widget.imagebox(beautiful.widget_weather) +yawn = lain.widgets.yawn(yahoo_oid, { + settings = function() + widget:set_markup(markup("#eca4c4", forecast:lower() .. " @ " .. units .. "°C")) + end +}) + + -- Mail IMAP check mailicon = wibox.widget.imagebox(beautiful.widget_mail) mailicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail) end))) @@ -102,7 +112,7 @@ mpdwidgetbg = wibox.widget.background(mpdwidget, "#313131") memicon = wibox.widget.imagebox(beautiful.widget_mem) memwidget = lain.widgets.mem({ settings = function() - widget:set_text(" " .. mem_now.used .. "MB ") + widget:set_text("" .. mem_now.used .. "MB") end }) @@ -110,7 +120,8 @@ memwidget = lain.widgets.mem({ cpuicon = wibox.widget.imagebox(beautiful.widget_cpu) cpuwidget = wibox.widget.background(lain.widgets.cpu({ settings = function() - widget:set_text(" " .. cpu_now.usage .. "% ") + + widget:set_text("" .. cpu_now.usage .. "%") end }), "#313131") @@ -118,7 +129,7 @@ cpuwidget = wibox.widget.background(lain.widgets.cpu({ tempicon = wibox.widget.imagebox(beautiful.widget_temp) tempwidget = lain.widgets.temp({ settings = function() - widget:set_text(" " .. coretemp_now .. "°C ") + widget:set_text("" .. coretemp_now .. "°C") end }) @@ -126,7 +137,7 @@ tempwidget = lain.widgets.temp({ fsicon = wibox.widget.imagebox(beautiful.widget_hdd) fswidget = lain.widgets.fs({ settings = function() - widget:set_text(" " .. fs_now.used .. "% ") + widget:set_text("" .. fs_now.used .. "%") end }) fswidgetbg = wibox.widget.background(fswidget, "#313131") @@ -134,7 +145,11 @@ fswidgetbg = wibox.widget.background(fswidget, "#313131") -- Battery baticon = wibox.widget.imagebox(beautiful.widget_battery) batwidget = lain.widgets.bat({ + timeout=5, settings = function() + + + if bat_now.perc == "N/A" then widget:set_markup(" AC ") baticon:set_image(beautiful.widget_ac) @@ -146,7 +161,12 @@ batwidget = lain.widgets.bat({ else baticon:set_image(beautiful.widget_battery) end - widget:set_markup(" " .. bat_now.perc .. "% ") + widget:set_markup(bat_now.perc .. "%") + + --Fix for battery charging ;) + if bat_now.status == "Charging" or bat_now.status == "Unknown" then + baticon:set_image(beautiful.widget_ac) + end end }) @@ -164,7 +184,7 @@ volumewidget = lain.widgets.alsa({ volicon:set_image(beautiful.widget_vol) end - widget:set_text(" " .. volume_now.level .. "% ") + widget:set_text("" .. volume_now.level .. "%") end }) @@ -173,9 +193,9 @@ neticon = wibox.widget.imagebox(beautiful.widget_net) neticon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(iptraf) end))) netwidget = wibox.widget.background(lain.widgets.net({ settings = function() - widget:set_markup(markup("#7AC82E", " " .. net_now.received) + widget:set_markup(markup("#7AC82E", "" .. net_now.received) .. " " .. - markup("#46A8C3", " " .. net_now.sent .. " ")) + markup("#46A8C3", "" .. net_now.sent .. "")) end }), "#313131") @@ -238,6 +258,15 @@ for s = 1, screen.count() do right_layout:add(arrl_ld) right_layout:add(mailicon) --right_layout:add(mailwidget) + + right_layout:add(arrl_dl) + right_layout:add(weathericon) + right_layout:add(yawn.widget) + + + right_layout:add(arrl_dl) + right_layout:add(weathericon) + right_layout:add(yawn.widget) right_layout:add(arrl_dl) right_layout:add(memicon) right_layout:add(memwidget)