mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 19:40:24 +10:00
Working on a new qtile config.
This commit is contained in:
@@ -36,6 +36,12 @@ from libqtile.lazy import lazy
|
|||||||
from qtile_extras import widget
|
from qtile_extras import widget
|
||||||
from qtile_extras.widget.decorations import BorderDecoration
|
from qtile_extras.widget.decorations import BorderDecoration
|
||||||
|
|
||||||
|
# Allows you to input a name when adding treetab section.
|
||||||
|
@lazy.layout.function
|
||||||
|
def add_treetab_section(layout):
|
||||||
|
prompt = qtile.widgets_map["prompt"]
|
||||||
|
prompt.start_input("Section name: ", layout.cmd_add_section)
|
||||||
|
|
||||||
mod = "mod4" # Sets mod key to SUPER/WINDOWS
|
mod = "mod4" # Sets mod key to SUPER/WINDOWS
|
||||||
myTerm = "alacritty" # My terminal of choice
|
myTerm = "alacritty" # My terminal of choice
|
||||||
myBrowser = "qutebrowser" # My browser of choice
|
myBrowser = "qutebrowser" # My browser of choice
|
||||||
@@ -68,8 +74,16 @@ keys = [
|
|||||||
# Moving out of range in Columns layout will create new column.
|
# Moving out of range in Columns layout will create new column.
|
||||||
Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"),
|
Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"),
|
||||||
Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"),
|
Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"),
|
||||||
Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"),
|
Key([mod, "shift"], "j",
|
||||||
Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
|
lazy.layout.shuffle_down(),
|
||||||
|
lazy.layout.section_down().when(layout=["treetab"]),
|
||||||
|
desc="Move window down/move down a section in treetab"
|
||||||
|
),
|
||||||
|
Key([mod, "shift"], "k",
|
||||||
|
lazy.layout.shuffle_up(),
|
||||||
|
lazy.layout.section_up().when(layout=["treetab"]),
|
||||||
|
desc="Move window downup/move up a section in treetab"
|
||||||
|
),
|
||||||
|
|
||||||
# Grow/shrink windows left/right.
|
# Grow/shrink windows left/right.
|
||||||
# This is mainly for the 'monadtall' and 'monadwide' layouts
|
# This is mainly for the 'monadtall' and 'monadwide' layouts
|
||||||
@@ -107,8 +121,11 @@ keys = [
|
|||||||
Key([mod], "comma", lazy.prev_screen(), desc='Move focus to prev monitor'),
|
Key([mod], "comma", lazy.prev_screen(), desc='Move focus to prev monitor'),
|
||||||
|
|
||||||
# Treetab controls
|
# Treetab controls
|
||||||
|
Key([mod, "control"], "k", lazy.layout.section_up(), desc='Move up a section in treetab'),
|
||||||
|
Key([mod, "control"], "j", lazy.layout.section_down(), desc='Move down a section in treetab'),
|
||||||
Key([mod, "shift"], "h", lazy.layout.move_left(), desc='Move up a section in treetab'),
|
Key([mod, "shift"], "h", lazy.layout.move_left(), desc='Move up a section in treetab'),
|
||||||
Key([mod, "shift"], "l", lazy.layout.move_right(), desc='Move down a section in treetab'),
|
Key([mod, "shift"], "l", lazy.layout.move_right(), desc='Move down a section in treetab'),
|
||||||
|
Key([mod, "shift"], "a", add_treetab_section, desc='Prompt to add new section in treetab'),
|
||||||
|
|
||||||
# Emacs programs launched using the key chord CTRL+e followed by 'key'
|
# Emacs programs launched using the key chord CTRL+e followed by 'key'
|
||||||
KeyChord([mod],"e", [
|
KeyChord([mod],"e", [
|
||||||
@@ -152,8 +169,6 @@ group_labels = ["1", "2", "3", "4", "5", "6", "7", "8", "9",]
|
|||||||
|
|
||||||
group_layouts = ["monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall"]
|
group_layouts = ["monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall"]
|
||||||
|
|
||||||
#group_layouts = ["monadtall", "matrix", "monadtall", "bsp", "monadtall", "matrix", "monadtall", "bsp", "monadtall", "monadtall",]
|
|
||||||
|
|
||||||
for i in range(len(group_names)):
|
for i in range(len(group_names)):
|
||||||
groups.append(
|
groups.append(
|
||||||
Group(
|
Group(
|
||||||
@@ -186,10 +201,21 @@ for i in groups:
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
colors = [["#282c34ee", "#282c34cc"],
|
||||||
|
["#1c1f24", "#1c1f24"],
|
||||||
|
["#dfdfdf", "#dfdfdf"],
|
||||||
|
["#ff6c6b", "#ff6c6b"],
|
||||||
|
["#98be65", "#98be65"],
|
||||||
|
["#da8548", "#da8548"],
|
||||||
|
["#51afef", "#51afef"],
|
||||||
|
["#c678dd", "#c678dd"],
|
||||||
|
["#46d9ff", "#46d9ff"],
|
||||||
|
["#a9a1e1", "#a9a1e1"]]
|
||||||
|
|
||||||
layout_theme = {"border_width": 2,
|
layout_theme = {"border_width": 2,
|
||||||
"margin": 8,
|
"margin": 8,
|
||||||
"border_focus": "e1acff",
|
"border_focus": colors[8],
|
||||||
"border_normal": "1D2330"
|
"border_normal": colors[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
layouts = [
|
layouts = [
|
||||||
@@ -207,73 +233,53 @@ layouts = [
|
|||||||
layout.Columns(**layout_theme),
|
layout.Columns(**layout_theme),
|
||||||
layout.RatioTile(**layout_theme),
|
layout.RatioTile(**layout_theme),
|
||||||
layout.TreeTab(
|
layout.TreeTab(
|
||||||
font = "Ubuntu",
|
font = "Ubuntu Bold",
|
||||||
fontsize = 10,
|
fontsize = 11,
|
||||||
sections = ["FIRST", "SECOND", "THIRD", "FOURTH"],
|
border_width = 0,
|
||||||
|
bg_color = colors[0],
|
||||||
|
active_bg = colors[8],
|
||||||
|
active_fg = colors[1],
|
||||||
|
inactive_bg = colors[1],
|
||||||
|
inactive_fg = colors[2],
|
||||||
|
padding_left = 8,
|
||||||
|
padding_x = 8,
|
||||||
|
padding_y = 6,
|
||||||
|
sections = ["ONE", "TWO", "THREE"],
|
||||||
section_fontsize = 10,
|
section_fontsize = 10,
|
||||||
border_width = 2,
|
section_fg = colors[2],
|
||||||
bg_color = "1c1f24",
|
section_top = 15,
|
||||||
active_bg = "c678dd",
|
section_bottom = 15,
|
||||||
active_fg = "000000",
|
|
||||||
inactive_bg = "a9a1e1",
|
|
||||||
inactive_fg = "1c1f24",
|
|
||||||
padding_left = 0,
|
|
||||||
padding_x = 0,
|
|
||||||
padding_y = 5,
|
|
||||||
section_top = 10,
|
|
||||||
section_bottom = 20,
|
|
||||||
level_shift = 8,
|
level_shift = 8,
|
||||||
vspace = 3,
|
vspace = 3,
|
||||||
panel_width = 200
|
panel_width = 240
|
||||||
),
|
),
|
||||||
layout.Floating(**layout_theme)
|
layout.Floating(**layout_theme)
|
||||||
]
|
]
|
||||||
|
|
||||||
colors = [["#282c34ee", "#282c34cc"],
|
|
||||||
["#1c1f24", "#1c1f24"],
|
|
||||||
["#dfdfdf", "#dfdfdf"],
|
|
||||||
["#ff6c6b", "#ff6c6b"],
|
|
||||||
["#98be65", "#98be65"],
|
|
||||||
["#da8548", "#da8548"],
|
|
||||||
["#51afef", "#51afef"],
|
|
||||||
["#c678dd", "#c678dd"],
|
|
||||||
["#46d9ff", "#46d9ff"],
|
|
||||||
["#a9a1e1", "#a9a1e1"]]
|
|
||||||
|
|
||||||
widget_defaults = dict(
|
widget_defaults = dict(
|
||||||
font="Ubuntu Bold",
|
font="Ubuntu Bold",
|
||||||
fontsize = 12,
|
fontsize = 12,
|
||||||
padding = 2,
|
padding = 5,
|
||||||
background=colors[2]
|
background=colors[0]
|
||||||
)
|
)
|
||||||
extension_defaults = widget_defaults.copy()
|
extension_defaults = widget_defaults.copy()
|
||||||
|
|
||||||
# screens = [
|
|
||||||
# Screen(
|
|
||||||
# top=bar.Bar(
|
|
||||||
# [
|
|
||||||
|
|
||||||
def init_widgets_list():
|
def init_widgets_list():
|
||||||
widgets_list = [
|
widgets_list = [
|
||||||
widget.Sep(
|
widget.Sep(
|
||||||
linewidth = 0,
|
linewidth = 0,
|
||||||
padding = 6,
|
foreground = colors[2]
|
||||||
foreground = colors[2],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
),
|
||||||
widget.Image(
|
widget.Image(
|
||||||
filename = "~/.config/qtile/icons/python-white.png",
|
filename = "~/.config/qtile/icons/python-white.png",
|
||||||
scale = "False",
|
scale = "False",
|
||||||
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm)},
|
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm)},
|
||||||
background = colors[0]
|
|
||||||
),
|
|
||||||
|
|
||||||
widget.Sep(
|
|
||||||
linewidth = 0,
|
|
||||||
padding = 4,
|
|
||||||
foreground = colors[2],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
),
|
||||||
|
widget.Prompt(
|
||||||
|
font = "Ubuntu Mono",
|
||||||
|
fontsize=14,
|
||||||
|
foreground = colors[2]
|
||||||
|
),
|
||||||
widget.GroupBox(
|
widget.GroupBox(
|
||||||
font = "Ubuntu Mono Bold",
|
font = "Ubuntu Mono Bold",
|
||||||
fontsize = 10,
|
fontsize = 10,
|
||||||
@@ -291,13 +297,11 @@ def init_widgets_list():
|
|||||||
this_screen_border = colors [4],
|
this_screen_border = colors [4],
|
||||||
other_current_screen_border = colors[6],
|
other_current_screen_border = colors[6],
|
||||||
other_screen_border = colors[4],
|
other_screen_border = colors[4],
|
||||||
foreground = colors[2],
|
foreground = colors[2]
|
||||||
background = colors[0]
|
|
||||||
),
|
),
|
||||||
widget.TextBox(
|
widget.TextBox(
|
||||||
text = '|',
|
text = '|',
|
||||||
font = "Ubuntu Mono",
|
font = "Ubuntu Mono",
|
||||||
background = colors[0],
|
|
||||||
foreground = '#cccccc',
|
foreground = '#cccccc',
|
||||||
padding = 2,
|
padding = 2,
|
||||||
fontsize = 14
|
fontsize = 14
|
||||||
@@ -305,46 +309,33 @@ def init_widgets_list():
|
|||||||
widget.CurrentLayoutIcon(
|
widget.CurrentLayoutIcon(
|
||||||
custom_icon_paths = [os.path.expanduser("~/.config/qtile/icons")],
|
custom_icon_paths = [os.path.expanduser("~/.config/qtile/icons")],
|
||||||
foreground = colors[2],
|
foreground = colors[2],
|
||||||
background = colors[0],
|
|
||||||
padding = 0,
|
padding = 0,
|
||||||
scale = 0.7
|
scale = 0.7
|
||||||
),
|
),
|
||||||
widget.CurrentLayout(
|
widget.CurrentLayout(
|
||||||
foreground = colors[2],
|
foreground = colors[2],
|
||||||
background = colors[0],
|
|
||||||
padding = 5
|
padding = 5
|
||||||
),
|
),
|
||||||
widget.TextBox(
|
widget.TextBox(
|
||||||
text = '|',
|
text = '|',
|
||||||
font = "Ubuntu Mono",
|
font = "Ubuntu Mono",
|
||||||
background = colors[0],
|
|
||||||
foreground = '#cccccc',
|
foreground = '#cccccc',
|
||||||
padding = 2,
|
padding = 2,
|
||||||
fontsize = 14
|
fontsize = 14
|
||||||
),
|
),
|
||||||
widget.WindowName(
|
widget.WindowName(
|
||||||
foreground = colors[6],
|
foreground = colors[6],
|
||||||
background = colors[0],
|
|
||||||
padding = 0,
|
|
||||||
max_chars = 40
|
max_chars = 40
|
||||||
),
|
),
|
||||||
# widget.Systray(
|
# widget.Systray(
|
||||||
# background = "#000000",
|
# background = "#000000",
|
||||||
# padding = 5
|
# padding = 5
|
||||||
# ),
|
# ),
|
||||||
widget.Sep(
|
|
||||||
linewidth = 0,
|
|
||||||
padding = 4,
|
|
||||||
foreground = colors[0],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
|
||||||
widget.Net(
|
widget.Net(
|
||||||
interface = "enp6s0",
|
interface = "enp6s0",
|
||||||
prefix='M',
|
prefix='M',
|
||||||
format = 'Net: {down} ↓↑ {up}',
|
format = 'Net: {down} ↓↑ {up}',
|
||||||
foreground = colors[3],
|
foreground = colors[3],
|
||||||
background = colors[0],
|
|
||||||
padding = 5,
|
|
||||||
decorations=[
|
decorations=[
|
||||||
BorderDecoration(
|
BorderDecoration(
|
||||||
colour = colors[3],
|
colour = colors[3],
|
||||||
@@ -354,18 +345,10 @@ def init_widgets_list():
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
widget.Sep(
|
|
||||||
linewidth = 0,
|
|
||||||
padding = 4,
|
|
||||||
foreground = colors[0],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
|
||||||
widget.ThermalSensor(
|
widget.ThermalSensor(
|
||||||
foreground = colors[4],
|
foreground = colors[4],
|
||||||
background = colors[0],
|
|
||||||
threshold = 90,
|
threshold = 90,
|
||||||
fmt = '🌡 Temp: {}',
|
fmt = '🌡 Temp: {}',
|
||||||
padding = 5,
|
|
||||||
decorations=[
|
decorations=[
|
||||||
BorderDecoration(
|
BorderDecoration(
|
||||||
colour = colors[4],
|
colour = colors[4],
|
||||||
@@ -375,12 +358,6 @@ def init_widgets_list():
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
widget.Sep(
|
|
||||||
linewidth = 0,
|
|
||||||
padding = 4,
|
|
||||||
foreground = colors[0],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
|
||||||
widget.CheckUpdates(
|
widget.CheckUpdates(
|
||||||
update_interval = 1800,
|
update_interval = 1800,
|
||||||
distro = "Arch_checkupdates",
|
distro = "Arch_checkupdates",
|
||||||
@@ -389,8 +366,6 @@ def init_widgets_list():
|
|||||||
colour_have_updates = colors[5],
|
colour_have_updates = colors[5],
|
||||||
colour_no_updates = colors[5],
|
colour_no_updates = colors[5],
|
||||||
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn('pamac-manager')},
|
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn('pamac-manager')},
|
||||||
padding = 5,
|
|
||||||
background = colors[0],
|
|
||||||
decorations=[
|
decorations=[
|
||||||
BorderDecoration(
|
BorderDecoration(
|
||||||
colour = colors[5],
|
colour = colors[5],
|
||||||
@@ -400,18 +375,10 @@ def init_widgets_list():
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
widget.Sep(
|
|
||||||
linewidth = 0,
|
|
||||||
padding = 4,
|
|
||||||
foreground = colors[0],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
|
||||||
widget.Memory(
|
widget.Memory(
|
||||||
foreground = colors[9],
|
foreground = colors[9],
|
||||||
background = colors[0],
|
|
||||||
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e htop')},
|
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e htop')},
|
||||||
fmt = '✇ Mem: {}',
|
fmt = '✇ Mem: {}',
|
||||||
padding = 5,
|
|
||||||
decorations=[
|
decorations=[
|
||||||
BorderDecoration(
|
BorderDecoration(
|
||||||
colour = colors[9],
|
colour = colors[9],
|
||||||
@@ -421,17 +388,9 @@ def init_widgets_list():
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
widget.Sep(
|
|
||||||
linewidth = 0,
|
|
||||||
padding = 4,
|
|
||||||
foreground = colors[0],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
|
||||||
widget.Volume(
|
widget.Volume(
|
||||||
foreground = colors[7],
|
foreground = colors[7],
|
||||||
background = colors[0],
|
|
||||||
fmt = '🕫 Vol: {}',
|
fmt = '🕫 Vol: {}',
|
||||||
padding = 5,
|
|
||||||
decorations=[
|
decorations=[
|
||||||
BorderDecoration(
|
BorderDecoration(
|
||||||
colour = colors[7],
|
colour = colors[7],
|
||||||
@@ -441,17 +400,9 @@ def init_widgets_list():
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
widget.Sep(
|
widget.KeyboardLayout(
|
||||||
linewidth = 0,
|
|
||||||
padding = 4,
|
|
||||||
foreground = colors[0],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
|
||||||
widget.KeyboardLayout(
|
|
||||||
foreground = colors[8],
|
foreground = colors[8],
|
||||||
background = colors[0],
|
|
||||||
fmt = '⌨ Kbd: {}',
|
fmt = '⌨ Kbd: {}',
|
||||||
padding = 5,
|
|
||||||
decorations=[
|
decorations=[
|
||||||
BorderDecoration(
|
BorderDecoration(
|
||||||
colour = colors[8],
|
colour = colors[8],
|
||||||
@@ -461,17 +412,9 @@ def init_widgets_list():
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
widget.Sep(
|
|
||||||
linewidth = 0,
|
|
||||||
padding = 4,
|
|
||||||
foreground = colors[0],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
|
||||||
widget.Clock(
|
widget.Clock(
|
||||||
foreground = colors[6],
|
foreground = colors[6],
|
||||||
background = colors[0],
|
|
||||||
format = "⏱ %a, %b %d - %H:%M",
|
format = "⏱ %a, %b %d - %H:%M",
|
||||||
padding = 5,
|
|
||||||
decorations=[
|
decorations=[
|
||||||
BorderDecoration(
|
BorderDecoration(
|
||||||
colour = colors[6],
|
colour = colors[6],
|
||||||
@@ -483,16 +426,14 @@ def init_widgets_list():
|
|||||||
),
|
),
|
||||||
widget.Sep(
|
widget.Sep(
|
||||||
linewidth = 0,
|
linewidth = 0,
|
||||||
padding = 6,
|
foreground = colors[0]
|
||||||
foreground = colors[0],
|
|
||||||
background = colors[0]
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
return widgets_list
|
return widgets_list
|
||||||
|
|
||||||
def init_widgets_screen1():
|
def init_widgets_screen1():
|
||||||
widgets_screen1 = init_widgets_list()
|
widgets_screen1 = init_widgets_list()
|
||||||
#del widgets_screen1[9:10] # Slicing removes unwanted widgets (systray) on Monitors 1,3
|
#del widgets_screen1[9] # Removes unwanted widgets (systray) on Monitors 1,3
|
||||||
return widgets_screen1
|
return widgets_screen1
|
||||||
|
|
||||||
def init_widgets_screen2():
|
def init_widgets_screen2():
|
||||||
@@ -510,10 +451,6 @@ if __name__ in ["config", "__main__"]:
|
|||||||
widgets_screen1 = init_widgets_screen1()
|
widgets_screen1 = init_widgets_screen1()
|
||||||
widgets_screen2 = init_widgets_screen2()
|
widgets_screen2 = init_widgets_screen2()
|
||||||
|
|
||||||
|
|
||||||
# tripleScreens = [screens, screens, screens]
|
|
||||||
|
|
||||||
|
|
||||||
# Drag floating layouts.
|
# Drag floating layouts.
|
||||||
mouse = [
|
mouse = [
|
||||||
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
|
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
|
||||||
@@ -539,7 +476,7 @@ floating_layout = layout.Floating(
|
|||||||
Match(title='Qalculate!'), # qalculate-gtk
|
Match(title='Qalculate!'), # qalculate-gtk
|
||||||
Match(wm_class='kdenlive'), # kdenlive
|
Match(wm_class='kdenlive'), # kdenlive
|
||||||
Match(wm_class='pinentry-gtk-2'), # GPG key password entry
|
Match(wm_class='pinentry-gtk-2'), # GPG key password entry
|
||||||
Match(title="pinentry"), # GPG key password entry
|
Match(title="pinentry"), # GPG key password entry
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
auto_fullscreen = True
|
auto_fullscreen = True
|
||||||
|
|||||||
Reference in New Issue
Block a user