From 2b4dba4853fc1840c5aef300b747c5a182655ba4 Mon Sep 17 00:00:00 2001 From: pmakhov Date: Mon, 9 Oct 2017 17:14:03 -0400 Subject: [PATCH] batteryarc widget --- batteryarc-widget/10_c.png | Bin 0 -> 1034 bytes batteryarc-widget/10_d.png | Bin 0 -> 956 bytes batteryarc-widget/20_c.png | Bin 0 -> 1109 bytes batteryarc-widget/20_d.png | Bin 0 -> 1031 bytes batteryarc-widget/80_c.png | Bin 0 -> 2166 bytes batteryarc-widget/80_d.png | Bin 0 -> 1108 bytes batteryarc-widget/README.md | 44 ++++++++++++++++- batteryarc-widget/batteryarc.lua | 82 +++++++++++++++++++++---------- 8 files changed, 99 insertions(+), 27 deletions(-) create mode 100644 batteryarc-widget/10_c.png create mode 100644 batteryarc-widget/10_d.png create mode 100644 batteryarc-widget/20_c.png create mode 100644 batteryarc-widget/20_d.png create mode 100644 batteryarc-widget/80_c.png create mode 100644 batteryarc-widget/80_d.png diff --git a/batteryarc-widget/10_c.png b/batteryarc-widget/10_c.png new file mode 100644 index 0000000000000000000000000000000000000000..3faf7531c6eb211b540c83ff22d64200e7754538 GIT binary patch literal 1034 zcmV+l1oiugP)F(?fdb(~q{TirQ2XYM!Ox%1tF&KIWP?18-V=_gN4PZCO7 zjRVO=gjblRX_;m$W?iw(&*S8k7_$l4lFHZ7X`%PO{wiF#&4^#PUP`o2bQw?xYiBC6F`uQqq~Vu?g@D3hI zUvm9#e6_4llHfK%-(v$I5JE)uMBE~4CR7$CoIyJ3SdJq7#QuRtzaxpxSPmks{?i9P6GlWn) zZX<*o#|?r2TR8JZDm|CXyq@ZN);7}2s|LasN-4$|rG#@HkyeOw?8-n=N(muKX(@YZ<+YDL%)flO z^y6>%cvNyx`e_~jh6=+9Ou~__;8yH2^|@Kr4;SM>%1BkJu_M z4PCm>NsAc<00__PQW^eqpyJ<%?C06-}P04Yyr5St6dPFiDEUIc*M(t4LNAthzh zFbvLl`pLs&MskDmM%OOW%HXBB!t~zK_Gb zDW#lqA%s#2V@wD!41-bxJGH0hBv#V{5y*vfBL~ ze4J*SbJH{_rG#LFkk(oX$%P1lh$GFvYMssL6vLUsKdQLGrU3;roB#j-07*qoM6N<$ Eg5_4&?*IS* literal 0 HcmV?d00001 diff --git a/batteryarc-widget/10_d.png b/batteryarc-widget/10_d.png new file mode 100644 index 0000000000000000000000000000000000000000..c9aa8d3a0643f6327a1a6f435c0dddf23390e58d GIT binary patch literal 956 zcmV;t14I0YP)WnA2n#?26!Gu^1%kpLC)g%7u`PQ%B(~$n%v5(hShR7Rk<;n%%4b!5 z`<&|2w{G1kRzCj{P9FHXAAfXaY=j5AzOm_yImQ%9DkWtmn|V!&PyWzvh#;G#<-luy zd|MbOnexUE%)a1hTpH_aaq!$YkDkB3H#E;JzTYxL9xtG_XE1>trQpY*T`G-@2;vX#{gXzil*(ijW6W5qb*QzTGtuW=ROu3V8SEB<@1M_tF>CE{ zY~}OCoocOGnK3(ioulP^f3M!$-l^7-Wr9Q|qX1|fHk(c7oQDTchhOyWE9I}}1Q8ME z);i~1+qR0OZUEl7t(8@$!_Lw2>Hgl;Ta|=5V~lm=vJ9-zXok_z%VeE(&I>`Dcoel= zvir7T?5wSKmd|!{mCW|;*7EApG*U=GWUSR%Crs^}<3v2*-g)a%E#=!Ee$Y30acTNy za5!osbN}aG0ThSJ31Sii!2F+s{#P%&a`k-xrO~00%Wn<8^JdT3i}9;ahX9Cp8c+Kk z>h;oSIcSM)Ev*1JJwUflpt9DZT(hw1t6ek`6JikZ$i0K6Sr zD>rZVUKnq+Wx@ymh!T_x3_x7SVWScM2>{06J%jfLEhFZ{{FGR)-0d7X+iHuX0AQQV z1ZBMG4!-?3?hgk0qnH!(Q^GX#`rY}~tehDg22ig(Oi)^5iHLLV%o96*b8%^K>U9^H z2XlYN5h4O$ZF>!3?YBy+t=@@o01xICl5AN=1R+IaqBt^h?P~zFnc3RR>|tih=17T+ z#rsbz#NefgQ@uS=y}ta*tpu44weyZRmqI4clvKpI^X|ZXN_g)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_d.png b/batteryarc-widget/20_d.png new file mode 100644 index 0000000000000000000000000000000000000000..15fabeddcd43f06832207c42cb18d62928bfd621 GIT binary patch literal 1031 zcmV+i1o-=jP)gDi&rx?Z68Ti{8sP2dw%!*-Z|%8w zg7GGfFbu;q49hYv59wb`pur){&`Cb8giy`Py7AekR!$sBV-*u*_9He|AOf$vsggEKTyTM?f0Bg zsd7-FH5-3ta{$oV-5C^kf&qYY4ghxP+1#Cb;ZrC3$F3oa7k|F*+3wX(KFZB40)Xqv zy*)%IsXu({Q!_nRhH=eX=6L{sC=FmDgaAOw=ZPFT8NE0@ww+!<2$TX)3M2eqlF6!l zo!FdR=s4F?D@)UL0N{=j!1OO2#uxzJ=s9!Y#_0Urdpm0xrCu9~YM&SGTt2(=~S%0P4*5Dt6W~F9b0;J{IkadzH%S z$*}(N{O!P!M&1FBBg9pmQo5;Cy3{R+KmOo9*@vZ>pYCj>ml~QNOw;hM+e`gN+P34@wkAMX#opiC&Zn1x`{3(* z#uzgUgHlQeMhGdT1Q(3+SN6&VymdUMQw+xv{{rJRuJ}CPql^Fm002ovPDHLkV1m#p B@D~68 literal 0 HcmV?d00001 diff --git a/batteryarc-widget/80_c.png b/batteryarc-widget/80_c.png new file mode 100644 index 0000000000000000000000000000000000000000..e6dae750423a9ede3630fc20424720e56223ab79 GIT binary patch literal 2166 zcmV-+2#NQJP)9F9c~Azyc7+g(^i$44~|_+1p0{pujd7Lz6rA{OlLM-1XAFlBCt^R#hS;%SN+g z$+b{RsRGnGn^RK25EC0Ff*{8vDFLWbB_ihC_kV7jJvx2lr6Y&iRc~QwQDZKA$eNV^ zf)X+VfKe#8XG|}qx^qSmilRO+6a~TcNr|mvlY35_kb%bb<45;SAC^=t%{|JRnGC5q zYc(ZO7{ggrRK0hSHT9x1&Uqi4Pb#4ZMF{5B(sHZW^4@LPI=1WJ6dPWgdz@n=1_1;J zAu|YY8Ab@?thZYB>ivP)^l~iv8c)`r_N24iT>1EmbB|UQZC^1yF}`>Ej)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kD^+#Q1CW>PEG2k;?h9_gjw(ZJ}+epVxpPGLAqznGjzx=g1 zzocJ1I0PgE5PXKsY@)SFt>(tzW7ETvlMsFIXl4E0>e8kA%?ppp*^P&@>!O2azW45_ zGiOxd#g9IjzjM!s8i6&26%cW3Vy|++8RM!H!Cd&z-e{gbdsb3ZBC}=R)YQ@Gw}1HF z-sywc(r5qr_r0@Mf^P05tUP0D(H5P z_sCCv`u?{4dsC_|pFQ`*C!g9X*FzyWlM1sT5hC*5w|iY;_C83G6svksV}-FyMD)8q z{jpZ7u`v%HJUD;u+`}*L6s;=#yZ6hd>rUaV zWg*JXoE2b!@Utk2Y?&LrURLS)g-f?*XQvJyI&k#x;K*=aQD@P)2M=ysowT|^x$N&HU07*qoM6N<$f@z^NV*mgE literal 0 HcmV?d00001 diff --git a/batteryarc-widget/80_d.png b/batteryarc-widget/80_d.png new file mode 100644 index 0000000000000000000000000000000000000000..220c8e31178b9e9a1785695eaab69c9af7ec6b05 GIT binary patch literal 1108 zcmV-a1grarP){eHp!UWE3Zq-5>40@6@AcRCwVp)!5 zx&2fov9NMdC=v#;!P?>s1#4HUwq-P#OWEA+;)-xWJE*|rwpQk_Tzb=*VT?)A001n@ zF$^QivZ5#ez%xuCnSQ3$;`7j@!%{svaB9okVgmq0mJ5lrB!~_w(9+hr9bHtZ41|!$ zWJCzjG{f`!%Lx@V0I+rV>;Zp#CR%Tuo!Y9zK_=@6v^UzU{PD?tBK10kAP9`HC`v5L zsz~RzcHP~S@$w~gwHM=)Z@&q=J+krl^ch=Xtg`hrCMxtPhMloWx7<>RZZ;g zBmkhf&7}f+hWm8{Mmh|@SiEi9bMpevySh3_bJOZ?fAS1Ba`#SRc@+S%Yyb9t2$!7p z+P80OZoxOyuc`Vf@H_w@olb?+5%^hVxln8$9j3;w6q6Z*Kv4h`MT1UdS(*j_t)8ge zR&w#Ny~9`idrS}jAgUIPKr`4#VuBDDwzZ2|dGLqG^MfDV6j<)G7!;*4FqzE&Ad7X> zJI}D`wT)_9tz8rV9OVlt~*(A!s}Dh>DU@|?W!V42gwX`blg38T@u9X`er55 z>h}OZc`skrG2EG3thUwu)&KzHHsUH+ZZqEOb^C^T*QcfnyQ#wN^HY{uiM^QFab*Mm z(yQxr*?Jn^K2uxai7~Uw$nF`4*;U~eks(}v;ZLX z@R2M@0HAeuhTPquk&o|q273YE@q>r)+4(o}#dH=E*y8tEd>-FWpTzTutOy)uwpm@F z&a0o_bw|Pg5c~bn#?;I??nLzUy`L&0=CHhQ|JPJ(t#;Ty)Yo_WeZpvbc}nEC*&pxM zrFNzV2{cnoX40`W^?UG@u^nAXEU!{yqpmR3U}+|dMxLgR^TnO{rE{pAS*?rtI@Q31 ajQ;>r-^%-|<4I2d0000 15 and charge < 40 then + batteryarc.colors = { beautiful.widget_yellow } + else + batteryarc.colors = { beautiful.widget_main_color } + end + text.text = charge end, - batteryarc_widget -) + batteryarc) -- Popup with battery info -- One way of creating a pop-up notification - naughty.notify @@ -44,17 +72,18 @@ local notification function show_battery_status() awful.spawn.easy_async([[bash -c 'acpi']], function(stdout, _, _, _) - notification = naughty.notify{ - text = stdout, + notification = naughty.notify { + text = stdout, title = "Battery status", - timeout = 5, hover_timeout = 0.5, + timeout = 5, + hover_timeout = 0.5, width = 200, } - end - ) + end) end -batteryarc_widget:connect_signal("mouse::enter", function() show_battery_status() end) -batteryarc_widget:connect_signal("mouse::leave", function() naughty.destroy(notification) end) + +batteryarc:connect_signal("mouse::enter", function() show_battery_status() end) +batteryarc:connect_signal("mouse::leave", function() naughty.destroy(notification) end) -- Alternative to naughty.notify - tooltip. You can compare both and choose the preferred one @@ -67,12 +96,13 @@ batteryarc_widget:connect_signal("mouse::leave", function() naughty.destroy(noti --[[ Show warning notification ]] function show_battery_warning() - naughty.notify{ - icon = "/home/" .. USERNAME .. "/.config/awesome/nichosi.png", - icon_size=100, + naughty.notify { + icon = HOME .. "/.config/awesome/nichosi.png", + icon_size = 100, text = "Huston, we have a problem", title = "Battery is dying", - timeout = 5, hover_timeout = 0.5, + timeout = 5, + hover_timeout = 0.5, position = "bottom_right", bg = "#F06060", fg = "#EEE9EF",