Adding qtile config with mouse callbacks for panel widgets.

This commit is contained in:
Derek Taylor 2020-07-04 18:25:00 -05:00
parent 3d69afdf0a
commit 60533ea0eb
3 changed files with 21 additions and 3 deletions

View File

@ -346,6 +346,17 @@ 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():
@ -356,12 +367,16 @@ def init_widgets_list():
foreground = colors[2], foreground = colors[2],
background = colors[0] background = colors[0]
), ),
widget.Image(
filename = "~/.config/qtile/icons/python.png",
mouse_callbacks = {'Button1': open_dmenu}
),
widget.GroupBox(font="Ubuntu Bold", widget.GroupBox(font="Ubuntu Bold",
fontsize = 9, fontsize = 9,
margin_y = 3, margin_y = 3,
margin_x = 0, margin_x = 0,
padding_y = 5, padding_y = 5,
padding_x = 5, padding_x = 3,
borderwidth = 3, borderwidth = 3,
active = colors[2], active = colors[2],
inactive = colors[2], inactive = colors[2],
@ -429,6 +444,7 @@ def init_widgets_list():
widget.ThermalSensor( widget.ThermalSensor(
foreground=colors[2], foreground=colors[2],
background=colors[5], background=colors[5],
threshold = 90,
padding = 5 padding = 5
), ),
widget.TextBox( widget.TextBox(
@ -446,9 +462,9 @@ def init_widgets_list():
fontsize=14 fontsize=14
), ),
widget.Pacman( widget.Pacman(
execute = "alacritty",
update_interval = 1800, update_interval = 1800,
foreground = colors[2], foreground = colors[2],
mouse_callbacks = {'Button1': open_pacman},
background = colors[4] background = colors[4]
), ),
widget.TextBox( widget.TextBox(
@ -474,6 +490,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},
padding = 5 padding = 5
), ),
widget.TextBox( widget.TextBox(

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

View File

@ -469,6 +469,7 @@ myWorkspaces = clickable . (map xmobarEscape)
clickable l = [ "<action=xdotool key super+" ++ show (n) ++ ">" ++ "<fn=2>" ++ ws ++ "</fn>" ++ "</action>" | clickable l = [ "<action=xdotool key super+" ++ show (n) ++ ">" ++ "<fn=2>" ++ ws ++ "</fn>" ++ "</action>" |
(i,ws) <- zip [1..9] l, (i,ws) <- zip [1..9] l,
let n = i ] let n = i ]
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- MANAGEHOOK -- MANAGEHOOK
------------------------------------------------------------------------ ------------------------------------------------------------------------
@ -775,7 +776,7 @@ main = do
, modMask = myModMask , modMask = myModMask
, terminal = myTerminal , terminal = myTerminal
, startupHook = myStartupHook , startupHook = myStartupHook
, layoutHook = showWName' myShowWNameTheme myLayoutHook , layoutHook = myLayoutHook
, workspaces = myWorkspaces , workspaces = myWorkspaces
, borderWidth = myBorderWidth , borderWidth = myBorderWidth
, normalBorderColor = myNormColor , normalBorderColor = myNormColor