From 0c1f3240731038cdfd9abc6426e20c7015bd0096 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sun, 23 Aug 2020 10:04:11 +0200 Subject: [PATCH] Remove awesome --- .gitmodules | 3 - home/.config/awesome/icons/bat.png | Bin 130 -> 0 bytes .../awesome/icons/bluetooth-active.png | Bin 141 -> 0 bytes home/.config/awesome/icons/bluetooth-off.png | Bin 141 -> 0 bytes home/.config/awesome/icons/bluetooth-on.png | Bin 141 -> 0 bytes home/.config/awesome/icons/cpu.png | Bin 136 -> 0 bytes home/.config/awesome/icons/down.png | Bin 137 -> 0 bytes .../awesome/icons/layouts/cornerne.png | Bin 129 -> 0 bytes .../awesome/icons/layouts/cornernw.png | Bin 130 -> 0 bytes .../awesome/icons/layouts/cornerse.png | Bin 129 -> 0 bytes .../awesome/icons/layouts/cornersw.png | Bin 130 -> 0 bytes .../.config/awesome/icons/layouts/dwindle.png | Bin 128 -> 0 bytes home/.config/awesome/icons/layouts/fairh.png | Bin 121 -> 0 bytes home/.config/awesome/icons/layouts/fairv.png | Bin 121 -> 0 bytes .../awesome/icons/layouts/floating.png | Bin 129 -> 0 bytes .../awesome/icons/layouts/fullscreen.png | Bin 153 -> 0 bytes .../awesome/icons/layouts/magnifier.png | Bin 136 -> 0 bytes home/.config/awesome/icons/layouts/max.png | Bin 156 -> 0 bytes home/.config/awesome/icons/layouts/spiral.png | Bin 130 -> 0 bytes home/.config/awesome/icons/layouts/tile.png | Bin 125 -> 0 bytes .../awesome/icons/layouts/tilebottom.png | Bin 125 -> 0 bytes .../awesome/icons/layouts/tileleft.png | Bin 125 -> 0 bytes .../.config/awesome/icons/layouts/tiletop.png | Bin 127 -> 0 bytes home/.config/awesome/icons/mem.png | Bin 123 -> 0 bytes .../awesome/icons/notifications-off.png | Bin 122 -> 0 bytes .../awesome/icons/notifications-on.png | Bin 122 -> 0 bytes home/.config/awesome/icons/redshift-off.png | Bin 133 -> 0 bytes home/.config/awesome/icons/redshift-on.png | Bin 133 -> 0 bytes home/.config/awesome/icons/tags/1.png | Bin 117 -> 0 bytes home/.config/awesome/icons/tags/2.png | Bin 122 -> 0 bytes home/.config/awesome/icons/tags/3.png | Bin 126 -> 0 bytes home/.config/awesome/icons/tags/4.png | Bin 137 -> 0 bytes home/.config/awesome/icons/tags/5.png | Bin 139 -> 0 bytes home/.config/awesome/icons/tags/6.png | Bin 134 -> 0 bytes home/.config/awesome/icons/tags/7.png | Bin 130 -> 0 bytes home/.config/awesome/icons/tags/8.png | Bin 134 -> 0 bytes home/.config/awesome/icons/tags/9.png | Bin 134 -> 0 bytes home/.config/awesome/icons/tearstop-off.png | Bin 128 -> 0 bytes home/.config/awesome/icons/tearstop-on.png | Bin 128 -> 0 bytes home/.config/awesome/icons/temp.png | Bin 137 -> 0 bytes home/.config/awesome/icons/up.png | Bin 139 -> 0 bytes home/.config/awesome/icons/vpn.png | Bin 128 -> 0 bytes home/.config/awesome/lain | 1 - home/.config/awesome/rc.lua | 540 ------------------ home/.config/awesome/theme.lua | 93 --- home/.config/awesome/utils.lua | 21 - home/.config/awesome/widgets.lua | 230 -------- 47 files changed, 888 deletions(-) delete mode 100644 home/.config/awesome/icons/bat.png delete mode 100644 home/.config/awesome/icons/bluetooth-active.png delete mode 100644 home/.config/awesome/icons/bluetooth-off.png delete mode 100644 home/.config/awesome/icons/bluetooth-on.png delete mode 100644 home/.config/awesome/icons/cpu.png delete mode 100644 home/.config/awesome/icons/down.png delete mode 100644 home/.config/awesome/icons/layouts/cornerne.png delete mode 100644 home/.config/awesome/icons/layouts/cornernw.png delete mode 100644 home/.config/awesome/icons/layouts/cornerse.png delete mode 100644 home/.config/awesome/icons/layouts/cornersw.png delete mode 100644 home/.config/awesome/icons/layouts/dwindle.png delete mode 100644 home/.config/awesome/icons/layouts/fairh.png delete mode 100644 home/.config/awesome/icons/layouts/fairv.png delete mode 100644 home/.config/awesome/icons/layouts/floating.png delete mode 100644 home/.config/awesome/icons/layouts/fullscreen.png delete mode 100644 home/.config/awesome/icons/layouts/magnifier.png delete mode 100644 home/.config/awesome/icons/layouts/max.png delete mode 100644 home/.config/awesome/icons/layouts/spiral.png delete mode 100644 home/.config/awesome/icons/layouts/tile.png delete mode 100644 home/.config/awesome/icons/layouts/tilebottom.png delete mode 100644 home/.config/awesome/icons/layouts/tileleft.png delete mode 100644 home/.config/awesome/icons/layouts/tiletop.png delete mode 100644 home/.config/awesome/icons/mem.png delete mode 100644 home/.config/awesome/icons/notifications-off.png delete mode 100644 home/.config/awesome/icons/notifications-on.png delete mode 100644 home/.config/awesome/icons/redshift-off.png delete mode 100644 home/.config/awesome/icons/redshift-on.png delete mode 100644 home/.config/awesome/icons/tags/1.png delete mode 100644 home/.config/awesome/icons/tags/2.png delete mode 100644 home/.config/awesome/icons/tags/3.png delete mode 100644 home/.config/awesome/icons/tags/4.png delete mode 100644 home/.config/awesome/icons/tags/5.png delete mode 100644 home/.config/awesome/icons/tags/6.png delete mode 100644 home/.config/awesome/icons/tags/7.png delete mode 100644 home/.config/awesome/icons/tags/8.png delete mode 100644 home/.config/awesome/icons/tags/9.png delete mode 100644 home/.config/awesome/icons/tearstop-off.png delete mode 100644 home/.config/awesome/icons/tearstop-on.png delete mode 100644 home/.config/awesome/icons/temp.png delete mode 100644 home/.config/awesome/icons/up.png delete mode 100644 home/.config/awesome/icons/vpn.png delete mode 160000 home/.config/awesome/lain delete mode 100644 home/.config/awesome/rc.lua delete mode 100644 home/.config/awesome/theme.lua delete mode 100644 home/.config/awesome/utils.lua delete mode 100644 home/.config/awesome/widgets.lua diff --git a/.gitmodules b/.gitmodules index 2077c3d..cc13bb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "mpv-gallery-view"] path = mpv-gallery-view url = https://github.com/occivink/mpv-gallery-view -[submodule "home/.config/awesome/lain"] - path = home/.config/awesome/lain - url = https://github.com/lcpz/lain [submodule "vim-plug"] path = vim-plug url = https://github.com/junegunn/vim-plug diff --git a/home/.config/awesome/icons/bat.png b/home/.config/awesome/icons/bat.png deleted file mode 100644 index 37cb586c2ecd1efdf48aee5136878bbba078742a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CHqKT^vI=t|uoPV0uz-V8BseV9>GO@u-5~1Q{^~hUc%? VvfE1!UH~d&@O1TaS?83{1OROEA6)#jSQ6wH z%;50sMjD8dYDVd#)IFfhnXNJwByI>s(wr#$8S g7lu{K7+uvFY<_c`b+#+60_tJ#boFyt=akR{0GLK08vpfq_AN!-W$$6J$Ji br5G3_*Rr3N?0cjERLgTe~DWM4fEO{Ua diff --git a/home/.config/awesome/icons/down.png b/home/.config/awesome/icons/down.png deleted file mode 100644 index cac06732342857bfc9a858e99c5bd9a9608d1b7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuT$?!-j@H>#jSQ6wH z%;50sMjD8d5&LJDg;` dQDVTrAby5@(T$@5tAOemJYD@<);T3K0RVQ|A~XO1 diff --git a/home/.config/awesome/icons/layouts/cornerne.png b/home/.config/awesome/icons/layouts/cornerne.png deleted file mode 100644 index 76d3d89ad50b6465370db211688e5b2f03298553..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CHqJT^vI=t|uojG@bg-t1&~c>*CSG1)nOJx!9N(?kY<; U9$9V(RK~#I>FVdQ&MBb@09-L1kpKVy diff --git a/home/.config/awesome/icons/layouts/cornernw.png b/home/.config/awesome/icons/layouts/cornernw.png deleted file mode 100644 index eb114d856a1242fa988607cd7e8184966c726b74..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CHqKT^vI=t|uojH2r$cyW$5UGt1)6!w#wwdV3lf7`DHc V%)iXL?h;TTgQu&X%Q~loCIFtHAoTzM diff --git a/home/.config/awesome/icons/layouts/cornerse.png b/home/.config/awesome/icons/layouts/cornerse.png deleted file mode 100644 index 737e8477a86293c8d338b4fb42a56034b61ec4e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CHqJT^vI=t|uojG@W|Rt0BRr_1}C!f}4h$I6D(Vv$B+< TQ-Es^P#uG(tDnm{r-UW|5Y8L! diff --git a/home/.config/awesome/icons/layouts/cornersw.png b/home/.config/awesome/icons/layouts/cornersw.png deleted file mode 100644 index e96ad8adcd46b69df74bd440a0fa448fe7a51cfc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CHqKT^vI=t|uojG@W|Rt0BSmsxe38PXlAq#UqUj42AP0 V^H+-r_yZL(c)I$ztaD0e0swc|9}fTk diff --git a/home/.config/awesome/icons/layouts/dwindle.png b/home/.config/awesome/icons/layouts/dwindle.png deleted file mode 100644 index cff218658038f6b5c7e5469d85334abbac46176e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CJ=~T^vI=t|uojH2wO^+fv9JaQ7Y?%f03Y%!~}@wn|Mk T2;H{=sEonW)z4*}Q$iB}Rv;h5 diff --git a/home/.config/awesome/icons/layouts/fairh.png b/home/.config/awesome/icons/layouts/fairh.png deleted file mode 100644 index 2262f84aa09ce7139bdb876c548c9d38f6627212..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 121 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CGe;T^vI=t|uojG@W|RYhlPE5Wvi^QCP|`bO!S@pge=8 LtDnm{r-UW|Dqk6e diff --git a/home/.config/awesome/icons/layouts/fairv.png b/home/.config/awesome/icons/layouts/fairv.png deleted file mode 100644 index b8e8c513e100375175a9b4eea53e4e648f274ea6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 121 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CGe;T^vI=t|uojG*$g(6X9W2>0oA%_{H~9v|^?XP@cil L)z4*}Q$iB}Eo&L_ diff --git a/home/.config/awesome/icons/layouts/floating.png b/home/.config/awesome/icons/layouts/floating.png deleted file mode 100644 index a2d9cb8810dd3c52cef229987f8c6b3a5c22d3de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CHqJT^vI=t|uojH2soi`S702AT1#;A>m(tXCnhcgo*gB U=L>Fp1*&84boFyt=akR{0CqDVzyJUM diff --git a/home/.config/awesome/icons/layouts/fullscreen.png b/home/.config/awesome/icons/layouts/fullscreen.png deleted file mode 100644 index 6a2280cd4f88ea379712cc01db36e5b04994c1f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CG$`T^vI=t|uojH2wO|%hSg%B{9d|#9+t&jD!#WFCP&2 tzn)R2ug5V-!E%Dsgs2H}6D$N67!)I9vyY~!y#nfI@O1TaS?83{1ON~ODB=JB diff --git a/home/.config/awesome/icons/layouts/magnifier.png b/home/.config/awesome/icons/layouts/magnifier.png deleted file mode 100644 index b2beb68d2bffeb256e855796c38bd856967c7aba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuUGR-SAwGzl;ED7=p zW^j0RBMrn!@^*J&=wOxg0CJQ)T^vI=t|uojG*$g(Gw@4jdGKXE$C-c4j6D;NCcH}c a)c~|;qUi21prq diff --git a/home/.config/awesome/icons/mem.png b/home/.config/awesome/icons/mem.png deleted file mode 100644 index e624b8f9dad1dbc33d5d8e521cb8db7aac4ad1e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 123 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0EsW$#jSQ6wH z%;50sMjDW#u6{1-oD!Mu6{1-oD!M8SQfvV}A+B8+q0LjKEqFiiHc*7I zB*-tA!Qt7BG!Q4r+uensgH_f8$Pw^#aSY**O;%vr@IOC6fq}tzHe8SQfvV}A+A8WdCD}e(9}vGi?Jlg zFPOpM*^M+1C&}C0g`tC0)&s~9^>lFz;kcfhaDZ{ff8z%%Z~jYPXl3x6#njpOr(6f9 OfWgz%&t;ucLK6U2XCMOr diff --git a/home/.config/awesome/icons/tags/3.png b/home/.config/awesome/icons/tags/3.png deleted file mode 100644 index 2ed1fc9256d9d19be92645c52cf4c076159be6db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^Vn8g!$P6S?U+>8SQfvV}A+8FVdQ&MBb@0D4Iy@c;k- diff --git a/home/.config/awesome/icons/tags/4.png b/home/.config/awesome/icons/tags/4.png deleted file mode 100644 index 92951fdcb878bfec2ea9a0345546286d192e995b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^Vn8g!$P6S?U+>8SQfvV}A+A8WdCD}e(9}vGi?Jlg zFPOpM*^M+1C&}C0g`tC0)&s~<@pN$v;kcfhaDeH?e{+Kk6$%ge6yD_|B&0K6;t}8p dV_ve5fk8)ybFp||)B~V;22WQ%mvv4FO#m*UBM<-p diff --git a/home/.config/awesome/icons/tags/5.png b/home/.config/awesome/icons/tags/5.png deleted file mode 100644 index 73054a544c852b59302ad072205b22a35da77005..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^Vn8g!$P6S?U+>8SQfvV}A+CbYLYt>dyE&tB1yF>s zB*-tA!Qt7BG!Q4r+uensgH_f8$WiljaSY+Oo}6%iX~utMPF4-SgoK1Y>`Ue@_#q%* iZfLOKf4;*tCWcinSw9r^mL&ppFnGH9xvX8SQfvV}A+G25g*H!__VawhU!VwM zNswPKgTu2MX&_FLx4R2N2dk_HkfZ47;uyklJvre3n~1`UzxB*5_n8j%_z0Xi!f{ZC chu1)sp(vL*-sy(HEudlsPgg&ebxsLQ0R6Tl&;S4c diff --git a/home/.config/awesome/icons/tags/7.png b/home/.config/awesome/icons/tags/7.png deleted file mode 100644 index f55652428a17019789e3f6871da1c43eede62c5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^Vn8g!$P6S?U+>8SQfvV}A+Cp2!8SQfvV}A+CvDVa-#fmEKq>02E;? z3GxeOaCmkj4a78SQfvV}A+GBSLz|~en^pH=El`B9 zB*-tA!Qt7BG!Q4r+uensgH_f8$WiokaSY+Oo}A#o&c|`)AG^nHg@FVdQ&MBb@0DqDr*Z=?k diff --git a/home/.config/awesome/icons/tearstop-off.png b/home/.config/awesome/icons/tearstop-off.png deleted file mode 100644 index 2ca36eadc4786da2834c60f8b73d7edf4e252256..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0Dfpq@Nxtvl+-@ED7=p zW^j0RBMrn!@^*J&=wOxg0CJ=~T^vI=t|uoPV0!Z3(7bP0l+XkKB+4F) diff --git a/home/.config/awesome/icons/tearstop-on.png b/home/.config/awesome/icons/tearstop-on.png deleted file mode 100644 index 709da04c795173334910ed78d9ee3ae38ceb62cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0AuT$?!-j@H>#jSQ6wH z%;50sMjD8dgTe~DWM4fR3jfI diff --git a/home/.config/awesome/icons/temp.png b/home/.config/awesome/icons/temp.png deleted file mode 100644 index bdeedd962ce911ce04c4b9dd4cbe3a31dacf4172..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0Dfy*0g}h@jj5nSQ6wH z%;50sMjD8dFVdQ&MBb@01lZS+5i9m diff --git a/home/.config/awesome/icons/up.png b/home/.config/awesome/icons/up.png deleted file mode 100644 index 07ebf0eb6ea76ab9c9709025c614b7222dc18cae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E0Dfpq@Nxtvl+-@ED7=p zW^j0RBMrn!@^*J&=wOxg0CLnkT^vI=t|uoPVB<3|FtAHVNceZ)z=40wjg9~LnVbLE ebI7-BWMJT1!M^BYRIfi!2ZN`ppUXO@geCyAjw7r9 diff --git a/home/.config/awesome/icons/vpn.png b/home/.config/awesome/icons/vpn.png deleted file mode 100644 index ee285ff985c495ed30f2bb867ddcd475d43056ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zTYyi9E09*}zNE=p_!P)uED7=p zW^j0RBMrn!@^*J&=wOxg0CJ=~T^vI=t|uorFrSf^keI=uFylYJ&^E`Xiy0aIJFqWR T>N)lpsEonW)z4*}Q$iB}5;h)4 diff --git a/home/.config/awesome/lain b/home/.config/awesome/lain deleted file mode 160000 index e0bffc0..0000000 --- a/home/.config/awesome/lain +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e0bffc00566fbc0c05dc01700c569a589a6900eb diff --git a/home/.config/awesome/rc.lua b/home/.config/awesome/rc.lua deleted file mode 100644 index df869b5..0000000 --- a/home/.config/awesome/rc.lua +++ /dev/null @@ -1,540 +0,0 @@ --- Standard awesome library -local gears = require("gears") -local awful = require("awful") -require("awful.autofocus") --- Widget and layout library -local wibox = require("wibox") --- Theme handling library -local beautiful = require("beautiful") --- Notification library -local naughty = require("naughty") -local menubar = require("menubar") -local hotkeys_popup = require("awful.hotkeys_popup").widget --- Enable hotkeys help widget for VIM and other apps --- when client with a matching name is opened: -require("awful.hotkeys_popup.keys") - -local lain = require("lain") -local helpers = require("lain.helpers") - -local widgets = require("widgets") - --- {{{ Error handling --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = tostring(err) }) - in_error = false - end) -end --- }}} - --- {{{ Variable definitions --- Themes define colours, icons, font and wallpapers. -beautiful.init(gears.filesystem.get_configuration_dir() .. "theme.lua") - --- Default shell -awful.util.shell = "/bin/zsh" - --- This is used later as the default terminal and editor to run. -terminal = os.getenv("HOME") .. "/bin/alacritty" -if not(helpers.file_exists(terminal)) then - terminal = "urxvt" -end -editor = os.getenv("EDITOR") or "editor" -editor_cmd = terminal .. " -e " .. editor - --- Default modkey. --- Usually, Mod4 is the key with a logo between Control and Alt. --- If you do not like this or do not have such a key, --- I suggest you to remap Mod4 to another key using xmodmap or other tools. --- However, you can use another modifier like Mod1, but it may interact with others. -modkey = "Mod4" - --- Table of layouts to cover with awful.layout.inc, order matters. -awful.layout.layouts = { - awful.layout.suit.tile, - awful.layout.suit.tile.left, - awful.layout.suit.tile.bottom, - awful.layout.suit.tile.top, - awful.layout.suit.fair, - awful.layout.suit.fair.horizontal, - awful.layout.suit.max, - -- awful.layout.suit.spiral, - -- awful.layout.suit.spiral.dwindle, - -- awful.layout.suit.max.fullscreen, - -- awful.layout.suit.magnifier, - -- awful.layout.suit.corner.nw, - -- awful.layout.suit.corner.ne, - -- awful.layout.suit.corner.sw, - -- awful.layout.suit.corner.se, - -- awful.layout.suit.floating, -} --- }}} - --- {{{ Helper functions -local function client_menu_toggle_fn() - local instance = nil - - return function () - if instance and instance.wibox.visible then - instance:hide() - instance = nil - else - instance = awful.menu.clients({ theme = { width = 250 } }) - end - end -end --- }}} - --- {{{ Menu --- Menubar configuration -menubar.utils.terminal = terminal -- Set the terminal for applications that require it --- }}} - --- {{{ Wibar --- Create a textclock widget -mytextclock = wibox.widget.textclock() - --- Create calendar and attach it to textclock -mycal = widgets.cal -mycal.attach(mytextclock) - --- Create a wibox for each screen and add it -local taglist_buttons = gears.table.join( - awful.button({ }, 1, function(t) t:view_only() end), - awful.button({ modkey }, 1, function(t) - if client.focus then - client.focus:move_to_tag(t) - end - end), - awful.button({ }, 3, awful.tag.viewtoggle), - awful.button({ modkey }, 3, function(t) - if client.focus then - client.focus:toggle_tag(t) - end - end), - awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), - awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) - ) - -local tasklist_buttons = gears.table.join( - awful.button({ }, 1, function (c) - if c == client.focus then - c.minimized = true - else - -- Without this, the following - -- :isvisible() makes no sense - c.minimized = false - if not c:isvisible() and c.first_tag then - c.first_tag:view_only() - end - -- This will also un-minimize - -- the client, if needed - client.focus = c - c:raise() - end - end), - awful.button({ }, 3, client_menu_toggle_fn()), - awful.button({ }, 4, function () - awful.client.focus.byidx(1) - end), - awful.button({ }, 5, function () - awful.client.focus.byidx(-1) - end)) - -local function set_wallpaper(s) - -- Wallpaper - if beautiful.wallpaper then - local wallpaper = beautiful.wallpaper - -- If wallpaper is a function, call it with the screen - if type(wallpaper) == "function" then - wallpaper = wallpaper(s) - end - gears.wallpaper.maximized(wallpaper, s, true) - end -end - --- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) -screen.connect_signal("property::geometry", set_wallpaper) - -awful.screen.connect_for_each_screen(function(s) - -- Wallpaper - set_wallpaper(s) - - -- Each screen has its own tag table. - awful.tag({ "一", "二", "三", "四", "五", "六", "七", "八", "九" }, s, awful.layout.layouts[1]) - - -- Create a promptbox for each screen - s.mypromptbox = awful.widget.prompt() - -- Create an imagebox widget which will contain an icon indicating which layout we're using. - -- We need one layoutbox per screen. - s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(gears.table.join( - awful.button({ }, 1, function () awful.layout.inc( 1) end), - awful.button({ }, 3, function () awful.layout.inc(-1) end), - awful.button({ }, 4, function () awful.layout.inc( 1) end), - awful.button({ }, 5, function () awful.layout.inc(-1) end))) - -- Create a taglist widget - s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons) - - -- Create a tasklist widget - s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons) - - -- Create the wibox - s.mywibox = awful.wibar({ position = "top", screen = s }) - - -- Add widgets to the wibox - s.mywibox:setup { - layout = wibox.layout.align.horizontal, - { -- Left widgets - layout = wibox.layout.fixed.horizontal, - s.mytaglist, - s.mypromptbox, - }, - s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - wibox.widget.systray(), - widgets.notifications, - widgets.tearstop, - widgets.redshift, - widgets.bluetooth, - widgets.vpn.icon, - widgets.vpn.widget, - widgets.netdown_icon, - widgets.netdown.widget, - widgets.netup_icon, - widgets.netup.widget, - widgets.mem_icon, - widgets.mem.widget, - widgets.cpu_icon, - widgets.cpu.widget, - widgets.temp_icon, - widgets.temp.widget, - widgets.bat_icon, - widgets.bat.widget, - mytextclock, - s.mylayoutbox, - }, - } -end) --- }}} - --- {{{ Mouse bindings -root.buttons(gears.table.join( - awful.button({ }, 4, awful.tag.viewnext), - awful.button({ }, 5, awful.tag.viewprev) -)) --- }}} - --- {{{ Key bindings -globalkeys = gears.table.join( - awful.key({ modkey, }, "s", hotkeys_popup.show_help, - {description="show help", group="awesome"}), - awful.key({ modkey, }, "Left", awful.tag.viewprev, - {description = "view previous", group = "tag"}), - awful.key({ modkey, }, "Right", awful.tag.viewnext, - {description = "view next", group = "tag"}), - awful.key({ modkey, }, "Escape", awful.tag.history.restore, - {description = "go back", group = "tag"}), - - awful.key({ modkey, }, "j", - function () - awful.client.focus.byidx( 1) - end, - {description = "focus next by index", group = "client"} - ), - awful.key({ modkey, }, "k", - function () - awful.client.focus.byidx(-1) - end, - {description = "focus previous by index", group = "client"} - ), - -- Layout manipulation - awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, - {description = "swap with next client by index", group = "client"}), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, - {description = "swap with previous client by index", group = "client"}), - awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, - {description = "focus the next screen", group = "screen"}), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, - {description = "focus the previous screen", group = "screen"}), - awful.key({ modkey, }, "u", awful.client.urgent.jumpto, - {description = "jump to urgent client", group = "client"}), - awful.key({ modkey, }, "Tab", - function () - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end - end, - {description = "go back", group = "client"}), - - -- Standard program - awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, - {description = "open a terminal", group = "launcher"}), - awful.key({ modkey, "Control" }, "r", awesome.restart, - {description = "reload awesome", group = "awesome"}), - awful.key({ modkey, "Shift" }, "q", awesome.quit, - {description = "quit awesome", group = "awesome"}), - - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, - {description = "increase master width factor", group = "layout"}), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, - {description = "decrease master width factor", group = "layout"}), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, - {description = "increase the number of master clients", group = "layout"}), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, - {description = "decrease the number of master clients", group = "layout"}), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, - {description = "increase the number of columns", group = "layout"}), - awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, - {description = "decrease the number of columns", group = "layout"}), - awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, - {description = "select next", group = "layout"}), - awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, - {description = "select previous", group = "layout"}), - - awful.key({ modkey, "Control" }, "n", - function () - local c = awful.client.restore() - -- Focus restored client - if c then - client.focus = c - c:raise() - end - end, - {description = "restore minimized", group = "client"}), - - -- Prompt - awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, - {description = "run prompt", group = "launcher"}), - - awful.key({ modkey }, "x", - function () - awful.prompt.run { - prompt = "Run Lua code: ", - textbox = awful.screen.focused().mypromptbox.widget, - exe_callback = awful.util.eval, - history_path = awful.util.get_cache_dir() .. "/history_eval" - } - end, - {description = "lua execute prompt", group = "awesome"}), - -- Menubar - awful.key({ modkey }, "p", function() menubar.show() end, - {description = "show the menubar", group = "launcher"}), - -- Lock screen - awful.key({ modkey }, "y", function() awful.util.spawn({ "/usr/local/bin/lock" }) end, - {description = "lock the screen", group = "awesome"}) -) - -clientkeys = gears.table.join( - awful.key({ modkey, }, "f", - function (c) - c.fullscreen = not c.fullscreen - c:raise() - end, - {description = "toggle fullscreen", group = "client"}), - awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, - {description = "close", group = "client"}), - awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , - {description = "toggle floating", group = "client"}), - awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, - {description = "move to master", group = "client"}), - awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, - {description = "move to screen", group = "client"}), - awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, - {description = "toggle keep on top", group = "client"}), - awful.key({ modkey, }, "n", - function (c) - -- The client currently has the input focus, so it cannot be - -- minimized, since minimized clients can't have the focus. - c.minimized = true - end , - {description = "minimize", group = "client"}), - awful.key({ modkey, }, "m", - function (c) - c.maximized = not c.maximized - c:raise() - end , - {description = "(un)maximize", group = "client"}), - awful.key({ modkey, "Control" }, "m", - function (c) - c.maximized_vertical = not c.maximized_vertical - c:raise() - end , - {description = "(un)maximize vertically", group = "client"}), - awful.key({ modkey, "Shift" }, "m", - function (c) - c.maximized_horizontal = not c.maximized_horizontal - c:raise() - end , - {description = "(un)maximize horizontally", group = "client"}), - - -- Special „multimedia“ keys - awful.key({}, "XF86MonBrightnessUp", function() awful.util.spawn({"xbacklight", "-inc", "10"}) end), - awful.key({}, "XF86MonBrightnessDown", function() awful.util.spawn({"xbacklight", "-dec", "10"}) end), - - awful.key({}, "XF86AudioMute", function() awful.util.spawn_with_shell("pactl set-sink-mute $(pacmd dump|grep -E '^set-default-sink'|cut -d' ' -f2) toggle") end), - awful.key({}, "XF86AudioMicMute", function() awful.util.spawn_with_shell("pactl set-source-mute $(pacmd dump|grep -E '^set-default-source'|cut -d' ' -f2) toggle") end), - - awful.key({}, "XF86Display", function() awful.util.spawn({"autorandr", "-c"}) end) -) - --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it work on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, 9 do - globalkeys = gears.table.join(globalkeys, - -- View tag only. - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - tag:view_only() - end - end, - {description = "view tag #"..i, group = "tag"}), - -- Toggle tag display. - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - awful.tag.viewtoggle(tag) - end - end, - {description = "toggle tag #" .. i, group = "tag"}), - -- Move client to tag. - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:move_to_tag(tag) - end - end - end, - {description = "move focused client to tag #"..i, group = "tag"}), - -- Toggle tag on focused client. - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:toggle_tag(tag) - end - end - end, - {description = "toggle focused client on tag #" .. i, group = "tag"}) - ) -end - -clientbuttons = gears.table.join( - awful.button({ }, 1, function (c) client.focus = c; c:raise() end), - awful.button({ modkey }, 1, awful.mouse.client.move), - awful.button({ modkey }, 3, awful.mouse.client.resize)) - --- Set keys -root.keys(globalkeys) --- }}} - --- {{{ Rules --- Rules to apply to new clients (through the "manage" signal). -awful.rules.rules = { - -- All clients will match this rule. - { rule = { }, - properties = { border_width = beautiful.border_width, - border_color = beautiful.border_normal, - focus = awful.client.focus.filter, - raise = true, - keys = clientkeys, - buttons = clientbuttons, - screen = awful.screen.preferred, - placement = awful.placement.no_overlap+awful.placement.no_offscreen - } - }, - - -- Floating clients. - { rule_any = { - class = { - "pinentry", - }, - role = { - "pop-up", - } - }, properties = { floating = true }}, - - -- Use full space for urxvt - { rule = { class = "URxvt" }, - properties = { size_hints_honor = false } }, - - -- Default tags - { properties = { tag = "二" }, rule = { class = "Chromium" } }, - { properties = { tag = "二" }, rule = { class = "Firefox" } }, - { properties = { tag = "三" }, rule = { class = "Claws-mail" } }, - { properties = { tag = "三" }, rule = { class = "Mumble" } }, - { properties = { tag = "四" }, rule = { class = "Evince" } }, - { properties = { tag = "四" }, rule = { class = "Gnome-calendar" } }, - { properties = { tag = "四" }, rule = { class = "Gnome-contact" } }, - { properties = { tag = "四" }, rule = { class = "Gscan2pdf" } }, - { properties = { tag = "四" }, rule = { class = "libreoffice" } }, - { properties = { tag = "四" }, rule = { name = "org.pwmt.zathura" } }, - { properties = { tag = "五" }, rule = { class = "Audacious" } }, - { properties = { tag = "五" }, rule = { class = "Pavucontrol" } }, - { properties = { tag = "八" }, rule = { class = "Darktable" } }, - { properties = { tag = "八" }, rule = { class = "Gimp" } }, - { properties = { tag = "八" }, rule = { class = "Inkscape" } }, -} --- }}} - --- {{{ Signals --- Signal function to execute when a new client appears. -client.connect_signal("manage", function (c) - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- if not awesome.startup then awful.client.setslave(c) end - - if awesome.startup and - not c.size_hints.user_position - and not c.size_hints.program_position then - -- Prevent clients from being unreachable after screen count changes. - awful.placement.no_offscreen(c) - end -end) - --- Enable sloppy focus, so that focus follows mouse. -client.connect_signal("mouse::enter", function(c) - if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier - and awful.client.focus.filter(c) then - client.focus = c - end -end) - -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) -client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) --- }}} - --- autostart - -awful.util.spawn({"pulseaudio", "--start"}) -awful.util.spawn({"nm-applet"}) ---awful.util.spawn({"ibus-daemon", "-r", "--xim"}) -awful.util.spawn({"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"}) diff --git a/home/.config/awesome/theme.lua b/home/.config/awesome/theme.lua deleted file mode 100644 index 4a7249f..0000000 --- a/home/.config/awesome/theme.lua +++ /dev/null @@ -1,93 +0,0 @@ -local theme_assets = require("beautiful.theme_assets") -local xresources = require("beautiful.xresources") -local dpi = xresources.apply_dpi - -local gfs = require("gears.filesystem") -local layout_icons_path = gfs.get_configuration_dir() .. "icons/layouts/" - -local spawn = require("awful.spawn") -local utils = require("utils") -local helpers = require("lain.helpers") - -local theme = {} - -theme.font = "Terminus (TTF) 9" - -theme.wibar_height = 18 - -theme.colors = {} -theme.colors.base03 = "#002b36" -theme.colors.base02 = "#073642" -theme.colors.base01 = "#586e75" -theme.colors.base00 = "#657b83" -theme.colors.base0 = "#839496" -theme.colors.base1 = "#93a1a1" -theme.colors.base2 = "#eee8d5" -theme.colors.base3 = "#fdf6e3" -theme.colors.yellow = "#b58900" -theme.colors.orange = "#cb4b16" -theme.colors.red = "#dc322f" -theme.colors.magenta = "#d33682" -theme.colors.violet = "#6c71c4" -theme.colors.blue = "#268bd2" -theme.colors.cyan = "#2aa198" -theme.colors.green = "#859900" - -theme.bg_normal = theme.colors.base03 -theme.bg_focus = theme.colors.base02 -theme.bg_urgent = theme.colors.red -theme.bg_minimize = "#303030" -theme.bg_systray = theme.bg_normal - -theme.fg_normal = theme.colors.base0 -theme.fg_focus = theme.colors.base1 -theme.fg_urgent = theme.fg_focus -theme.fg_minimize = theme.colors.fg_normal - -theme.taglist_font = "IPAGothic 10" -theme.taglist_bg_focus = theme.colors.base3 -theme.taglist_fg_focus = theme.colors.base00 - -theme.useless_gap = dpi(0) -theme.border_width = 1 -theme.border_normal = theme.colors.base03 -theme.border_focus = theme.colors.base02 - -theme.tasklist_disable_icon = true - -theme.hotkeys_font = "Iosevka Bold 10" -theme.hotkeys_description_font = "Iosevka 10" -theme.hotkeys_modifiers_fg = theme.fg_normal - -theme.wallpaper = function(s) - if helpers.file_exists(utils.home() .. ".fehbg") then - spawn.spawn(utils.home() .. ".fehbg") - end -end - -local taglist_square_size = dpi(4) -theme.taglist_squares_sel = theme_assets.taglist_squares_sel( - taglist_square_size, theme.fg_normal -) -theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( - taglist_square_size, theme.fg_normal -) - -theme.layout_fairh = layout_icons_path .. "fairh.png" -theme.layout_fairv = layout_icons_path .. "fairv.png" -theme.layout_floating = layout_icons_path .. "floating.png" -theme.layout_magnifier = layout_icons_path .. "magnifier.png" -theme.layout_max = layout_icons_path .. "max.png" -theme.layout_fullscreen = layout_icons_path .. "fullscreen.png" -theme.layout_tilebottom = layout_icons_path .. "tilebottom.png" -theme.layout_tileleft = layout_icons_path .. "tileleft.png" -theme.layout_tile = layout_icons_path .. "tile.png" -theme.layout_tiletop = layout_icons_path .. "tiletop.png" -theme.layout_spiral = layout_icons_path .. "spiral.png" -theme.layout_dwindle = layout_icons_path .. "dwindle.png" -theme.layout_cornernw = layout_icons_path .. "cornernw.png" -theme.layout_cornerne = layout_icons_path .. "cornerne.png" -theme.layout_cornersw = layout_icons_path .. "cornersw.png" -theme.layout_cornerse = layout_icons_path .. "cornerse.png" - -return theme diff --git a/home/.config/awesome/utils.lua b/home/.config/awesome/utils.lua deleted file mode 100644 index 069ac0e..0000000 --- a/home/.config/awesome/utils.lua +++ /dev/null @@ -1,21 +0,0 @@ -local helpers = require("lain.helpers") -local markup = require("lain.util.markup") - -local utils = {} - -function utils.home() - return os.getenv("HOME") .. "/" -end - -function utils.handle_pid(command, callback) - helpers.async_with_shell(string.format("ps x -o pid=,command=|grep -E '^\\s*[0-9]* %s$'|sed 's/\\s*\\([0-9]*\\) .*/\\1/'", command), callback) -end - -function utils.ansi2markup(ansi, colors) - return ansi - :gsub("\x1b%[1m([^\x1b]*)", markup.bold("%1")) - :gsub("\x1b%[7m([^\x1b]*)", markup.color(colors.base1, colors.base02, "%1")) - :gsub("\x1b%[0m([^\x1b]*)", "%1") -end - -return utils diff --git a/home/.config/awesome/widgets.lua b/home/.config/awesome/widgets.lua deleted file mode 100644 index b153d2b..0000000 --- a/home/.config/awesome/widgets.lua +++ /dev/null @@ -1,230 +0,0 @@ -local awful = require("awful") -local gtable = require("gears.table") -local naughty = require("naughty") -local wibox = require("wibox") - -local lain = require("lain") -local helpers = require("lain.helpers") -local markup = lain.util.markup - -local theme = require("theme") -local utils = require("utils") - -local gfs = require("gears.filesystem") -local iconsdir = gfs.get_configuration_dir() .. "icons/" - -local network_interfaces = {"enp0s25", "wlp3s0"} - -local widgets = {} - -widgets.netdown_icon = wibox.widget.imagebox(iconsdir .. "down.png") -widgets.netdown = lain.widget.net({ - units = 1024^2, - iface = network_interfaces, - notify = "off", - settings = function() - widget:set_markup(markup.fontfg(theme.font, theme.colors.green, net_now.received .. "MiB/s ")) - end -}) - -widgets.netup_icon = wibox.widget.imagebox(iconsdir .. "up.png") -widgets.netup = lain.widget.net({ - units = 1024^2, - iface = network_interfaces, - notify = "off", - settings = function() - widget:set_markup(markup.fontfg(theme.font, theme.colors.red, net_now.sent .. "MiB/s ")) - end -}) - -widgets.mem_icon = wibox.widget.imagebox(iconsdir .. "mem.png") -widgets.mem = lain.widget.mem({ - settings = function() - widget:set_markup(markup.fontfg(theme.font, theme.colors.yellow, mem_now.perc .. "% ")) - end -}) - -widgets.cpu_icon = wibox.widget.imagebox(iconsdir .. "cpu.png") -widgets.cpu = lain.widget.cpu({ - settings = function() - widget:set_markup(markup.fontfg(theme.font, theme.colors.cyan, string.format("%02d", cpu_now.usage) .. "% ")) - end -}) - -widgets.temp_icon = wibox.widget.imagebox(iconsdir .. "temp.png") -widgets.temp = lain.widget.temp({ - settings = function() - widget:set_markup(markup.fontfg(theme.font, theme.colors.magenta, math.floor(coretemp_now) .. "°C ")) - end -}) - -widgets.bat_icon = wibox.widget.imagebox(iconsdir .. "bat.png") -widgets.bat = lain.widget.bat({ - notify = "off", - settings = function() - state = bat_now.ac_status == 0 and "D" or "C" - widget:set_markup(markup.fontfg(theme.font, theme.fg_normal, state .. bat_now.perc)) - end -}) - -widgets.vpn = {} -widgets.vpn.icon = wibox.widget.imagebox(iconsdir .. "vpn.png") -widgets.vpn.widget = wibox.widget.textbox() -widgets.vpn.update = function() - helpers.async({ "/bin/ip", "link" }, function(output) - connected = false - for line in output:gmatch("[^\r\n]+") do - vpn_server = string.match(line, "^%d+: mullvad%-(%g+):") - if vpn_server then - widgets.vpn.widget:set_markup(markup.fontfg(theme.font, theme.colors.blue, vpn_server .. " ")) - connected = true - end - end - - if connected then - widgets.vpn.icon.visible = true - else - widgets.vpn.widget:set_markup(markup.fontfg(theme.font, theme.colors.blue, "")) - widgets.vpn.icon.visible = false - end - end) -end -helpers.newtimer("vpn", 5, widgets.vpn.update) - -widgets.bluetooth = wibox.widget.imagebox(iconsdir .. "bluetooth-on.png") -widgets.bluetooth.pass_state = function(callback) - helpers.async_with_shell("/sbin/rfkill -n -o SOFT list bluetooth|uniq", function(state) - callback(state:gsub("^%s*(.-)%s*$", "%1")) - end) -end - -widgets.bluetooth.update = function() - widgets.bluetooth.pass_state(function(state) - if state == "blocked" then - widgets.bluetooth:set_image(iconsdir .. "bluetooth-off.png") - else - helpers.async_with_shell("for device in $(bluetoothctl devices|cut -d' ' -f 2);do bluetoothctl info $device|grep 'Connected: yes';done|wc -l", function(connected_devices) - if tonumber(connected_devices) > 0 then - widgets.bluetooth:set_image(iconsdir .. "bluetooth-active.png") - else - widgets.bluetooth:set_image(iconsdir .. "bluetooth-on.png") - end - end) - end - end) -end - -widgets.bluetooth.toggle = function() - widgets.bluetooth.pass_state(function(state) - if state == "blocked" then - awful.spawn.spawn({ "/sbin/rfkill", "unblock", "bluetooth" }) - else - awful.spawn.spawn({ "/sbin/rfkill", "block", "bluetooth" }) - end - widgets.bluetooth.update() - end) -end - -widgets.bluetooth:buttons( - gtable.join( - awful.button({ }, 1, widgets.bluetooth.toggle), - awful.button({ }, 3, function() - awful.spawn.with_shell("blueman-manager; pkill blueman-applet") - end) - ) -) - -helpers.newtimer("bluetooth", 10, widgets.bluetooth.update) - -widgets.redshift = wibox.widget.imagebox(iconsdir .. "redshift-on.png") -widgets.redshift.pid = nil -utils.handle_pid("redshift", function(pid) - if pid and #pid > 0 then - widgets.redshift.pid = tonumber(pid) - else - widgets.redshift.pid = awful.spawn.spawn({ "redshift" }) - end -end) -widgets.redshift.active = true - -widgets.redshift.toggle = function() - awful.spawn.spawn({ "kill", "-SIGUSR1", tostring(widgets.redshift.pid) }) - widgets.redshift.active = not widgets.redshift.active - - if widgets.redshift.active == true then - widgets.redshift:set_image(iconsdir .. "redshift-on.png") - else - widgets.redshift:set_image(iconsdir .. "redshift-off.png") - end -end - -widgets.redshift:buttons( - gtable.join( - awful.button({ }, 1, widgets.redshift.toggle) - ) -) - -widgets.tearstop = wibox.widget.imagebox(iconsdir .. "tearstop-off.png") -utils.handle_pid("compton --backend=glx", function(pid) - if pid and #pid > 0 then - widgets.tearstop.pid = tonumber(pid) - widgets.tearstop:set_image(iconsdir .. "tearstop-on.png") - end -end) -widgets.tearstop.pid = nil - -widgets.tearstop:buttons( - gtable.join( - awful.button({ }, 1, function() - if widgets.tearstop.pid == nil then - widgets.tearstop.pid = awful.spawn.spawn({ "compton", "--backend=glx" }) - widgets.tearstop:set_image(iconsdir .. "tearstop-on.png") - else - awful.spawn.spawn({ "kill", tostring(widgets.tearstop.pid) }) - widgets.tearstop.pid = nil - widgets.tearstop:set_image(iconsdir .. "tearstop-off.png") - end - end) - ) -) - -widgets.notifications = wibox.widget.imagebox(iconsdir .. "notifications-on.png") - -widgets.notifications:buttons( - gtable.join( - awful.button({ }, 1, function() - if naughty.is_suspended() then - naughty.resume() - widgets.notifications:set_image(iconsdir .. "notifications-on.png") - else - naughty.suspend() - widgets.notifications:set_image(iconsdir .. "notifications-off.png") - end - end) - ) -) - -widgets.cal = {} - -widgets.cal.toggle = function() - if widgets.cal.notification ~= nil then - naughty.destroy(widgets.cal.notification) - widgets.cal.notification = nil - else - helpers.async({ "khal", "--color", "calendar" }, function(output) - widgets.cal.notification = naughty.notify{ - screen = awful.screen.focused(), - text = utils.ansi2markup(output:gsub("\n$", ""), theme.colors), - timeout = 0, - } - end) - end -end - -widgets.cal.attach = function(parent) - parent:buttons(awful.util.table.join( - awful.button({}, 1, widgets.cal.toggle) - )) -end - -return widgets