diff options
author | Thanos Apollo <[email protected]> | 2023-12-03 07:20:11 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-03 07:20:11 +0200 |
commit | a523807a68103a0840364d75548c80b746a48810 (patch) | |
tree | 03e87cec42c8ae7c1834db4e11adf40a65e61486 | |
parent | 4876f8289c1cd22f7edf41286657b1438e085781 (diff) |
qtile: Update widgets & Keys
- Add emacs keychords
- Fix indentation on widgets & keys
-rw-r--r-- | .config/qtile/config.py | 344 |
1 files changed, 125 insertions, 219 deletions
diff --git a/.config/qtile/config.py b/.config/qtile/config.py index 4f26401..9cebac7 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -4,7 +4,7 @@ import socket from libqtile import layout, bar, widget, hook from libqtile.config import Group, Screen from libqtile.dgroups import simple_key_binder -from libqtile.config import Key +from libqtile.config import Key, KeyChord from libqtile.command import lazy from libqtile.config import Click, Drag from colors import dracula @@ -66,134 +66,94 @@ widget_defaults = init_widgets_defaults() def init_widgets_list(): """My widget list.""" widgets_list = [ - widget.Spacer( - length=7, - ), - widget.Image( - filename="~/.config/qtile/Gentoo2.png", - scale="True", - margin=2, - ), - widget.Spacer( - length=7, - ), - widget.GroupBox( - font="FontAwesome", - fontsize=20, - padding=3, - margin=4, - borderwidth=1, - active=dracula["cyan"], - inactive=dracula["curr"], - rounded=False, - highlight_method="line", - this_current_screen_border=dracula["red"], - other_current_screen_border=dracula["curr"], - ), - widget.CurrentLayout( - font="Noto Sans Bold", - foreground=dracula["fg"], - background="#5B4B8A", - ), - widget.Spacer( - length=5 - ), - widget.WindowName( - font="JetBrains Mono Bold", - fontsize=12, - foreground=dracula["green"], - background=dracula["bg"], - ), - widget.Spacer( - length=10, - ), - widget.Image( - filename="~/.config/qtile/volume1.png", - scale=True, - ), - widget.Spacer( - length=7, - padding=10, - ), - widget.Volume( - fontsize=15, - fmt='{} ', - background=dracula["bg"], - foreground=dracula['orange'], - font="JetBrains Mono", - margin=10, - ), - widget.Spacer( - length=7, - padding=10, - ), - widget.Image( - filename="~/.config/qtile/ram2.png", - scale=True, - ), - widget.Memory( - measure_mem="G", - fontsize=15, - foreground=dracula["cyan"], - background=dracula["bg"], - font='JetBrains Mono Bold', - ), - widget.MemoryGraph( - type='box', - graph_color=dracula["cyan"], - foreground=dracula["fg"], - background=dracula["bg"], - ), - widget.Spacer( - length=7 - ), - widget.Image( - filename="~/.config/qtile/cpu1.png", - scale=True, - ), - widget.ThermalSensor( - threshold=50, - fontsize=15, - font='JetBrains Mono Bold', - foreground=dracula["cyan"], - background=dracula["bg"], - ), - widget.CPUGraph( - type='box', - graph_color=dracula["cyan"], - background=dracula["bg"], - ), - widget.Spacer( - length=5 - ), - widget.TextBox( - font="FontAwesome", - text=" ", - foreground=dracula["orange"], - background=dracula["bg"], - padding=2, - fontsize=18 - ), - widget.Clock( - font='JetBrains Mono Bold', - foreground=dracula["cyan"], - background=dracula["bg"], - fontsize=16, - format="%A %d/%m | %H:%M" - ), - widget.Spacer( - length=6 - ), - widget.Systray( - background=dracula["bg"], - icon_size=20, - padding=10, - margin=10, - ), - widget.Spacer( - length=5 - ), - ] + widget.Spacer(length=7), + widget.Image( + filename="~/.config/qtile/Gentoo2.png", + scale="True", + margin=2,), + widget.Spacer(length=7,), + widget.GroupBox( + font="FontAwesome", + fontsize=20, + padding=3, + margin=4, + borderwidth=1, + active=dracula["cyan"], + inactive=dracula["curr"], + rounded=False, + highlight_method="line", + this_current_screen_border=dracula["red"], + other_current_screen_border=dracula["curr"],), + widget.CurrentLayout( + font="Noto Sans Bold", + foreground=dracula["fg"], + background="#5B4B8A",), + widget.Spacer(length=5), + widget.WindowName( + font="JetBrains Mono Bold", + fontsize=12, + foreground=dracula["green"], + background=dracula["bg"],), + widget.Spacer(length=10,), + widget.Image( + filename="~/.config/qtile/volume1.png", + scale=True,), + widget.Spacer(length=7, padding=10,), + widget.Volume( + fontsize=15, + fmt='{} ', + background=dracula["bg"], + foreground=dracula['orange'], + font="JetBrains Mono", + margin=10,), + widget.Spacer(length=7,padding=10,), + widget.Image( + filename="~/.config/qtile/ram2.png", + scale=True,), + widget.Memory( + measure_mem="G", + fontsize=15, + foreground=dracula["cyan"], + background=dracula["bg"], + font='JetBrains Mono Bold',), + widget.MemoryGraph( + type='box', + graph_color=dracula["cyan"], + foreground=dracula["fg"], + background=dracula["bg"],), + widget.Spacer(length=7), + widget.Image(filename="~/.config/qtile/cpu1.png", scale=True,), + widget.ThermalSensor( + threshold=50, + fontsize=15, + font='JetBrains Mono Bold', + foreground=dracula["cyan"], + background=dracula["bg"],), + widget.CPUGraph( + type='box', + graph_color=dracula["cyan"], + background=dracula["bg"],), + widget.Spacer(length=5), + widget.TextBox( + font="FontAwesome", + text=" ", + foreground=dracula["orange"], + background=dracula["bg"], + padding=2, + fontsize=18), + widget.Clock( + font='JetBrains Mono Bold', + foreground=dracula["cyan"], + background=dracula["bg"], + fontsize=16, + format="%A %d/%m | %H:%M"), + widget.Spacer(length=6), + widget.Systray(background=dracula["bg"], + icon_size=20, + padding=10, + margin=10,), + widget.Spacer(length=5), + ] return widgets_list battery_widget = widget.Battery() @@ -237,105 +197,51 @@ mod = "mod4" browser = "firefox" keys = [ - Key([mod], "Return", - lazy.spawn("emacsclient -c"), - ), - Key([mod, "shift"], "m", - lazy.spawn("emacsclient -e '(thanos/pass-launcher)'"), - ), - Key([mod], "r", - lazy.spawn("rofi -show drun"), - ), - Key([mod, "shift"], "c", - lazy.next_layout(), - ), - Key([mod], "q", - lazy.window.kill(), - ), - Key([mod, "shift"], "r", - lazy.restart(), - ), - Key([mod, "shift"], "e", - lazy.spawn("emacs"), - ), + Key([mod],"Return",lazy.spawn("emacsclient -c"),), + Key([mod,"shift"],"m",lazy.spawn("emacsclient -e '(thanos/pass-launcher)'"),), + Key([mod],"r",lazy.spawn("rofi -show drun"),), + Key([mod,"shift"],"c",lazy.next_layout(),), + Key([mod],"q",lazy.window.kill(),), + Key([mod,"shift"],"r",lazy.restart(),), + KeyChord([mod],"e", [ + Key([],"d", lazy.spawn("emacs --daemon")), + Key([],"e", lazy.spawn("emacs")),]), # Switch focus of monitors - Key([mod], "period", - lazy.next_screen(), - ), + Key([mod],"period",lazy.next_screen(),), # Treetab controls - Key([mod, "shift"], "h", - lazy.layout.move_left(), - ), - Key([mod, "shift"], "l", - lazy.layout.move_right(), - ), + Key([mod,"shift"],"b",lazy.layout.move_left(),), + Key([mod,"shift"],"f",lazy.layout.move_right(),), # Window controls - Key([mod], "n", - lazy.layout.down(), - ), - Key([mod], "p", - lazy.layout.up(), - ), - Key([mod, "shift"], "n", - lazy.layout.shuffle_down(), - lazy.layout.section_down(), - ), - Key([mod, "shift"], "p", - lazy.layout.shuffle_up(), - lazy.layout.section_up(), - ), - Key([mod], "s", - lazy.layout.shrink(), - lazy.layout.decrease_nmaster(), - ), - Key([mod], "l", - lazy.layout.grow(), - lazy.layout.increase_nmaster(), - ), - Key([mod], "o", - lazy.layout.normalize(), - ), - Key([mod], "m", - lazy.layout.maximize(), - ), - Key([mod, "shift"], "f", - lazy.window.toggle_floating(), - ), - Key([mod], "f", - lazy.window.toggle_fullscreen(), - ), + Key([mod],"n",lazy.layout.down(),), + Key([mod],"p",lazy.layout.up(),), + Key([mod,"shift"],"n",lazy.layout.shuffle_down(),lazy.layout.section_down(),), + Key([mod,"shift"],"p",lazy.layout.shuffle_up(),lazy.layout.section_up(),), + Key([mod],"s",lazy.layout.shrink(),lazy.layout.decrease_nmaster(),), + Key([mod],"l",lazy.layout.grow(),lazy.layout.increase_nmaster(),), + Key([mod],"o",lazy.layout.normalize(),), + Key([mod],"m",lazy.layout.maximize(),), + Key([mod,"shift"],"f",lazy.window.toggle_floating(),), + Key([mod],"f",lazy.window.toggle_fullscreen(),), # Stack controls - Key([mod, "shift"], "Tab", - lazy.layout.rotate(), - lazy.layout.flip(), - ), - Key([mod, "shift"], "space", - lazy.layout.toggle_split(), - ), + Key([mod,"shift"],"Tab",lazy.layout.rotate(),lazy.layout.flip(),), + Key([mod,"shift"],"space", lazy.layout.toggle_split(),), # Volume controls - Key([], "XF86AudioLowerVolume", - lazy.spawn("amixer sset Master 5%-") - ), - Key([], "XF86AudioRaiseVolume", - lazy.spawn("amixer sset Master 5%+") - ), - Key([], "F9", - lazy.spawn("setxkbmap gr -option ctrl:swapcas")), - Key([], "F10", - lazy.spawn("setxkbmap us -option ctrl:swapcaps")), - Key([], "F1", - lazy.spawn("doas brightnessctl --device='intel_backlight' set 5%-")), - Key([], "F2", - lazy.spawn("doas brightnessctl --device='intel_backlight' set +5%")), - Key([], "F4", - (lazy.spawn("doas /home/thanos/.scripts/keyboard-light-x220.sh"))) + Key([],"XF86AudioLowerVolume",lazy.spawn("amixer sset Master 5%-")), + Key([],"XF86AudioRaiseVolume",lazy.spawn("amixer sset Master 5%+")), + # Keyboard + Key([],"F9", lazy.spawn("setxkbmap gr -option ctrl:swapcas")), + Key([],"F10", lazy.spawn("setxkbmap us -option ctrl:swapcaps")), + # Thinkpad + Key([],"F1", lazy.spawn("doas brightnessctl --device='intel_backlight' set 5%-")), + Key([],"F2", lazy.spawn("doas brightnessctl --device='intel_backlight' set +5%")), + Key([],"F4", (lazy.spawn("doas /home/thanos/.scripts/keyboard-light-x220.sh"))) ] mouse = [ - Drag([mod], "Button1", lazy.window.set_position_floating(), + Drag([mod],"Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), - Drag([mod], "Button3", lazy.window.set_size_floating(), + Drag([mod],"Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), - Click([mod], "Button2", + Click([mod],"Button2", lazy.window.bring_to_front()), ] |