From 9a6e54fa8b60e47bc2dd7d5e3ee2ce804a2f85be Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Mon, 25 Jan 2021 14:06:06 +0100 Subject: [PATCH 1/2] changed qtile bar for laptop format --- qtile/.config/qtile/config.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/qtile/.config/qtile/config.py b/qtile/.config/qtile/config.py index 782a23a..a7c76d1 100644 --- a/qtile/.config/qtile/config.py +++ b/qtile/.config/qtile/config.py @@ -430,21 +430,7 @@ launch_htop= {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e htop')} def System_widgets(prev_color,last_color,size,fontsize): return [ - *powerline_arrow('l',prev_color,red_color,size), - widget.Image( - filename='~/.config/qtile/icons/temp.png', - margin=5, - background=red_color, - mouse_callbacks = launch_htop, - ), - widget.ThermalSensor( - foreground=dark_foreground_color, - background=red_color, - fontsize=fontsize, - tag_sensor='Tctl', - mouse_callbacks = launch_htop, - ), - *powerline_arrow('l',red_color,green_color,size), + *powerline_arrow('l',prev_color,green_color,size), widget.Image( filename='~/.config/qtile/icons/cpu.png', margin=5, @@ -455,7 +441,7 @@ def System_widgets(prev_color,last_color,size,fontsize): foreground=dark_foreground_color, background=green_color, fontsize=fontsize, - format='{load_percent}% @ {freq_current}GHz', + format='{load_percent}%', mouse_callbacks = launch_htop, ), *powerline_arrow('l',green_color,orange_color,size), @@ -469,7 +455,7 @@ def System_widgets(prev_color,last_color,size,fontsize): foreground=dark_foreground_color, background=orange_color, fontsize=fontsize, - format=" {MemUsed}GB({MemPercent}%) | {SwapUsed}GB({SwapPercent}%)", + format=" {MemUsed}GB | {SwapUsed}GB", mouse_callbacks = launch_htop, ), *powerline_arrow('l',orange_color,last_color,size), @@ -562,8 +548,8 @@ top_bar = bar.Bar([ #region Screens screens = [ - Screen(bottom=top_bar), - Screen(top=left_bar), +# Screen(bottom=top_bar), +# Screen(top=left_bar), Screen(top=main_bar), ] #endregion From dedb5517df9b0a8c233f81eb707e853de19d0f39 Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Mon, 1 Feb 2021 14:19:34 +0100 Subject: [PATCH 2/2] changed qtile config to fit laptop --- qtile/.config/qtile/config.py | 36 +++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/qtile/.config/qtile/config.py b/qtile/.config/qtile/config.py index a7c76d1..6dfec64 100644 --- a/qtile/.config/qtile/config.py +++ b/qtile/.config/qtile/config.py @@ -4,12 +4,13 @@ import subprocess import psutil from PIL import Image, ImageDraw, ImageFont -from libqtile import layout, bar, widget +from libqtile import layout, bar, widget, hook from libqtile.config import Key, Drag, Click, Group, Screen, ScratchPad, DropDown from libqtile.command import lazy #region defines + term = 'termite' focus_color = '#bd93f9' border_width = 2 @@ -44,6 +45,19 @@ cyan_color = ['#8be9fd','#8be9fd'] #endregion #endregion +#region Hooks +@hook.subscribe.startup_once +def autostart(): + processes = [ + ['nitrogen','--restore'], + ['dunst'], + ['nextcloud'], + ['redshift-gtk'], + ['udiskie'] + ] + for process in processes: + subprocess.Popen(process) + #region Keys keys = [ #moving focus aroung @@ -51,10 +65,10 @@ keys = [ Key([mod], "l", lazy.layout.right(),desc="move focus right"), Key([mod], "j", lazy.layout.down(),desc="move focus down"), Key([mod], "k", lazy.layout.up(),desc="move focus up"), - Key([mod,"mod1"], "k", lazy.to_screen(0),desc="move focus to top screen"), - Key([mod,"mod1"], "j", lazy.to_screen(1),desc="move focus to main screen"), + # Key([mod,"mod1"], "k", lazy.to_screen(0),desc="move focus to top screen"), + # Key([mod,"mod1"], "j", lazy.to_screen(1),desc="move focus to main screen"), Key([mod,"mod1"], "l", lazy.to_screen(1),desc="move focus to main screen"), - Key([mod,"mod1"], "h", lazy.to_screen(2),desc="move focus to left screen"), + Key([mod,"mod1"], "h", lazy.to_screen(0),desc="move focus to left screen"), # moving windows around Key([mod, "shift"], "h", lazy.layout.swap_left(),desc="move focused window left"), @@ -74,7 +88,8 @@ keys = [ Key([mod],"f", lazy.spawn("firefox"),desc="Launch firefox"), Key([mod],"e", lazy.spawn("pcmanfm"),desc="Launch pcmanfm"), Key([mod],"c", lazy.spawn("code"),desc="Launch visual studio code"), - Key([mod, "shift"],"s", lazy.spawn('gscreenshot -s -o -f /tmp/screenshots'),desc="take a screenshot"), + #Key([mod, "shift"],"s", lazy.spawn('gscreenshot -s -o -f /tmp/screenshots'),desc="take a screenshot"), + Key([mod, "shift"],"s", lazy.spawn("scrot '/tmp/%F_%T_$wx$h.png' -e 'xclip -selection clipboard -target image/png -i $f'"),desc="take a screenshot"), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), @@ -400,6 +415,7 @@ def vloume_widget(prev_color,color,size,fontsize): widget.Volume( foreground=dark_foreground_color, background=color, + font='Noto Sans', emoji=True, fontsize=fontsize, ), @@ -430,7 +446,15 @@ launch_htop= {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e htop')} def System_widgets(prev_color,last_color,size,fontsize): return [ - *powerline_arrow('l',prev_color,green_color,size), + *powerline_arrow('l',prev_color,red_color,size), + widget.Battery( + foreground=dark_foreground_color, + background=red_color, + fontsize=fontsize, + update_interval=1, + format="{percent:2.0%}", + ), + *powerline_arrow('l',red_color,green_color,size), widget.Image( filename='~/.config/qtile/icons/cpu.png', margin=5,