From 6790a16cadf6cb999c5aee720604b5a2f35eb000 Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Sat, 12 Dec 2020 20:21:54 +0100 Subject: [PATCH] added some mouse callbacks --- qtile/.config/qtile/config.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/qtile/.config/qtile/config.py b/qtile/.config/qtile/config.py index 46d72d5..3db9400 100644 --- a/qtile/.config/qtile/config.py +++ b/qtile/.config/qtile/config.py @@ -287,6 +287,7 @@ def pacman_widget(prev_color,color,size,fontsize): filename='~/.config/qtile/icons/pacman.png', margin=5, background=color, + mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e "sudo pacman -Sy"')}, ), widget.CheckUpdates( colour_have_updates=dark_foreground_color, @@ -299,6 +300,8 @@ def pacman_widget(prev_color,color,size,fontsize): #endregion #region System_widgets +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), @@ -306,44 +309,49 @@ def System_widgets(prev_color,last_color,size,fontsize): 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), widget.Image( filename='~/.config/qtile/icons/cpu.png', margin=5, background=green_color, + mouse_callbacks = launch_htop, ), widget.CPU( foreground=dark_foreground_color, background=green_color, fontsize=fontsize, format='{load_percent}% @ {freq_current}GHz', - mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e htop')}, + mouse_callbacks = launch_htop, ), *powerline_arrow('l',green_color,orange_color,size), widget.Image( filename='~/.config/qtile/icons/ram.png', background=orange_color, - margin=-10 + margin=-10, + mouse_callbacks = launch_htop, ), MemoryC( foreground=dark_foreground_color, background=orange_color, fontsize=fontsize, format=" {MemUsed}GB({MemPercent}%) | {SwapUsed}GB({SwapPercent}%)", - mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e htop')}, + mouse_callbacks = launch_htop, ), *powerline_arrow('l',orange_color,last_color,size), widget.Image( filename='~/.config/qtile/icons/network.png', background=blue_color, - margin=5 + margin=5, + mouse_callbacks = launch_htop, ), widget.Net( background=last_color, @@ -351,6 +359,7 @@ def System_widgets(prev_color,last_color,size,fontsize): fontsize=fontsize, fmt='{:.9}', format='{down}↓', + mouse_callbacks = launch_htop, ), widget.Net( background=last_color, @@ -358,6 +367,7 @@ def System_widgets(prev_color,last_color,size,fontsize): fontsize=fontsize, fmt='{:.9}', format='{up}↑', + mouse_callbacks = launch_htop, ), ] #endregion