From 52590602d91d705c9a356359b56f45c55cb4d9d8 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Fri, 3 Feb 2017 22:15:16 -0500 Subject: [PATCH] improve widget rendering and use wibox.widget wrapper --- battery-widget/battery.lua | 30 ++++++++++++------ brightness-widget/br-wid-1.png | Bin 1701 -> 1355 bytes brightness-widget/brightness.lua | 11 +++++-- screenshot.png | Bin 6764 -> 6287 bytes volume-widget/vol-widget-1.png | Bin 817 -> 824 bytes volume-widget/volume.lua | 52 ++++++++++++++++++------------- 6 files changed, 60 insertions(+), 33 deletions(-) diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua index b2c78e7..2633ba2 100644 --- a/battery-widget/battery.lua +++ b/battery-widget/battery.lua @@ -3,27 +3,37 @@ local awful = require("awful") local naughty = require("naughty") local watch = require("awful.widget.watch") -battery_widget = wibox.widget { widget = wibox.widget.imagebox } - -- acpi sample outputs -- Battery 0: Discharging, 75%, 01:51:38 remaining -- Battery 0: Charging, 53%, 00:57:43 until charged -local path_to_icons = "/usr/share/icons/Arc/panel/22/" +battery_widget = wibox.widget { + { + id = "icon", + widget = wibox.widget.imagebox, + resize = false + }, + layout = wibox.container.margin(brightness_icon, 0, 0, 3), + set_image = function(self, path) + self.icon.image = path + end +} + +local path_to_icons = "/usr/share/icons/Arc/status/symbolic/" watch( "acpi", 10, function(widget, stdout, stderr, exitreason, exitcode) local batteryType - local _, status, charge, time = string.match(stdout, '(.+): (%a+), (%d%d)%%, (.+)') + local _, status, charge, time = string.match(stdout, '(.+): (%a+), (%d?%d%d)%%,? ?.*') charge = tonumber(charge) if (charge >= 0 and charge < 15) then batteryType="battery-empty" show_battery_warning() - elseif (charge >= 15 and charge < 40) then batteryType="battery-caution" - elseif (charge >= 40 and charge < 60) then batteryType="battery-low" - elseif (charge >= 60 and charge < 80) then batteryType="battery-good" - elseif (charge >= 80 and charge <= 100) then batteryType="battery-full" + elseif (charge >= 15 and charge < 40) then batteryType="battery-caution-symbolic" + elseif (charge >= 40 and charge < 60) then batteryType="battery-low-symbolic" + elseif (charge >= 60 and charge < 80) then batteryType="battery-good-symbolic" + elseif (charge >= 80 and charge <= 100) then batteryType="battery-full-symbolic" end if status == 'Charging' then batteryType = batteryType .. '-charging' @@ -47,13 +57,15 @@ end function show_battery_warning() naughty.notify{ + icon = "/home/pashik/.config/awesome/nichosi.png", + icon_size=100, text = "Huston, we have a problem", title = "Battery is dying", timeout = 5, hover_timeout = 0.5, position = "bottom_right", bg = "#F06060", fg = "#EEE9EF", - width = 200, + width = 300, } end diff --git a/brightness-widget/br-wid-1.png b/brightness-widget/br-wid-1.png index cb11b553bafd99160ab8134fe22ea7e20462ced1..f9200ebec8db15a348e07caa12ca345635c2eb4f 100644 GIT binary patch delta 1329 zcmV-118;y)4L5zuG=1?yf-i5^IH`wogSDBsCRjYub?3Hi!oO6B?7+ zuNPnKgKes5NSY=kYHAQQYMazp3lCah_ZCwZ78Mm}BablmY+%g2#pc05se442GEw!8kK5(~*vc>zs2b z9YmJ%+XaGDYV}L*aTyRAS02#}1R#j!irVaIoh={M$ z)mBwj;4@fuej$XgESn*6E;wh7lcOC~l@(1}HWQI;+j~3OPxqb)M~nrme+2g}UJ68< zbC-`qkOte@vOVBmWm$Hpp<&6A#p~9+R9Cy6Gp1=;ba-Ub#tk)Vs>8+tpb=6!oC`!G zr6d98BF%|JBC+$W*2j1m+ugY@=nrgd3>`f1F#!DVWA}noLU6{FlB5(D0)UiK=}HWS zBN@?_q<7&lT?84&#l}2 z-6wOtGeJOzh=4#u04{*ait_5J%JQyy$%51^UL2k^u@A(KkY4Cw5TbxWpywxf6te_XV0w;2AV=! ze1(NB?bo-wdE?UMsmZ?q01>@DpR}wT2nc|{w|x1|LtifQ`+-0J!1RL$myUJC@7+s> zUFqwWN_BR$bI#`iF+4INrTpgTu`7N30I;H_TJz>bfA6mfHKc__==#RCcM&nKaM5J! z*0obT05jE|j>msJf7TVhe;*J9063;~dmx;F7N4d~>BbUKeo;|%0OGH>2kCe+x^?d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X-XgPmc4Lsu_&BM5o`319_usy@ zyS{N`TfW%)ji3Cer!N<~GZ zC^{JFAd`9ie_Jn;<9uJ=-QT~N3Wq;?F3e_UZ`?Zf;)Npy_Z~mK`m5h;uYTOfFS9dM zL-f^n`Q7&nEbT9t2GGpRs?|6M!e;Oq2%}7fn5xzIU@J~4l`B8{1%P#p3}1Ntd$aG{ z%(myxefi>*H!d}GIK^<#b!TQsWY+Q`6p?ay^~8x2f1g}v0|SGZC{r%4iuh;$?rm-% z5fSy2MuSY|h1b6e08v{T0IV-9t=#*dRc0Iji1)N~5P9tv;GxnDf3CKbMIv{@^tq$7UAhax=gCgB>@mO!H=UAJ}pfBM_E|8;Yqe{gd0Y-zMqsaD>4>o0S2 zb6$LEqhT%O^r4oFO=_%J_vW_td>94>rmCifgow2{FRc_rFoT_)osEr+_Iy6yo=+29 zC=@2f&rFO@4)hO}*UJC6`nQFJIq#Dr*DFFgpiyH8sx>Y!vsQPAfu;J~+0}!HW)Ow} ze=++c@#2|?orC=%20&GL{CI2Wqos|FH6jXvFp4rnw6D*za4IsyI`nc7=j{ofl;|hfV08oXtwzOaVf35!j X$1XmRI0m%b00000NkvXXu0mjfUD7m0 diff --git a/brightness-widget/brightness.lua b/brightness-widget/brightness.lua index 59977d7..f003eca 100644 --- a/brightness-widget/brightness.lua +++ b/brightness-widget/brightness.lua @@ -1,12 +1,19 @@ local wibox = require("wibox") local awful = require("awful") +local gears = require("gears") local watch = require("awful.widget.watch") brightness_widget = wibox.widget.textbox() brightness_widget:set_font('Play 9') -brightness_icon = wibox.widget.imagebox() -brightness_icon:set_image("/usr/share/icons/Arc/actions/22/object-inverse.png") +brightness_icon = wibox.widget { + { + image = "/usr/share/icons/Arc/status/symbolic/display-brightness-symbolic.svg", + resize = false, + widget = wibox.widget.imagebox, + }, + layout = wibox.container.margin(brightness_icon, 0, 0, 3) +} watch( "xbacklight -get", 1, diff --git a/screenshot.png b/screenshot.png index 4e26e4b525e287a194df3e7b1e74e75289192101..21d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*--|g$&|JIx5&UFk8 z4Z1U1GrD@5I4xFADY!zAnAvT4z8}X4Au6S;Wlw9RRW_S*`gRq_q4YX)=Ioaq`vZR_ zK2(w<{g*Gh6(%A@B%+AOfupHAwQSW|5g|ps=O=0E+P{j(S){o3xnocWE9FvoV9S8u zqJcXHm&rs#Dw`b-{9tr+RA~hO##jVUT7yVxjMl1T;!}$8CE{PW*%JE4+)Jprlr?hf=ZH-Nm)LK(cTb+5OCkW7G9OhX;tl*T93kU!a8e`mH ztTas>8$UIsMC+R8alfhCGLOSZ%n}5CJ|AnPTwC0^{;8EKQlzzx^KqW@1uiW!5(%@` zIyJ@`>o5=q;lgkTK_E_&FbGCR#}J{aswzoR$KMta&+}Y5hyXzl7?ZjYI3HP{ z>5CL|65tYqK}U$CseAPA(#0v~ERhhAkS()i?J0LKHI8Ggw3Ovf6Ls-9;*(sBqnou~ zRYZhWP*N608&yh!h&9G_&6QF~oEU2y+saW1%T5oMe1#a38kyaH diff --git a/volume-widget/vol-widget-1.png b/volume-widget/vol-widget-1.png index ba03630f32408433c60ab7376751e495a9e95fcc..6f09cce7b84193e8074dc75d049d41c8c16fa9dc 100644 GIT binary patch delta 792 zcmV+z1Lyp)2Dk;6G0UIX1gx!g5B0wD9~atNQi9_pXH*Fiv)#OBKiOU3D)Qz(FaWQ7ihdC z8o_`Vlpq)deN{jb>jP@AKwoGJy001fu zG~Jr%1+ck5gVMOTR9sFZlz2Rze+EqRLf;vsXk-{gR*&4!8A4JbqtZZAk|b)0Etnib zCm`a0BN}a4Sy^JT%lQt3-gW7sly^!gCMHpcS~efB3dMaFrZND zbXSM(95tChA%15Y8#AB*bar%DE#{tX+xzJc0P1S39F8q_B|Re|eh8sVM-})hAX~RsiVr`banofa5sX&F}HdJ$&NbaEUCj z0HUGrzoq5935Z6c3hBxah5q1w#lqq%1I4%>{)#kz{7}V=NZS*kEj8e`0az$BS1Z?X4{U zzAY>YYBhjBFeu+&R>_rHPI5e-yxY7+s2}JR^d(Z-F*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I`KJA}dzRnW?q?8`+0R-tt#<(J?R4QJNr&Gv3bKqR1eBkX~ P00000NkvXXu0mjf6TNkK diff --git a/volume-widget/volume.lua b/volume-widget/volume.lua index 90251a6..c403dfd 100644 --- a/volume-widget/volume.lua +++ b/volume-widget/volume.lua @@ -1,26 +1,34 @@ -local wibox = require("wibox") local awful = require("awful") +local wibox = require("wibox") +local watch = require("awful.widget.watch") +local gears = require("gears") -function update_volume() - awful.spawn.easy_async([[bash -c 'amixer -D pulse sget Master']], - function(stdout, stderr, reason, exit_code) - local volume = string.match(stdout, "(%d?%d?%d)%%") - volume = tonumber(string.format("% 3d", volume)) - local volume_icon_name +local path_to_icons = "/usr/share/icons/Arc/status/symbolic/" - if (volume >= 0 and volume < 20) then volume_icon_name="audio-volume-none-panel" - elseif (volume >= 20 and volume < 40) then volume_icon_name="audio-volume-zero-panel" - elseif (volume >= 40 and volume < 60) then volume_icon_name="audio-volume-low-panel" - elseif (volume >= 60 and volume < 80) then volume_icon_name="audio-volume-medium-panel" - elseif (volume >= 80 and volume <= 100) then volume_icon_name="audio-volume-high-panel" - end - volume_icon:set_image("/usr/share/icons/Arc/panel/22/" .. volume_icon_name .. ".svg") - end) -end +volume_widget = wibox.widget { + { + id = "icon", + image = path_to_icons .. "audio-volume-muted-symbolic.svg", + resize = false, + widget = wibox.widget.imagebox, + }, + layout = wibox.container.margin(brightness_icon, 0, 0, 3), + set_image = function(self, path) + self.icon.image = path + end +} - -volume_icon = wibox.widget.imagebox() - -mytimer = timer({ timeout = 0.2 }) -mytimer:connect_signal("timeout", function () update_volume() end) -mytimer:start() \ No newline at end of file +watch( + 'amixer -D pulse sget Master', 1, + function(widget, stdout, stderr, reason, exit_code) + local volume = string.match(stdout, "(%d?%d?%d)%%") + volume = tonumber(string.format("% 3d", volume)) + local volume_icon_name + if (volume >= 0 and volume < 25) then volume_icon_name="audio-volume-muted-symbolic" + elseif (volume >= 25 and volume < 50) then volume_icon_name="audio-volume-low-symbolic" + elseif (volume >= 50 and volume < 75) then volume_icon_name="audio-volume-medium-symbolic" + elseif (volume >= 75 and volume <= 100) then volume_icon_name="audio-volume-high-symbolic" + end + volume_widget.image = path_to_icons .. volume_icon_name .. ".svg" + end +) \ No newline at end of file