From dedb5517df9b0a8c233f81eb707e853de19d0f39 Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Mon, 1 Feb 2021 14:19:34 +0100 Subject: [PATCH] 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,