From e665b502e3aa4c3a2db925fd1401fbae4ad453ca Mon Sep 17 00:00:00 2001 From: Mutzi Date: Mon, 30 Jan 2023 14:35:06 +0100 Subject: [PATCH] Made bar more beautiful, replaced some icons --- awesome/icons/ac.png | Bin 125 -> 0 bytes awesome/icons/bat.png | Bin 167 -> 0 bytes awesome/icons/clock.png | Bin 356 -> 0 bytes awesome/icons/cpu.png | Bin 266 -> 0 bytes awesome/icons/dish.png | Bin 140 -> 0 bytes awesome/icons/fs.png | Bin 142 -> 0 bytes awesome/icons/info/batcharge.png | Bin 0 -> 206 bytes awesome/icons/info/batempty.png | Bin 0 -> 157 bytes awesome/icons/info/batfull.png | Bin 0 -> 175 bytes awesome/icons/info/bathigh.png | Bin 0 -> 173 bytes awesome/icons/info/batlow.png | Bin 0 -> 156 bytes awesome/icons/info/batmid.png | Bin 0 -> 165 bytes awesome/icons/info/cpu.png | Bin 0 -> 211 bytes awesome/icons/info/download.png | Bin 0 -> 200 bytes awesome/icons/info/mem.png | Bin 0 -> 184 bytes awesome/icons/info/upload.png | Bin 0 -> 217 bytes awesome/icons/info/volhigh.png | Bin 0 -> 239 bytes awesome/icons/info/vollow.png | Bin 0 -> 231 bytes awesome/icons/info/volmute.png | Bin 0 -> 238 bytes awesome/icons/mail.png | Bin 180 -> 0 bytes awesome/icons/mem.png | Bin 117 -> 0 bytes awesome/icons/net_down.png | Bin 348 -> 0 bytes awesome/icons/net_up.png | Bin 350 -> 0 bytes awesome/icons/note.png | Bin 242 -> 0 bytes awesome/icons/note_on.png | Bin 342 -> 0 bytes awesome/icons/spkr.png | Bin 350 -> 0 bytes awesome/icons/svgs/batcharge.svg | 1 + awesome/icons/svgs/batempty.svg | 1 + awesome/icons/svgs/batfull.svg | 1 + awesome/icons/svgs/bathigh.svg | 1 + awesome/icons/svgs/batlow.svg | 1 + awesome/icons/svgs/batmid.svg | 1 + awesome/icons/svgs/cpu.svg | 1 + awesome/icons/svgs/download.svg | 1 + awesome/icons/svgs/mem.svg | 1 + awesome/icons/svgs/svg_to_png.py | 15 ++ awesome/icons/svgs/upload.svg | 1 + awesome/icons/svgs/volhigh.svg | 1 + awesome/icons/svgs/vollow.svg | 1 + awesome/icons/svgs/volmute.svg | 1 + awesome/icons/temp.png | Bin 353 -> 0 bytes awesome/theme.lua | 300 +++++++++++++++++-------------- 42 files changed, 194 insertions(+), 134 deletions(-) delete mode 100755 awesome/icons/ac.png delete mode 100755 awesome/icons/bat.png delete mode 100755 awesome/icons/clock.png delete mode 100755 awesome/icons/cpu.png delete mode 100755 awesome/icons/dish.png delete mode 100755 awesome/icons/fs.png create mode 100644 awesome/icons/info/batcharge.png create mode 100644 awesome/icons/info/batempty.png create mode 100644 awesome/icons/info/batfull.png create mode 100644 awesome/icons/info/bathigh.png create mode 100644 awesome/icons/info/batlow.png create mode 100644 awesome/icons/info/batmid.png create mode 100644 awesome/icons/info/cpu.png create mode 100644 awesome/icons/info/download.png create mode 100644 awesome/icons/info/mem.png create mode 100644 awesome/icons/info/upload.png create mode 100644 awesome/icons/info/volhigh.png create mode 100644 awesome/icons/info/vollow.png create mode 100644 awesome/icons/info/volmute.png delete mode 100755 awesome/icons/mail.png delete mode 100755 awesome/icons/mem.png delete mode 100755 awesome/icons/net_down.png delete mode 100755 awesome/icons/net_up.png delete mode 100755 awesome/icons/note.png delete mode 100755 awesome/icons/note_on.png delete mode 100755 awesome/icons/spkr.png create mode 100644 awesome/icons/svgs/batcharge.svg create mode 100644 awesome/icons/svgs/batempty.svg create mode 100644 awesome/icons/svgs/batfull.svg create mode 100644 awesome/icons/svgs/bathigh.svg create mode 100644 awesome/icons/svgs/batlow.svg create mode 100644 awesome/icons/svgs/batmid.svg create mode 100644 awesome/icons/svgs/cpu.svg create mode 100644 awesome/icons/svgs/download.svg create mode 100644 awesome/icons/svgs/mem.svg create mode 100755 awesome/icons/svgs/svg_to_png.py create mode 100644 awesome/icons/svgs/upload.svg create mode 100644 awesome/icons/svgs/volhigh.svg create mode 100644 awesome/icons/svgs/vollow.svg create mode 100644 awesome/icons/svgs/volmute.svg delete mode 100755 awesome/icons/temp.png diff --git a/awesome/icons/ac.png b/awesome/icons/ac.png deleted file mode 100755 index 272b83275e3ec0146fe87d6efb0d66895f836d17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyaR&H=xc&zM28P=$`tQqkgaHMa zN`m}?85kL-{9Om+DSEm%hHykDCn#_gGFdh=kWrS~M0l^<%)LM%wg8_H*Z=?juUfV0@iEa@pa^40kY6x^!?PP{AWo9Ey9+}H ztE>l*BjxGh7{U>qoN$17M!kW7K_SCOX^m$M9S<29=J+u`pMPwtGEfzRr>mdKI;Vst E0QYSxXaE2J diff --git a/awesome/icons/clock.png b/awesome/icons/clock.png deleted file mode 100755 index 22aef71dcb3a4f7b366e17f20e77343a0282becb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyv7|ftIx;Y9?C1WI$O_~$76-XI zF|0c$^AgBWNcITwWnidMV_;}#VPNdd>RN4Y$sC&9NhHzX@PEg=#Y2r90z^-soN`gTt_TZ9ch7KOqjgro? z541R$8NNiZh^n6~Tnp5qTH+c}l9E`GYL#4+3Zxi}3=EBQ4a{{7%|i?ftPD-9j7_x- wjI0a{OapIKqG-s?PsvQHL})M$F)*_-HUT1t21Q1VD?kklp00i_>zopr0F&ccKmY&$ diff --git a/awesome/icons/cpu.png b/awesome/icons/cpu.png deleted file mode 100755 index e3794ca338f102104a23a6dbe7b3817db70c7fcc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 266 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc3?z4jzqJQa9sxcfu0Xnhq2aVq#{d8SfovcH z#Abl9A&eQSz7TP^0toktekPouI-~kLP+F`c$S)X3GcYnTF)=eUv#_wRvaxYUyn6NJ zT46>3P$JsX#W6%8eCugXp#}v3=Zo8-3yv}RzN-%ok6MuP^K^J;gyPDMx4)e0kIj5@ zQe?Wt*EF-VjIxIF@Ak%9dz9V0bX2H~mm$|9aKWlqQcG4eFf_?Dm)C9Bu;j-|wtI^` VI7H(cXEK2t;OXk;vd$@?2>@emUK9WT diff --git a/awesome/icons/dish.png b/awesome/icons/dish.png deleted file mode 100755 index c71499be618da9c4c1229c6505e710283351d452..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvy@dWsUxc&zM1_mH{wer}X4HISp z#hFWj{DK*nSkCJvxdOR5o-U3d95a&>6xco(N-%iV{bqKU^pj!6A0{Qqe@!?4OFL|O h@0e59#_uwdgCYC~S99CarY}H!44$rjF6*2UngBPDEtmiR diff --git a/awesome/icons/fs.png b/awesome/icons/fs.png deleted file mode 100755 index 1c1b13e155ebc9b91840ae9786ba625511b780fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 142 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvy@dWsUxc>kDp8<^WH*U~fqTdG; zXD$iy3ua(qIj@`K3gqf}x;Tb#L?-a8!|AozvLE~*7d?1sFT6d)z4*}Q$iB}@VYN5 diff --git a/awesome/icons/info/batcharge.png b/awesome/icons/info/batcharge.png new file mode 100644 index 0000000000000000000000000000000000000000..ece4511df723c315874da7ca1829c9b5e15e2320 GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqEVM1`4!3?BBq$ zaM9%(Em7%=N{cqJw~9tIv@O`mwA4j8&?8P&Xlhs@qsjIP)}58FeuqysPXDJkQN!n@ zyWKGs|C|C>>3p6K2R58oEV(Oj-Q$j^y!nY=-)@i*4BvQ|wf2kCJ;&GbiNe`)43BDG z>gURjXt~GLJ|TU_@h6pT7K#0A&sHQzZ%P%6R1$p1tnVPc)pw@cd7uLsJYD@<);T3K F0RTZfO+x?x literal 0 HcmV?d00001 diff --git a/awesome/icons/info/batempty.png b/awesome/icons/info/batempty.png new file mode 100644 index 0000000000000000000000000000000000000000..0af7a1c6a5b3c2a0b99f9b1e7f143b500d5f4933 GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE;Ail>WXNX4AD=Qi>lG7xaMD1Jmv zQo-ARtEo%(MWoW_3%lJkgVdETC_QoBLG$1%Pz&$8tBOLzSl z*$*!iJw4p=aXz>6UT*HVtpz-6Vm2Gt|8{ymPY?R_jqTzouH)^FAy zqzYve9oNecrR#{N+r~bc_MTd*sWRAUzQ3>Mz*rwPi3pdKV zXgqY0ZMpdYmJp@?NgGc4EuVL0UxL&xCyiI9%@<$b-SC5_bc)oA2In8E=XSdMd%z@| W$A7*pdqNn{eg;ohKbLh*2~7Y{K0#vu literal 0 HcmV?d00001 diff --git a/awesome/icons/info/batlow.png b/awesome/icons/info/batlow.png new file mode 100644 index 0000000000000000000000000000000000000000..ef936fbc5554daed45598d12b61814cf7b0f83f7 GIT binary patch literal 156 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE;AvZsqqZGL1x1%TGLJvh?a;1eT@<9bjPsMZ-HoQYqX9)3PW78jlw(D6 z-DEhe_srwyKFJw8;rx$S(Tl-uH5=Lg7M%;x`u~98Qakq?tstF=K@cj95xbzdyUItHB KKbLh*2~7Zvr!~d^ literal 0 HcmV?d00001 diff --git a/awesome/icons/info/cpu.png b/awesome/icons/info/cpu.png new file mode 100644 index 0000000000000000000000000000000000000000..1a55bc058fa839d07b8c068de8027631a287132a GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE_)*gqx)nbFVvkMq##*2J`lWiQWNh+Y>D2TS;2D$9w+t_s@U-`-^wG`XV#TZUANW4&hr#F+Pg`n?7y9El_Z>$41wytpx;%ewk9$6w7aq;y)bYUB5v7B@}9aPGj(N^>bP0l+XkKs{2h9 literal 0 HcmV?d00001 diff --git a/awesome/icons/info/mem.png b/awesome/icons/info/mem.png new file mode 100644 index 0000000000000000000000000000000000000000..d0af32fb136ca5fcc0ce4c9641a3c02723edaa6a GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE;Ay{C&~NX4Aw1PRtJ496^Pq%{Av zxS`Ul#KzWkmxqVv{Q?uC-3>w0Cn~iwewi3^_`rb!1q{5#1`08&{JRbsgv&SxSvRP) zGtThX*eKC()?voNklZyu_q5yj)D>KMSo6p7 zd(6E(lf<-APwp#l+|3gyADts7dd-l}^r*g6gnCP?PSW9xb9pxK9EzJTPx!B>-;4*w zwtps0{ABHsEMs^`Pv!1&)iaCRv{(J`Hs9Rhe8$-{crRbwov>n!NefOa?lI6->i+oU n=8+xpWvg`*RqOYf-~7XzVJqcO)N$b<&<6~ju6{1-oD!MDuS6&V#1o0UZwj8eXY!J^AoQWld>VUZ7FkXc!jB9<$ud)=#UCeQSC-uFEH zPv;!|{F-K-vKe-1Lxqg85Pcld28#*n4YZ=VgD%EcrwNl1PBFm{K_t6Iy)u^HCJeB^ zCZ=~m4OJYoCQPG*TU;Y4;T(~1e&jTLD7hP2LpVI&U002ovPDHLkV1nJzU8ev5 literal 0 HcmV?d00001 diff --git a/awesome/icons/info/volmute.png b/awesome/icons/info/volmute.png new file mode 100644 index 0000000000000000000000000000000000000000..24e6cdee0c76b7fcfc18194b5948e9face73cd6b GIT binary patch literal 238 zcmV|Z>%uqlV z!RruEWq6OH1@W^#A|>07*qoM6N<$f(FK6B>(^b literal 0 HcmV?d00001 diff --git a/awesome/icons/mail.png b/awesome/icons/mail.png deleted file mode 100755 index 25021f5acb98fcf7668bb4325a5d022ae489f963..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyaTa()7Bet#3xhBt!>lcV%f&yE183-AeXT?GbDpFX{2c~cfB$XF8O7tG-B>_!@hljQC0!uX#_ z_a2a=;_2cT!V#UEpdeSUHi|*zW|%L-q&cgF9F%4%2(HWIez55X6T{|d?EdL-olAh~ O89ZJ6T-G@yGywp=fHI^2 diff --git a/awesome/icons/mem.png b/awesome/icons/mem.png deleted file mode 100755 index d04ee11f8e72a8b4d082282d8a37304d1ac88487..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 117 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyaR&H=xc&zLh6lIItt#iL0|l8% zg8YIR7#XMhT?gbzdb&788B|&sI&#hkoRzopr0EZ}8dH?_b diff --git a/awesome/icons/net_up.png b/awesome/icons/net_up.png deleted file mode 100755 index 395d0146c5ee8efcbbacfdd031862b4c78d7a484..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyv7|ftIx;Y9?C1WI$O_~$76-XI zF|0c$^AgBWNcITwWnidMV_;}#VPNdd>RN4Y$D0;d$hHzX@PEg?LXgC=la8TkEgG!_`^8=+5D#;v$Y)lLr z^_c#(?_hHVDpoCVjVMV;EJ?LWE=mPb3`PcqM!E*(x`yT<1_oA!rdGzL+6G2e1_q{q qw<=LI5{`Ss9xE5k!L`qsA4W1_n=8KbLh*2~7ahvR5wv diff --git a/awesome/icons/note.png b/awesome/icons/note.png deleted file mode 100755 index 2f41eb3e9b70d4373cbb1c86de58c2174b317f01..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAd3?%E9GuQzs&H|6fVg?3oVGw3ym^DWND9B#o z>FdgVmy=geQGI27nGsM(E5Ikj_5c6>hIqji7!aO+@fT1RZ%L3}FaskKGYcCBCpW*y zmtVmjQzil>7?Zr+T^Kr8Wj%l#Q%@Ji5RT~N1O?s#mRY_HMwRdH?QKYiYd4g%=sPr% wXSTo@U5;mAGxVPAo}TE#HzP5I=L!>p@&&%_TTFGEfd(*my85}Sb4q9e0GOXb6951J diff --git a/awesome/icons/note_on.png b/awesome/icons/note_on.png deleted file mode 100755 index 264d2c8c88b58869182cb423fa03cafa0711b8e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 342 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyv7|ftIx;Y9?C1WI$O_~$76-XI zF|0c$^AgBWNcITwWnidMV_;}#VPNdd>RN4Y$NP4v6XI!JQI+5{`Ss9xE5k!L`qsA4W1_n=8KbLh*2~7aT=~RjU diff --git a/awesome/icons/spkr.png b/awesome/icons/spkr.png deleted file mode 100755 index 80c20b0ba61e76c3ddb3d27f7992bcf96c86a557..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyv7|ftIx;Y9?C1WI$O_~$76-XI zF|0c$^AgBWNcITwWnidMV_;}#VPNdd>RN4Y$D0;d$hHzX@PEg?DXgJBhu5eI_;n4;*rHKiG9XcVZK*z8A z!gSq(i*puGv1*BHL`h0wNvc(HQ7VvPFfuSS(ls#GH8c+~Ft9Q-wK6uFfa|g qRf(b@H$NpatrDTZIK;rr%Gd;mAQ}`IHLd_PFnGH9xvX diff --git a/awesome/icons/svgs/batempty.svg b/awesome/icons/svgs/batempty.svg new file mode 100644 index 0000000..75c8e32 --- /dev/null +++ b/awesome/icons/svgs/batempty.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/batfull.svg b/awesome/icons/svgs/batfull.svg new file mode 100644 index 0000000..8f148ce --- /dev/null +++ b/awesome/icons/svgs/batfull.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/bathigh.svg b/awesome/icons/svgs/bathigh.svg new file mode 100644 index 0000000..dceb31f --- /dev/null +++ b/awesome/icons/svgs/bathigh.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/batlow.svg b/awesome/icons/svgs/batlow.svg new file mode 100644 index 0000000..d67f0f3 --- /dev/null +++ b/awesome/icons/svgs/batlow.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/batmid.svg b/awesome/icons/svgs/batmid.svg new file mode 100644 index 0000000..ee4a497 --- /dev/null +++ b/awesome/icons/svgs/batmid.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/cpu.svg b/awesome/icons/svgs/cpu.svg new file mode 100644 index 0000000..9c82de5 --- /dev/null +++ b/awesome/icons/svgs/cpu.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/download.svg b/awesome/icons/svgs/download.svg new file mode 100644 index 0000000..6829959 --- /dev/null +++ b/awesome/icons/svgs/download.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/mem.svg b/awesome/icons/svgs/mem.svg new file mode 100644 index 0000000..e15b96a --- /dev/null +++ b/awesome/icons/svgs/mem.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/svg_to_png.py b/awesome/icons/svgs/svg_to_png.py new file mode 100755 index 0000000..7ce9bc5 --- /dev/null +++ b/awesome/icons/svgs/svg_to_png.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import pathlib +from cairosvg import svg2png +from PIL import Image, ImageOps + +for svg in pathlib.Path('.').glob('*.svg'): + print(f'Converting {svg.name}...', end='') + png = svg.with_suffix('.png') + svg2png(url=str(svg), write_to=str(png), output_width=12, output_height=12) + with Image.open(png) as img: + img.load() + border_img = ImageOps.expand(img, 4, (0, 0, 0, 0)) + border_img.save(png) + print(' Done') diff --git a/awesome/icons/svgs/upload.svg b/awesome/icons/svgs/upload.svg new file mode 100644 index 0000000..44aa945 --- /dev/null +++ b/awesome/icons/svgs/upload.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/volhigh.svg b/awesome/icons/svgs/volhigh.svg new file mode 100644 index 0000000..ae0ff13 --- /dev/null +++ b/awesome/icons/svgs/volhigh.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/vollow.svg b/awesome/icons/svgs/vollow.svg new file mode 100644 index 0000000..59ecfbd --- /dev/null +++ b/awesome/icons/svgs/vollow.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/svgs/volmute.svg b/awesome/icons/svgs/volmute.svg new file mode 100644 index 0000000..9d5b8b8 --- /dev/null +++ b/awesome/icons/svgs/volmute.svg @@ -0,0 +1 @@ + diff --git a/awesome/icons/temp.png b/awesome/icons/temp.png deleted file mode 100755 index 6c8f8bdc07bdb6b2441135542d7322cf9d2a6ba7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAf3?x51|2hvyv7|ftIx;Y9?C1WI$O_~$76-XI zF|0c$^AgBWNcITwWnidMV_;}#VPNd^dIgBMie!&b5&u*lFI7!~_E=+0MH7OwF`EG8-K$-=NRj(V~ z0ST5BIHm(>88B|&sI&#hQ1Nte4B@z*oS?wP!P4O2CUEk^D~2TQCe|1Sm2QTnloEw= z4h*^djNA2JE-eD8S1oakC`m~yNwrEYN(E93Mh1pPx(4RDhUOs#23CfqR>r2<21Zr} t2Bv|xDp54#=BH$)RU$MPhZvYy8JhqRM1vxu#ucCj22WQ%mvv4FO#r(%SyTW3 diff --git a/awesome/theme.lua b/awesome/theme.lua index 2b0347f..8fe6ddf 100644 --- a/awesome/theme.lua +++ b/awesome/theme.lua @@ -54,20 +54,19 @@ theme.menu_fg_normal = '#aaaaaa' theme.menu_fg_focus = '#ff8c00' theme.menu_bg_normal = '#050505dd' theme.menu_bg_focus = '#050505dd' -theme.widget_temp = theme.confdir .. '/icons/temp.png' -theme.widget_uptime = theme.confdir .. '/icons/ac.png' -theme.widget_cpu = theme.confdir .. '/icons/cpu.png' -theme.widget_weather = theme.confdir .. '/icons/dish.png' -theme.widget_fs = theme.confdir .. '/icons/fs.png' -theme.widget_mem = theme.confdir .. '/icons/mem.png' -theme.widget_note = theme.confdir .. '/icons/note.png' -theme.widget_note_on = theme.confdir .. '/icons/note_on.png' -theme.widget_netdown = theme.confdir .. '/icons/net_down.png' -theme.widget_netup = theme.confdir .. '/icons/net_up.png' -theme.widget_mail = theme.confdir .. '/icons/mail.png' -theme.widget_batt = theme.confdir .. '/icons/bat.png' -theme.widget_clock = theme.confdir .. '/icons/clock.png' -theme.widget_vol = theme.confdir .. '/icons/spkr.png' +theme.widget_cpu = theme.confdir .. '/icons/info/cpu.png' +theme.widget_mem = theme.confdir .. '/icons/info/mem.png' +theme.widget_netdown = theme.confdir .. '/icons/info/download.png' +theme.widget_netup = theme.confdir .. '/icons/info/upload.png' +theme.widget_bat_charge = theme.confdir .. '/icons/info/batcharge.png' +theme.widget_bat_empty = theme.confdir .. '/icons/info/batempty.png' +theme.widget_bat_low = theme.confdir .. '/icons/info/batlow.png' +theme.widget_bat_mid = theme.confdir .. '/icons/info/batmid.png' +theme.widget_bat_high = theme.confdir .. '/icons/info/bathigh.png' +theme.widget_bat_full = theme.confdir .. '/icons/info/batfull.png' +theme.widget_vol_mute = theme.confdir .. '/icons/info/volmute.png' +theme.widget_vol_low = theme.confdir .. '/icons/info/vollow.png' +theme.widget_vol_high = theme.confdir .. '/icons/info/volhigh.png' theme.taglist_squares_sel = theme.confdir .. '/icons/square_a.png' theme.taglist_squares_unsel = theme.confdir .. '/icons/square_b.png' theme.tasklist_plain_task_name = true @@ -112,77 +111,65 @@ theme.tasklist_bg_minimize = '#4d4d4d' local markup = lain.util.markup --- Textclock -os.setlocale(os.getenv('LANG')) -- to localize the clock -local clockicon = wibox.widget.imagebox(theme.widget_clock) -local mytextclock = - wibox.widget.textclock(markup('#7788af', '%A %d %B ') .. markup('#ab7367', '>') .. markup('#de5e1e', ' %H:%M ')) -mytextclock.font = theme.font +local function build_widget_list(widgets) + local out = {} + local last_bg = 'alpha' --- Calendar -theme.cal = lain.widget.cal({ - attach_to = { mytextclock }, - notification_preset = { - font = 'Monospace 10', - fg = theme.fg_normal, - bg = theme.bg_normal, - }, -}) + for _, widget in pairs(widgets) do + table.insert(out, lain.util.separators.arrow_left(last_bg, widget.bg)) --- / fs -local fsicon = wibox.widget.imagebox(theme.widget_fs) -theme.fs = lain.widget.fs({ - notification_preset = { font = 'Monospace 10', fg = theme.fg_normal }, - settings = function() - -- luacheck: max line length 150, globals widget fs_now - widget:set_markup( - markup.fontfg( - theme.font, - '#80d9d8', - fs_now['/'].percentage - .. '% (' - .. string.format('%.3f', fs_now['/'].free) - .. ' ' - .. fs_now['/'].units - .. ' left)' - ) - ) - end, -}) -theme.fs.widget:buttons(gears.table.join(awful.button({}, 1, function() - awful.spawn('Thunar') -end))) + local bg_widget = wibox.widget.background(wibox.container.margin(widget.widget, 5, 5), widget.bg) + bg_widget.fg = '#111111' + table.insert(out, bg_widget) --- CPU -local cpuicon = wibox.widget.imagebox(theme.widget_cpu) -local cpu = lain.widget.cpu({ - settings = function() - -- luacheck: globals widget cpu_now - widget:set_markup(markup.fontfg(theme.font, '#e33a6e', cpu_now.usage .. '% ')) - end, -}) + last_bg = widget.bg + end -local optional = {} - --- Coretemp -if settings['show_temp'] == true then - local tempicon = wibox.widget.imagebox(theme.widget_temp) - local temp = lain.widget.temp({ - settings = function() - -- luacheck: globals widget coretemp_now - widget:set_markup(markup.fontfg(theme.font, '#f1af5f', coretemp_now .. '°C ')) - end, - }) - table.insert(optional, tempicon) - table.insert(optional, temp) + return out end --- Battery +local info_widgets = {} + +-- > Net +local netdowninfo = wibox.widget.textbox() +local netupinfo = lain.widget.net({ + settings = function() + -- luacheck: globals widget net_now + widget:set_text(net_now.sent) + netdowninfo:set_text(net_now.received) + end, +}) + +table.insert(info_widgets, { + widget = wibox.layout.fixed.horizontal(wibox.widget.imagebox(theme.widget_netdown), netdowninfo), + bg = '#87af5f' +}) +table.insert(info_widgets, { + widget = wibox.layout.fixed.horizontal(wibox.widget.imagebox(theme.widget_netup), netupinfo.widget), + bg = '#e54c62' +}) +-- < Net + +-- > Battery if settings['show_battery'] == true then - local baticon = wibox.widget.imagebox(theme.widget_batt) + local baticon = wibox.widget.imagebox(nil) local bat = lain.widget.bat({ settings = function() -- luacheck: globals widget bat_now + if bat_now.ac_status == 1 or bat_now.perc == 'N/A' then + baticon:set_image(theme.widget_bat_charge) + elseif bat_now.perc < 5 then + baticon:set_image(theme.widget_bat_empty) + elseif bat_now.perc < 15 then + baticon:set_image(theme.widget_bat_low) + elseif bat_now.perc < 50 then + baticon:set_image(theme.widget_bat_mid) + elseif bat_now.perc < 95 then + baticon:set_image(theme.widget_bat_high) + else + baticon:set_image(theme.widget_bat_full) + end + local perc = bat_now.perc ~= 'N/A' and bat_now.perc .. '%' or bat_now.perc if bat_now.ac_status == 1 then @@ -192,53 +179,126 @@ if settings['show_battery'] == true then widget:set_markup(markup.fontfg(theme.font, theme.fg_normal, perc .. ' ')) end, }) - table.insert(optional, baticon) - table.insert(optional, bat) + table.insert(info_widgets, { + widget = wibox.layout.fixed.horizontal(baticon, bat.widget), + bg = '#e54c62' + }) end +-- < Battery --- ALSA volume -local volicon = wibox.widget.imagebox(theme.widget_vol) -theme.volume = lain.widget.alsa({ +-- > ALSA volume +local volumeicon = wibox.widget.imagebox(nil) +local volume = lain.widget.alsa({ settings = function() -- luacheck: globals widget volume_now if volume_now.status == 'off' then - volume_now.level = volume_now.level .. 'M' + volumeicon:set_image(theme.widget_vol_mute) + volume_now.level = 'M ' .. volume_now.level + elseif volume_now.level == 0 then + volumeicon:set_image(theme.widget_vol_mute) + elseif volume_now.level <= 50 then + volumeicon:set_image(theme.widget_vol_low) + else + volumeicon:set_image(theme.widget_vol_high) end - widget:set_markup(markup.fontfg(theme.font, '#7493d2', volume_now.level .. '% ')) + widget:set_text(' ' .. volume_now.level .. '%') end, }) -theme.volume.widget:buttons(awful.util.table.join( + +local volumebuttons = awful.util.table.join( + awful.button({}, 1, function() -- left click + os.execute(string.format('%s set %s toggle', volume.cmd, volume.togglechannel or volume.channel)) + volume.update() + end), awful.button({}, 4, function() - os.execute(string.format('%s set %s 1%%+', theme.volume.cmd, theme.volume.channel)) - theme.volume.update() + os.execute(string.format('%s set %s 1%%+', volume.cmd, volume.channel)) + volume.update() end), awful.button({}, 5, function() - os.execute(string.format('%s set %s 1%%-', theme.volume.cmd, theme.volume.channel)) - theme.volume.update() + os.execute(string.format('%s set %s 1%%-', volume.cmd, volume.channel)) + volume.update() end) -)) +) --- Net -local netdownicon = wibox.widget.imagebox(theme.widget_netdown) -local netdowninfo = wibox.widget.textbox() -local netupicon = wibox.widget.imagebox(theme.widget_netup) -local netupinfo = lain.widget.net({ - settings = function() - -- luacheck: globals widget net_now - widget:set_markup(markup.fontfg(theme.font, '#e54c62', net_now.sent .. ' ')) - netdowninfo:set_markup(markup.fontfg(theme.font, '#87af5f', net_now.received .. ' ')) - end, +volume.widget:buttons(volumebuttons) +volumeicon:buttons(volumebuttons) + +table.insert(info_widgets, { + widget = wibox.layout.fixed.horizontal(volumeicon, volume.widget), + bg = '#7493d2' }) +-- < ALSA volume --- MEM -local memicon = wibox.widget.imagebox(theme.widget_mem) +-- > MEM local memory = lain.widget.mem({ settings = function() -- luacheck: globals widget mem_now - widget:set_markup(markup.fontfg(theme.font, '#e0da37', mem_now.used .. 'M ')) + widget:set_text(mem_now.used .. 'M') end, }) +table.insert(info_widgets, { + widget = wibox.layout.fixed.horizontal(wibox.widget.imagebox(theme.widget_mem), memory.widget), + bg = '#e0da37' +}) +-- < MEM + +-- > CPU +local cpu = lain.widget.cpu({ + settings = function() + -- luacheck: globals widget cpu_now + widget:set_markup(cpu_now.usage .. '%') + end, +}) +table.insert(info_widgets, { + widget = wibox.layout.fixed.horizontal(wibox.widget.imagebox(theme.widget_cpu), cpu.widget), + bg = '#e33a6e' +}) +-- < CPU + +-- > fs +local fs = lain.widget.fs({ + notification_preset = { font = 'Monospace 10', fg = theme.fg_normal }, + settings = function() + -- luacheck: max line length 150, globals widget fs_now + widget:set_text( + fs_now['/'].percentage + .. '% (' + .. string.format('%.3f', fs_now['/'].free) + .. ' ' + .. fs_now['/'].units + .. ' left)' + ) + end, +}) +fs.widget:buttons(gears.table.join(awful.button({}, 1, function() + awful.spawn('Thunar') +end))) +table.insert(info_widgets, { + widget = fs.widget, + bg = '#80d9d8' +}) +-- < fs + +-- > Textclock +os.setlocale(os.getenv('LANG')) -- to localize the clock +--local clockicon = wibox.widget.imagebox(theme.widget_clock) +local mytextclock = wibox.widget.textclock('%I:%M %a %d.%m') +mytextclock.font = theme.font + +lain.widget.cal({ + attach_to = { mytextclock }, + notification_preset = { + font = 'Monospace 10', + fg = theme.fg_normal, + bg = theme.bg_normal, + }, +}) +table.insert(info_widgets, { + widget = mytextclock, + bg = '#7788af' +}) +-- < Textclock -- MPD --[[ @@ -271,6 +331,8 @@ theme.mpd = lain.widget.mpd({ ]] -- +local final_info_widgets = build_widget_list(info_widgets) + function theme.at_screen_connect(s) -- Quake application s.quake = lain.util.quake({ app = awful.util.terminal }) @@ -338,7 +400,7 @@ function theme.at_screen_connect(s) widget = wibox.container.background, }, }) - s.mytasklist = wibox.container.margin(s.mytasklist, 20, 20, 1, 1) + s.mytasklist = wibox.container.margin(s.mytasklist, 10, 10, 0, 0) -- Create the wibox s.mywibox = @@ -360,39 +422,9 @@ function theme.at_screen_connect(s) gears.table.join( { -- Right widgets layout = wibox.layout.fixed.horizontal, - wibox.widget.systray(), - --mailicon, - --theme.mail.widget, - { - { - { - layout = wibox.layout.fixed.horizontal, - netdownicon, - netdowninfo, - netupicon, - netupinfo.widget, - }, - halign = 'right', - widget = wibox.container.place, - }, - width = 120, - strategy = 'exact', - layout = wibox.layout.constraint, - }, - volicon, - theme.volume.widget, - memicon, - memory.widget, - cpuicon, - cpu.widget, - fsicon, - theme.fs.widget, + wibox.container.margin(wibox.widget.systray(), 0, 5) }, - optional, - { - clockicon, - mytextclock, - } + final_info_widgets ), }) end