From 9343e9623b3f307dfc2f614ad93477832d0158c6 Mon Sep 17 00:00:00 2001 From: Daniel Diaz Date: Sun, 22 Nov 2020 21:00:43 -0500 Subject: [PATCH] First commit --- .idea/.gitignore | 0 .../inspectionProfiles/profiles_settings.xml | 6 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/qtile.iml | 12 + .idea/workspace.xml | 44 ++++ LICENSE | 20 ++ __pycache__/config.cpython-38.pyc | Bin 0 -> 1769 bytes __pycache__/functions.cpython-38.pyc | Bin 0 -> 1988 bytes __pycache__/groups.cpython-38.pyc | Bin 0 -> 1053 bytes __pycache__/keybindings.cpython-38.pyc | Bin 0 -> 5008 bytes __pycache__/layouts.cpython-38.pyc | Bin 0 -> 884 bytes __pycache__/widgets.cpython-38.pyc | Bin 0 -> 3714 bytes autostart.sh | 4 + config.py | 131 +++++++++++ functions.py | 50 +++++ groups.py | 23 ++ icons/layout-floating.png | Bin 0 -> 232 bytes icons/layout-max.png | Bin 0 -> 1143 bytes icons/layout-monadtall.png | Bin 0 -> 218 bytes icons/layout-tile.png | Bin 0 -> 225 bytes icons/layout-treetab.png | Bin 0 -> 212 bytes icons/python.png | Bin 0 -> 746 bytes keybindings.py | 162 ++++++++++++++ layouts.py | 31 +++ widgets.py | 209 ++++++++++++++++++ 26 files changed, 704 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/qtile.iml create mode 100644 .idea/workspace.xml create mode 100644 LICENSE create mode 100644 __pycache__/config.cpython-38.pyc create mode 100644 __pycache__/functions.cpython-38.pyc create mode 100644 __pycache__/groups.cpython-38.pyc create mode 100644 __pycache__/keybindings.cpython-38.pyc create mode 100644 __pycache__/layouts.cpython-38.pyc create mode 100644 __pycache__/widgets.cpython-38.pyc create mode 100755 autostart.sh create mode 100644 config.py create mode 100644 functions.py create mode 100644 groups.py create mode 100644 icons/layout-floating.png create mode 100644 icons/layout-max.png create mode 100644 icons/layout-monadtall.png create mode 100644 icons/layout-tile.png create mode 100644 icons/layout-treetab.png create mode 100644 icons/python.png create mode 100644 keybindings.py create mode 100644 layouts.py create mode 100644 widgets.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..0bdf6c9 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f82ef78 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/qtile.iml b/.idea/qtile.iml new file mode 100644 index 0000000..8b8c395 --- /dev/null +++ b/.idea/qtile.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..f240587 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + 1605572036306 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..86336ad --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +MIT License + +Copyright (c) 2020 Daniel Diaz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE diff --git a/__pycache__/config.cpython-38.pyc b/__pycache__/config.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa20b1f6b7c79e2e8d5e488fc3bacffef37a785b GIT binary patch literal 1769 zcmZ8g&2t+y6kplv_1bI4&Uc!$snaGY1{za1aA6pRl=eW=3#Fae%g%ZwJ8NrKTWPl@ z9bkZVnBl;MD;MX$q5lE{|A-D;IC0AKniEfwO;T2)-}}(h)7z(?zHBz@7JQ@EzX!jx zE$eS(T>ijkeF9TFLzaatjHu-siF^chiI$SGUrub_M#^8NmBjHKt=qJkxW1dz{F=5a zw4Qjrr*(%mlBVC(dX+9DEx!f2i)*-!J>0-eyfCc#ZL)}4V~77m+!vO=L~4M`!~U0ZagRD)jf?OaQ5OIyPPtk`eYGt|&-s>PcAa_9C z0C^K5e|Kp4dm#65+rNbu{kLFti9LE7FX81F0j_9V)wrf{UE_wvD;hU7ZfU%#@fzSZ zzOJ#OJv%WPF5nwKBmW&Z>s@@)zfH=cgHaFf;=PyF3*^6t_x(ElaoPGDFQIA0V&8UYE`=e1m>zsZ6 zM+a(gB9;!~p>%^F3F9;f9^I4GNfOae2wByOJdqBLL&_iuvq?%>h-HOv&bVw2VoHLH zvmqz2p^>sY9>h_Y$1IhO$RN$Jtmcf-e#m8GmJeb{F6&7+CVd{J5ril`4~MccNyCK5 zhVjpj&Ek}#IX`*s32}To6ypragWh-pC?*ehK?!tHBq7fu)&BVh&%m-_9>NqI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pycache__/layouts.cpython-38.pyc b/__pycache__/layouts.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b8c4d392bf4a3c49a865d903b47e335201b2a9c GIT binary patch literal 884 zcmY*Xy^a$x5VrT9usL0E5)DF;5XCkLaMD46&`F%2;Zks+Nn<&&H`&9x%h|iYMWNza zXlZx>UV%q(OO=uqD45x7PRp!jc08URf1mxj-|rC+=hqMR)g|O7F1i9SatvzjfDuGc zMRGc&l)NCq5$+Wc?k8vJ2=9y}{swYLLT#YFqsKGx zXc{~?d3bnuKk;llE47fCz0X9ov_a1GA}g+=X*sWr?YB8asdKIXQz&H0YgK{k8L86m zM90wo_r1}w%;iY%B9m$~oR>wKEk+krrsQZ#gBiZPv=L)jkyVU&P-M28JGA-!uJ&83 z!(GyUpb<+5+JHU*ry}PxC2Ml-e4*gG9p5|mJFB4Mhe*|Dy6`{JH3gE~)vz~c<&~^z zU6?_&l!NxngLhnKe5T}elE#w*`d(4z%v5~-#w3x(!`U0BWx>USE2R;cbx-*R8>On` zRaPu)^nB-q6D{S0&#Zrj4H8G+#Qd-w+Az8`eT>HqW$h+rnmsVYk7-QzKzo0@{nf#a zyl(P1@saX^=aMnoV=OO4t=>M{@$sV?gdWi-Y$D^twUNqZ b%^f!cG~rHh)2l%cJ=qR^iZ9n7S+VmEd~(le literal 0 HcmV?d00001 diff --git a/__pycache__/widgets.cpython-38.pyc b/__pycache__/widgets.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a66081a091f01aa3fa3cab7b951a76b07b00222c GIT binary patch literal 3714 zcmaJ^&5s<#74Pop>F$}G*>7WPW9R^zc%-l!3>bruvDT8wig*)g`H&`xTD?;}Gi~}~ zsIInmM@~S(QgX;16Dg{^Zhy(=ld)4#RyKA~t)vxM()~okk zRlnP8)-^oW|MM>|c}mm%O@sNTg28pP>?S&nrU3*JoRc77SnDvR#t}%U2YuO{n(so-FS=slwv?Bj7&4sk?hO8HemM+c6 zA0Fas?R9t%Bpo83e+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Pk8_1C1nNt(C zSDemYya{Kobn;B3u}7Kg4Sdnh<`zTikkt&i5e%0%w%rZpy1#Wde);;wE%$fxdnzre zHoj=Baq^0+>;(f}Q`|eT-$Pixg=ijZrw7vdO%W=zm(o$0j+B@6_rrvxcXufz?Y+ZH zaQ{%+?;sKs)2$#*`JuGlOQReVD>sTz|CPE;?Z9?vq?t5n0kR$(4E%&4tGR5J2xavK zYQYEC;st1LH|EPk;a;`Zs>-aKC?rpVCtIfqP&IV}ucJHPnHFHf(5y$s_vUz>aK#G> zMW<+qp58CbbrUy{v4n3;yDUxd{GVij_j~gh!m2sl7}L&=2wpT!!;HBK+rBj&k_U-O za#bU zht=bcyYa@+G3ToTZga}CBixRkxch+{r!4G-I25zg4TT$KE<&Q4M{d}4aS3P@&&8;H?TSeYlLW$`P*rN4T=!9IXz2F*SMzOHsFiIXBTI zp-?g<>p>=-uiqR|UB@4aJ*Jm-I`BK8IK&McM;d-kDpVLvPUdjhJ6YNGIsY{cXVr1$ zhXv(_Lfz*e%7{lZhi8thzM$A`*>r8E)7bN5-Se<r-^FGY|sK9Wl`D!-`#qZH@ zRv4$+xeWxBd3Du5#5SFev`dbo=38~X1C(^4aKE@*kZHU^ovK{T31XA}%ebmiOVc?N f8vJz>ejqic>Bs$~Sim*f!HoW89DQAH=#9n?oJo0? literal 0 HcmV?d00001 diff --git a/autostart.sh b/autostart.sh new file mode 100755 index 0000000..e2291b1 --- /dev/null +++ b/autostart.sh @@ -0,0 +1,4 @@ +#! /bin/bash +picom & +nitrogen --restore & +megasync & diff --git a/config.py b/config.py new file mode 100644 index 0000000..0db5365 --- /dev/null +++ b/config.py @@ -0,0 +1,131 @@ +############################################### +### QTILE CONFIGURATION FILE OF DANIEL DIAZ ### +# +# ____ ____ +# | _ \ | _ \ Copyright (c) 2020 Daniel Diaz +# | | | || | | | +# | |_| || |_| | http://www.github.com/Daniel1404/ +# |____/ |____/ +# + +# Copyright (c) 2010 Aldo Cortesi +# Copyright (c) 2010, 2014 dequis +# Copyright (c) 2012 Randall Ma +# Copyright (c) 2012-2014 Tycho Andersen +# Copyright (c) 2012 Craig Barnes +# Copyright (c) 2013 horsik +# Copyright (c) 2013 Tao Sauvage +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +####### IMPORTS ######### +import os +import subprocess + + +# from typing import List # noqa: F401 + +from libqtile import hook, layout +from libqtile.config import Group + +# Local Files +from keybindings import Keybindings, Mouse +from widgets import MyWidgets +from layouts import Layouts +from groups import CreateGroups + +group_icons = ["B  ", + "D  ", + "T  ", + "V  ", + "M  ", + "C  ", + "E  "] + + +###### MAIN ###### +if __name__ in ["config", "__main__"]: + # Initializes objects + obj_keys = Keybindings() + obj_mouse = Mouse() + obj_widgets = MyWidgets() + obj_layouts = Layouts() + obj_groups = CreateGroups() + # Initializes qtile variables + keys = obj_keys.init_keys() + mouse = obj_mouse.init_mouse() + layouts = obj_layouts.init_layouts() + groups = obj_groups.init_groups() + + # Append group keys for groups + keys += obj_keys.init_keys_groups(group_icons) + + ### DISPLAYS WIDGETS IN THE SCREEN #### + + screens = obj_widgets.init_screen() + main_widgets_list = obj_widgets.init_widgets_list() + widgets_screen1 = obj_widgets.init_widgets_screen() + + +dgroups_key_binder = None +dgrups_app_rules = [] +main = None # WARNING: this is deprecated and will be removed soon +follow_mouse_focus = True +bring_front_click = False +cursor_warp = False +floating_layout = layout.Floating(float_rules=[ + # Run the utility of `xprop` to see the wm class and name of an X client. + {'wmclass': 'confirm'}, + {'wmclass': 'dialog'}, + {'wmclass': 'download'}, + {'wmclass': 'error'}, + {'wmclass': 'file_progress'}, + {'wmclass': 'notification'}, + {'wmclass': 'splash'}, + {'wmclass': 'toolbar'}, + {'wmclass': 'confirmreset'}, # gitk + {'wmclass': 'makebranch'}, # gitk + {'wmclass': 'maketag'}, # gitk + {'wname': 'branchdialog'}, # gitk + {'wname': 'pinentry'}, # GPG key password entry + {'wmclass': 'ssh-askpass'}, # ssh-askpass +]) +auto_fullscreen = True +focus_on_window_activation = "smart" + + +@hook.subscribe.startup_once +def start_once(): + home = os.path.expanduser('~') + subprocess.call([home + '/.config/qtile/autostart.sh']) + +@hook.subscribe.client_new +def dialogs(window): + if(window.window.get_wm_type() == 'dialog' or window.window.get_wm_transient_for()): + window.floating = True + +# XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this +# string besides java UI toolkits; you can see several discussions on the +# mailing lists, GitHub issues, and other WM documentation that suggest setting +# this string if your java app doesn't work correctly. We may as well just lie +# and say that we're a working one by default. +# +# We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in, +# java that happens to be on java's whitelist. +wmname = "LG3D" diff --git a/functions.py b/functions.py new file mode 100644 index 0000000..30c8daf --- /dev/null +++ b/functions.py @@ -0,0 +1,50 @@ +from libqtile.command import lazy + +class Functions(object): + + ##### MOVE WINDOW IN GROUPS ##### + @staticmethod + def window_to_prev_group(): + @lazy.function + def __inner(qtile): + i = qtile.groups.index(qtile.current_group) + + if qtile.current_window and i != 0: + group = qtile.groups[i - 1].name + qtile.current_window.togroup(group, switch_group=True) + return __inner + + @staticmethod + def window_to_next_group(): + @lazy.function + def __inner(qtile): + i = qtile.groups.index(qtile.current_group) + + if qtile.current_window and i != len(qtile.groups): + group = qtile.groups[i + 1].name + qtile.current_window.togroup(group, switch_group=True) + return __inner + + + ##### KILL ALL WINDOWS ##### + + @staticmethod + def kill_all_windows(): + @lazy.function + def __inner(qtile): + for window in qtile.current_group.windows: + window.kill() + return __inner + + @staticmethod + def kill_all_windows_minus_current(): + @lazy.function + def __inner(qtile): + for window in qtile.current_group.windows: + if window != qtile.current_window: + window.kill() + return __inner + + +if __name__ == "__main__": + pass diff --git a/groups.py b/groups.py new file mode 100644 index 0000000..2dbf7ec --- /dev/null +++ b/groups.py @@ -0,0 +1,23 @@ +from libqtile.config import Group + + +class CreateGroups: + def __init__(self): + self.group_names = ["B  ", + "D  ", + "T  ", + "V  ", + "M  ", + "C  ", + "E  "] + + def init_groups(self): + """ + Return the groups of Qtile + """ + #### First and last + groups = [Group(name, layout="max") if name == self.group_names[0] + else Group(name, layout="floating") + if name == self.group_names[-1] else Group(name, layout="monadtall") + for name in self.group_names] + return groups diff --git a/icons/layout-floating.png b/icons/layout-floating.png new file mode 100644 index 0000000000000000000000000000000000000000..e876b13e4103c62155581528a840e6c409c092eb GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?31We{epSZZGe6l5>) z^mS!_!otDIs$lp$yA~)US>hT|;+&tGo0?a`;9QiNSdyBeP@Y+mq2TW68xY>eCk|AU zNOo)|4H0_*fJe z${MQOt5us~1-DG|JL8hTJfUO<^Lx$-{y%0idr7k?Ffg8QH7TC+E$Z#lPuA>jsu;?b Wal2cdO4JA1#^CAd=d#Wzp$Py|;zj}h literal 0 HcmV?d00001 diff --git a/icons/layout-max.png b/icons/layout-max.png new file mode 100644 index 0000000000000000000000000000000000000000..889bc78c4654bdcc8abd34bbe3fac0ab355325aa GIT binary patch literal 1143 zcmV--1c>{IP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+Pzj;lI$o9{O1&N1SA%TsP-n-bv(*-~N{JX05AxI~(=gQ6L!}Cgo;wRh=E`o#6kH^(Ae)c?Xf#+{ za?L3cqasxtq&$Y%SZJM_)_Ii_CpUsB6O0kI{IQwODE+RDF>8s)?3$s2V4h_N7?Zi# zLk*13*g*{|z_<3CkegTs3d0Js!oh6IVWI^3$St>scF+qLkK!h2$Np)^e8};Z1QP*8Dc~l#46?ir z$RF{F9Lm83A3}&hf`$}wbkQ4BSd0?q>o$uMFF~S+s3ghi)N9bFqN+)A;^go)4hiL$ zG^La?&dji!qsh?EkQ6Si_!3GiQnaL!E7GU>8fvUkwWgXIH`h?dEjDS|Qp=q>QmOkM zOpjf<_SEx0t_?T*2qO*|I?~8@);6m@v@ftmn>AicO+C4@2C2v~nw2jwGC2cd>`xlQXO2Jx}H)XErgaA}~OP$xS1hDY7@tcj7SU&fN!dU*gR~|6AVpv&@-E-9_dW zZ>EO_-hRSbo1g8v7(1$P#?(4gAJ)5OE`1E>n4$QX=24~)i>GJiJ!U}vH8Z8JUl#ah z2E5I4W%~*Z))S*SyO9@|4^-xWavhb?3+_CkGPht|MRh(#FR08Tg;!8ri_rrrV_y>M zEUN18P5!GLc(PvPtzlt&pelH%T=V#_UX7VtnHZBj38Ga6v`5)uyW%$4TIotpM010qN zS#tmYE+YT{E+YYWr9XB6000McNliru1}5{Vor?ef02y>eSad^gZEa<4bO1wg zWnpw>WFU8GbZ8()Nlj2!fese{002WtL_t(o!|m505&$p=1Hq%i|G%8tis~YIaVR!} z0)|rnNoJN;(Z`(E#R1mz2?PibAV7cs0RjXF5FkK6-~P3)vH|mQ1VK_I&*lIC002ov JPDHLkV1jeU4W$48 literal 0 HcmV?d00001 diff --git a/icons/layout-monadtall.png b/icons/layout-monadtall.png new file mode 100644 index 0000000000000000000000000000000000000000..cf84fb8ea3b7a23fd1a3938f859303b1620deab9 GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?31We{epSZZGe6l5>) z^mS!_!otB~VQMb0RvsuMS>hT|;+&tGo0?a`;9QiNSdyBeP@Y+mq2TW68xY>eCk|8; z;_2cT5^?zLHAk)k0UXR1JzxG^pJV=(^@+2X?Dtd76F8o79XP{qW|=+b`<|O7@o#xK z1QZ+^8mu1JP0Nbc`dh}_ZK8J4^1!$GAGlaRQVy~K>)9t)^SEtV_`MEjK7*&LpUXO@ GgeCxGl|!)r literal 0 HcmV?d00001 diff --git a/icons/layout-tile.png b/icons/layout-tile.png new file mode 100644 index 0000000000000000000000000000000000000000..74cd1e780ad8d531597263dd0f2c5264e92d6770 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?31We{epSZZGe6l5>) z^mS!_!otB~p?+lLop7L#WQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyua zw5N+>NW|f{*9^H181S$h+&kfaePrGwCC#T!5@CO5IwtrT*f6fpYIyZz@`pWvb3d5w zWn^Sx;Sez3+wuSCmAtLnr~2JHaLwe_3>A5Y*K#+`{^kZsDmWalNT?B$Kg#RABmUM! PpfwDhu6{1-oD!M) z^mS!_!otDIENg$Y;T2Fwvcxr_#5q4VH#M(>!MP|ku_QG`p**uBL&4qCHz2%`PaLSo z&(p;*B;xSfDTZ7O3OvlxAOFYqO?Gyi+tL)b%&A>YHO8gTg#ET3cjoThWidgk{{gjp z34Q(l&w-Q7Qv?`n8rU@y87dg~1DqJu1QI9!KD=Sa0000PbVXQnLvL+uWo~o;Lvm$dbY)~9 zcWHEJAV*0}P*;Ht7XSbPWJyFpR7l6&mdi`jQ545N_jiAzkvXKOgW`j7wA3Dyk0P|_ zF;t6)77-D=P~kDi@Iig$l-qCKh8@rZtV(IFEZFf{tG^o$x`~DiXzhxN_Qk>QvPhWNrZ$suh>(z?mCmY}@b9HTg7q>Jk9- zhXl8t%2|N+9>d;!1R?Ez_IQ1<=D;q`pLIh`oZ}a5CmD2MIWlnA6^Kb1H`;9WD+BB5 z0|<}Dl~D~WwSG)zq7>|`H_%%Yt#s|Z8t9>^vdf{bDAk4zR*ek7=&*6GJp6$( zrPnAgai%=iYXB0-gwv2p($LYusmkjVRZTsZ8RE^dux;~87Q(A6ZuiA*O*Z@Kxa)L%f51vmtbZ_1X#-|K-4@yE|Is0EHCMS@= zm#IaqHg=MI+cO=y_D;p4F0lZuT-e~h1I6d(KQp`!X<~7e{;JFbD}#7kF)*av1NDBk zXl_+RqXsY?gWiKo_Mf2nz9u+4dve6zj9dN!&7mEN8b5fmQgsMNG(7`?yUzsuU&P#* c{_p0x->Ck)o~v7N(EtDd07*qoM6N<$g6}9yLjV8( literal 0 HcmV?d00001 diff --git a/keybindings.py b/keybindings.py new file mode 100644 index 0000000..cfdcc65 --- /dev/null +++ b/keybindings.py @@ -0,0 +1,162 @@ +from libqtile.config import Click, Drag, Group, Key +from libqtile.lazy import lazy +from libqtile.utils import guess_terminal +from libqtile import layout + +# Import the function that move the window to the next and prev group +from functions import Functions + + +class Keybindings: + def __init__(self, mod="mod4", alt="mod1", altgr="mod5", termite="termite"): + self.mod = mod + self.alt = alt + self.altgr = altgr + self.termite = termite + + def init_keys(self): + + #################### CUSTOM KEYS ########################## + return [ + # Switch between windows in current stack pane + Key([self.mod], "k", lazy.layout.down(), + desc="Move focus down in stack pane"), + Key([self.mod], "j", lazy.layout.up(), + desc="Move focus up in stack pane"), + + # Move windows up or down in current stack + Key([self.mod, "control"], "k", lazy.layout.shuffle_down(), + desc="Move window down in current stack "), + Key([self.mod, "control"], "j", lazy.layout.shuffle_up(), + desc="Move window up in current stack "), + Key([self.mod, "control"], "h", lazy.layout.swap_left()), + Key([self.mod, "control"], "l", lazy.layout.swap_right()), + + # Move screen to next and previous workspace + Key([self.mod], "l", lazy.screen.next_group(), + desc="Move screen to the next workspace"), + Key([self.mod], "h", lazy.screen.prev_group(), + desc="Move screen to the previous workspace"), + + ####### MOVE WINDOWS TO PREV AND NEXT GROUPS ###### + Key([self.mod, "shift"], "l", Functions.window_to_next_group(), + desc="Move window and screen to the next workspace"), + Key([self.mod, "shift"], "h", Functions.window_to_prev_group(), + desc="Move window and screen to the previous workspace"), + + ####### MOVE WINDOWS TO PREV AND NEXT GROUPS ###### + Key([self.mod, self.altgr], "w", Functions.kill_all_windows(), + desc="Kill all windows in the workspace"), + Key([self.mod, self.altgr], "c", Functions.kill_all_windows_minus_current(), + desc="Kill all windows except current in the workspace"), + + # Switch window focus to other pane(s) of stack + Key([self.mod], "space", lazy.layout.next(), + desc="Switch window focus to other pane(s) of stack"), + + # Swap panes of split stack + Key([self.mod, "shift"], "space", lazy.layout.rotate(), + desc="Swap panes of split stack"), + + # Toggle between split and unsplit sides of stack. + # Split = all windows displayed + # Unsplit = 1 window displayed, like Max layout, but still with + # multiple stack panes + Key([self.mod, "shift"], "Return", lazy.layout.toggle_split(), + desc="Toggle between split and unsplit sides of stack"), + Key([self.mod], "Return", lazy.spawn( + self.termite), desc="Launch terminal"), + + # Toggle between different layouts as defined below + Key([self.mod], "Tab", lazy.next_layout(), + desc="Toggle between layouts"), + Key([self.mod], "w", lazy.window.kill(), desc="Kill focused window"), + + # Normalize or Maximize windows + Key([self.mod, self.altgr], "n", + lazy.layout.normalize(), desc="Normalize current windows"), + Key([self.mod, self.altgr], "m", + lazy.layout.maximize(), desc="Normalize current windows"), + + # Basic Commands + Key([self.mod, "control"], "r", + lazy.restart(), desc="Restart qtile"), + Key([self.mod, "control"], "q", + lazy.shutdown(), desc="Shutdown qtile"), + Key([self.mod, self.alt], "space", lazy.spawn("dmenu_run -p 'Run: '"), + desc="Run Dmenu"), + + # Applications hotkeys + # Apps are opened with Super + left self.alt keys + Key([self.mod, self.alt], "d", lazy.spawn( + "emacs"), desc="Open Doom Emacs"), + Key([self.mod, self.alt], "v", lazy.spawn("gvim"), desc="Open Gvim"), + Key([self.mod, self.alt], "o", lazy.spawn( + "env LIBGL_ALWAYS_SOFTWARE=1 obs"), desc="Open Obs Studio"), + Key([self.mod, self.alt], "n", lazy.spawn( + self.termite + " -e nvim"), desc="Open Neovim"), + Key([self.mod, self.alt], "f", lazy.spawn(self.termite + \ + " -e ./.config/vifm/scripts/vifmrun"), desc="Open vifm"), + Key([self.mod, self.alt], "b", lazy.spawn( + "brave"), desc="Open Brave"), + Key([self.mod, self.alt], "c", lazy.spawn( + "codium"), desc="Open VS codium"), + Key([self.mod, self.alt], "p", lazy.spawn( + "pycharm"), desc="Open Pycharm CE"), + Key([self.mod, self.alt], "a", lazy.spawn("pavucontrol"), + desc="Open Pulse audio GUI controller"), + Key([self.mod, self.alt], "e", lazy.spawn("emacs ~/.config/qtile/config.py"), + desc="Open Qtile config file on emacs"), + + + # PWA hotkeys + + Key([self.mod, self.alt], "s", + lazy.spawn( + "/usr/lib/brave-beta/brave --profile-directory=Default --app-id=pjibgclleladliembfgfagdaldikeohf"), + desc="Open Spotify PWA"), # In others system the PWA id will be different + + Key([self.mod, self.alt], "y", + lazy.spawn( + "/usr/lib/brave-beta/brave --profile-directory=Default --app-id=cinhimbnkkaeohfgghhklpknlkffjgod"), + desc="Open Youtube Music PWA"), + + # Media hotkeys + Key([self.mod], 'Up', lazy.spawn('pulseaudio-ctl up 5')), + Key([self.mod], 'Down', lazy.spawn('pulseaudio-ctl down 5')), + Key([self.mod], 'm', lazy.spawn('pulseaudio-ctl set 1')), + + # Screenshots + Key([], "Print", lazy.spawn('flameshot gui')), + Key([self.alt], "Print", lazy.spawn('flameshot full -c')), + ] + + def init_keys_groups(self, group_names): + """ + Create bindings to move between groups + """ + keys = [] + + for icon in group_names: + indx = (icon[0]).lower() + + keys += [ + Key([self.mod, 'control'], indx, lazy.group[icon].toscreen()), + Key([self.mod, 'shift'], indx, lazy.window.togroup(icon, switch_group=True))] + + return keys + + +class Mouse: + def __init__(self): + self.mod = "mod4" + + def init_mouse(self): + mouse = [ + Drag([self.mod], "Button1", lazy.window.set_position_floating(), + start=lazy.window.get_position()), + Drag([self.mod], "Button3", lazy.window.set_size_floating(), + start=lazy.window.get_size()), + Click([self.mod], "Button2", lazy.window.bring_to_front()) + ] + return mouse diff --git a/layouts.py b/layouts.py new file mode 100644 index 0000000..b98183c --- /dev/null +++ b/layouts.py @@ -0,0 +1,31 @@ +from libqtile import layout + +class Layouts: + def __init__(self): + self.default = { + "border_width": 2, + "margin": 6, + "border_focus": "#668bd7", + "border_normal": "1D2330"} + + def init_layouts(self): + """ + Returns the layouts variable + """ + layouts = [ + layout.MonadTall(**self.default), + layout.Max(**self.default), + layout.floating.Floating(**self.default), + layout.TreeTab(**self.default), + layout.Stack(num_stacks=2), + # Try more layouts by unleashing below layouts. + # layout.Bsp(), + # layout.Columns(), + # layout.Matrix(), + # layout.MonadWide(**self.default), + # layout.RatioTile(), + # layout.Tile(), + # layout.VerticalTile(), + # layout.Zoomy(), + ] + return layouts \ No newline at end of file diff --git a/widgets.py b/widgets.py new file mode 100644 index 0000000..6e3c6b0 --- /dev/null +++ b/widgets.py @@ -0,0 +1,209 @@ +import os +from libqtile import bar, layout, widget +from libqtile.lazy import lazy +from libqtile.config import Screen + +# widget_defaults = dict( +# font="Ubuntu Mono", +# fontsize = 12, +# padding = 2, +# background=colors[2] +# ) + +# extension_defaults = widget_defaults.copy() + + +class MyWidgets: + def __init__(self): + self.colors = [["#292d3e", "#292d3e"], # panel background + # background for current screen tab + ["#434758", "#434758"], + ["#ffffff", "#ffffff"], # font color for group names + # border line color for current tab + ["#ff5555", "#ff5555"], + # border line color for other tab and odd widgets + ["#8d62a9", "#8d62a9"], + ["#668bd7", "#668bd7"], # color for the even widgets + ["#e1acff", "#e1acff"]] # window name + self.termite = "termite" + + def init_widgets_list(self): + ''' + Function that returns the desired widgets in form of list + ''' + widgets_list = [ + widget.Sep( + linewidth=0, + padding=6, + foreground=self.colors[2], + background=self.colors[0] + ), + widget.Image( + filename="~/.config/qtile/icons/python.png", + mouse_callbacks={ + 'Button1': lambda qtile: qtile.cmd_spawn('dmenu_run')} + ), + widget.GroupBox( + font="Ubuntu Bold", + fontsize=12, + margin_y=2, + margin_x=0, + padding_y=5, + padding_x=3, + borderwidth=3, + active=self.colors[2], + inactive=self.colors[2], + rounded=False, + highlight_color=self.colors[1], + highlight_method="line", + this_current_screen_border=self.colors[3], + this_screen_border=self.colors[4], + other_current_screen_border=self.colors[0], + other_screen_border=self.colors[0], + foreground=self.colors[2], + background=self.colors[0] + ), + widget.Prompt( + prompt=lazy.spawncmd(), + font="Ubuntu Mono", + padding=10, + foreground=self.colors[3], + background=self.colors[1] + ), + widget.Sep( + linewidth=0, + padding=40, + foreground=self.colors[2], + background=self.colors[0] + ), + widget.WindowName( + foreground=self.colors[6], + background=self.colors[0], + padding=0 + ), + widget.Systray( + background=self.colors[0], + padding=5 + ), + # widget.TextBox( + # text = '', + # background = self.colors[0], + # foreground = self.colors[4], + # padding = 0, + # fontsize = 37 + # ), + # widget.TextBox( + # text = " ⟳", + # padding = 2, + # foreground = self.colors[2], + # background = self.colors[4], + # fontsize = 14 + # ), + # # widget.CheckUpdates( + # # update_interval = 1000, + # # foreground = self.colors[2], + # # mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(self.termite + ' -e sudo pacman -Syu')}, + # # background = self.colors[4] + # # ), + # widget.TextBox( + # text = "Updates", + # padding = 5, + # mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(self.termite + ' -e sudo pacman -Syu')}, + # foreground = self.colors[2], + # background = self.colors[4] + # ), + widget.TextBox( + text='', + background=self.colors[0], + foreground=self.colors[5], + padding=0, + fontsize=37 + ), + widget.TextBox( + text=" 🖬", + foreground=self.colors[2], + background=self.colors[5], + padding=0, + fontsize=14 + ), + widget.Memory( + foreground=self.colors[2], + background=self.colors[5], + mouse_callbacks={'Button1': lambda qtile: qtile.cmd_spawn( + self.termite + ' -e htop')}, + padding=5 + ), + widget.TextBox( + text='', + background=self.colors[5], + foreground=self.colors[4], + padding=0, + fontsize=37 + ), + widget.TextBox( + text="  ", + foreground=self.colors[2], + background=self.colors[4], + padding=0, + mouse_callbacks={ + "Button1": lambda qtile: qtile.cmd_spawn("pavucontrol")} + ), + widget.Volume( + foreground=self.colors[2], + background=self.colors[4], + padding=5 + ), + widget.TextBox( + text='', + background=self.colors[4], + foreground=self.colors[5], + padding=0, + fontsize=37 + ), + widget.CurrentLayoutIcon( + custom_icon_paths=[os.path.expanduser( + "~/.config/qtile/icons")], + foreground=self.colors[0], + background=self.colors[5], + padding=0, + scale=0.7 + ), + widget.CurrentLayout( + foreground=self.colors[2], + background=self.colors[5], + padding=5 + ), + widget.TextBox( + text='', + background=self.colors[5], + foreground=self.colors[4], + padding=0, + fontsize=37 + ), + widget.Clock( + foreground=self.colors[2], + background=self.colors[4], + format="%B %d [ %H:%M ]" + ), + widget.Sep( + linewidth=0, + padding=10, + foreground=self.colors[0], + background=self.colors[4] + ), + ] + return widgets_list + + def init_widgets_screen(self): + ''' + Function that returns the widgets in a list. + It can be modified so it is useful if you have a multimonitor system + ''' + widgets_screen = self.init_widgets_list() + return widgets_screen + + def init_screen(self): + ''' + Init the widgets in the screen + ''' + return [Screen(top=bar.Bar(widgets=self.init_widgets_screen(), opacity=1.0, size=20))]