Adding qtile config with mouse callbacks for panel widgets.

This commit is contained in:
Derek Taylor
2020-07-05 00:26:35 -05:00
parent 60533ea0eb
commit 06924eaefe
+4 -14
View File
@@ -346,17 +346,6 @@ widget_defaults = dict(
) )
extension_defaults = widget_defaults.copy() extension_defaults = widget_defaults.copy()
##### MOUSE CALLBACKS ######
def open_dmenu(qtile):
qtile.cmd_spawn('dmenu_run')
def open_htop(qtile):
qtile.cmd_spawn('alacritty -e htop')
def open_pacman(qtile):
qtile.cmd_spawn('alacritty -e sudo pacman -Syu')
##### WIDGETS ##### ##### WIDGETS #####
def init_widgets_list(): def init_widgets_list():
@@ -369,7 +358,7 @@ def init_widgets_list():
), ),
widget.Image( widget.Image(
filename = "~/.config/qtile/icons/python.png", filename = "~/.config/qtile/icons/python.png",
mouse_callbacks = {'Button1': open_dmenu} mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn('dmenu_run')}
), ),
widget.GroupBox(font="Ubuntu Bold", widget.GroupBox(font="Ubuntu Bold",
fontsize = 9, fontsize = 9,
@@ -464,12 +453,13 @@ def init_widgets_list():
widget.Pacman( widget.Pacman(
update_interval = 1800, update_interval = 1800,
foreground = colors[2], foreground = colors[2],
mouse_callbacks = {'Button1': open_pacman}, mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(myTerm + ' -e sudo pacman -Syu')},
background = colors[4] background = colors[4]
), ),
widget.TextBox( widget.TextBox(
text="Updates", text="Updates",
padding = 5, padding = 5,
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(myTerm + ' -e sudo pacman -Syu')},
foreground=colors[2], foreground=colors[2],
background=colors[4] background=colors[4]
), ),
@@ -490,7 +480,7 @@ def init_widgets_list():
widget.Memory( widget.Memory(
foreground = colors[2], foreground = colors[2],
background = colors[5], background = colors[5],
mouse_callbacks = {'Button1': open_htop}, mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(myTerm + ' -e htop')},
padding = 5 padding = 5
), ),
widget.TextBox( widget.TextBox(