2026-02-23 17:56:46 +01:00
|
|
|
# _ _ _
|
|
|
|
|
# __ _| |_(_) | ___ ___ ___ _ __ ___ ___ _ __ ___
|
|
|
|
|
# / _` | __| | |/ _ \ / __|/ __| '__/ _ \/ _ \ '_ \/ __|
|
|
|
|
|
# | (_| | |_| | | __/ \__ \ (__| | | __/ __/ | | \__ \
|
|
|
|
|
# \__, |\__|_|_|\___| |___/\___|_| \___|\___|_| |_|___/
|
|
|
|
|
# |_|
|
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
|
# Imports
|
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
|
from libqtile.config import Screen
|
|
|
|
|
from libqtile import bar
|
|
|
|
|
from libqtile.lazy import lazy
|
|
|
|
|
from qtile_extras import widget
|
|
|
|
|
from qtile_extras.widget.groupbox2 import GroupBoxRule
|
|
|
|
|
|
|
|
|
|
# from plugins.notifications import Notifier
|
|
|
|
|
from plugins.graphical_notifications import Notifier
|
|
|
|
|
|
|
|
|
|
from popups.powermenu import power_menu
|
|
|
|
|
from popups.start_menu import start_menu
|
|
|
|
|
from popups.calendar import calendar
|
|
|
|
|
from popups.mpris2_layout import MPRIS2_LAYOUT
|
|
|
|
|
from popups.volume_notification import VOL_POPUP
|
|
|
|
|
|
2026-02-23 18:17:48 +01:00
|
|
|
from res.themes.colors import gruvbox_dark as THEME
|
2026-02-23 17:56:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------
|
|
|
|
|
# GroupBox2 rules
|
|
|
|
|
# --------------------------------------------------------
|
|
|
|
|
def get_groupbox_rules(monitor_specific=True):
|
|
|
|
|
# Base rules applied to all GroupBoxes
|
|
|
|
|
rules = [
|
2026-02-23 18:17:48 +01:00
|
|
|
GroupBoxRule(text_colour=THEME["bg3"]).when(focused=False, occupied=True),
|
|
|
|
|
GroupBoxRule(text_colour=THEME["aqua"]).when(focused=False, occupied=False),
|
|
|
|
|
GroupBoxRule(text_colour=THEME["fg3"]).when(focused=True),
|
|
|
|
|
GroupBoxRule(text_colour=THEME["red"]).when(
|
2026-02-23 17:56:46 +01:00
|
|
|
focused=False, occupied=True, urgent=True
|
|
|
|
|
),
|
|
|
|
|
GroupBoxRule(visible=False).when(focused=False, occupied=False),
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# Add extra rule for a specific monitor (e.g., show "X" as label)
|
|
|
|
|
if monitor_specific:
|
|
|
|
|
rules.append(GroupBoxRule(text=""))
|
|
|
|
|
return rules
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------
|
|
|
|
|
# Widget Defaults
|
|
|
|
|
# --------------------------------------------------------
|
|
|
|
|
widget_defaults = dict(
|
|
|
|
|
font="Roboto Flex",
|
|
|
|
|
fontsize=20,
|
2026-02-23 18:17:48 +01:00
|
|
|
foreground=THEME["fg1"],
|
2026-02-23 17:56:46 +01:00
|
|
|
)
|
|
|
|
|
extension_defaults = widget_defaults.copy()
|
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------
|
|
|
|
|
# Screens
|
|
|
|
|
# --------------------------------------------------------
|
|
|
|
|
bar.Bar
|
|
|
|
|
screens = [
|
|
|
|
|
Screen(
|
|
|
|
|
# Center Screen
|
|
|
|
|
top=bar.Bar(
|
|
|
|
|
[
|
|
|
|
|
widget.TextBox(
|
|
|
|
|
text="",
|
|
|
|
|
fontsize=24,
|
2026-02-23 18:17:48 +01:00
|
|
|
foreground=THEME["blue"],
|
2026-02-23 17:56:46 +01:00
|
|
|
mouse_callbacks={"Button1": lazy.function(start_menu)},
|
|
|
|
|
),
|
|
|
|
|
widget.GroupBox2(
|
|
|
|
|
padding=5,
|
|
|
|
|
fontsize=22,
|
|
|
|
|
font="Open Sans",
|
|
|
|
|
center_aligned=True,
|
|
|
|
|
visible_groups=[
|
|
|
|
|
"1",
|
|
|
|
|
"2",
|
|
|
|
|
"3",
|
|
|
|
|
"0",
|
|
|
|
|
"f8",
|
|
|
|
|
"f9",
|
|
|
|
|
"f10",
|
|
|
|
|
"f11",
|
|
|
|
|
"f12",
|
|
|
|
|
],
|
|
|
|
|
hide_unused=True,
|
|
|
|
|
rules=get_groupbox_rules(monitor_specific=False),
|
|
|
|
|
),
|
|
|
|
|
widget.Spacer(),
|
|
|
|
|
widget.Systray(
|
|
|
|
|
icon_size=21,
|
|
|
|
|
),
|
|
|
|
|
widget.Spacer(length=6),
|
|
|
|
|
widget.Clock(mouse_callbacks={"Button1": lazy.function(calendar)}),
|
|
|
|
|
widget.Spacer(length=2),
|
|
|
|
|
widget.TextBox(
|
|
|
|
|
font="Open Sans",
|
|
|
|
|
fontsize=20,
|
|
|
|
|
text=" ",
|
|
|
|
|
mouse_callbacks={"Button1": lazy.function(power_menu)},
|
|
|
|
|
),
|
|
|
|
|
widget.PulseVolumeExtra(
|
|
|
|
|
mode="popup",
|
|
|
|
|
fmt="",
|
|
|
|
|
popup_layout=VOL_POPUP,
|
|
|
|
|
popup_hide_timeout=3,
|
|
|
|
|
popup_show_args={"relative_to": 8, "y": -70},
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-02-23 18:17:48 +01:00
|
|
|
background=THEME["bg0_hard"],
|
2026-02-23 17:56:46 +01:00
|
|
|
opacity=0.75,
|
|
|
|
|
size=32,
|
|
|
|
|
margin=[3, 3, 0, 3],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Screen(
|
|
|
|
|
# Right Screen
|
|
|
|
|
top=bar.Bar(
|
|
|
|
|
[
|
|
|
|
|
widget.TextBox(
|
|
|
|
|
text="",
|
|
|
|
|
fontsize=24,
|
2026-02-23 18:17:48 +01:00
|
|
|
foreground=THEME["blue"],
|
2026-02-23 17:56:46 +01:00
|
|
|
mouse_callbacks={"Button1": lazy.function(start_menu)},
|
|
|
|
|
),
|
|
|
|
|
widget.GroupBox2(
|
|
|
|
|
padding=6,
|
|
|
|
|
fontsize=22,
|
|
|
|
|
margin=7,
|
|
|
|
|
font="Open Sans",
|
|
|
|
|
center_aligned=True,
|
|
|
|
|
visible_groups=["7", "8", "9", "f2", "f4", "f5", "f6"],
|
|
|
|
|
hide_unused=True,
|
|
|
|
|
rules=get_groupbox_rules(monitor_specific=False),
|
|
|
|
|
),
|
|
|
|
|
widget.Spacer(status_format="{play_status} {artist}/{title}"),
|
|
|
|
|
widget.WidgetBox(
|
|
|
|
|
fontsize=22,
|
|
|
|
|
text_closed="",
|
|
|
|
|
text_open="",
|
|
|
|
|
widgets=[
|
|
|
|
|
widget.Memory(
|
|
|
|
|
format=" {MemPercent}%",
|
|
|
|
|
font="Open Sans",
|
|
|
|
|
),
|
|
|
|
|
widget.CPU(
|
|
|
|
|
format=" {load_percent}%",
|
|
|
|
|
font="Open Sans",
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
widget.Spacer(length=6),
|
|
|
|
|
widget.Clock(mouse_callbacks={"Button1": lazy.function(calendar)}),
|
|
|
|
|
widget.Spacer(length=2),
|
|
|
|
|
widget.TextBox(
|
|
|
|
|
font="Open Sans",
|
|
|
|
|
fontsize=20,
|
|
|
|
|
text=" ",
|
|
|
|
|
mouse_callbacks={"Button1": lazy.function(power_menu)},
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-02-23 18:17:48 +01:00
|
|
|
background=THEME["bg0_hard"],
|
2026-02-23 17:56:46 +01:00
|
|
|
opacity=0.75,
|
|
|
|
|
size=32,
|
|
|
|
|
margin=[3, 3, 0, 3],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Screen(
|
|
|
|
|
# Left Screen
|
|
|
|
|
top=bar.Bar(
|
|
|
|
|
[
|
|
|
|
|
widget.TextBox(
|
|
|
|
|
text="",
|
|
|
|
|
fontsize=24,
|
2026-02-23 18:17:48 +01:00
|
|
|
foreground=THEME["blue"],
|
2026-02-23 17:56:46 +01:00
|
|
|
mouse_callbacks={"Button1": lazy.function(start_menu)},
|
|
|
|
|
),
|
|
|
|
|
widget.GroupBox2(
|
|
|
|
|
padding=6,
|
|
|
|
|
fontsize=22,
|
|
|
|
|
font="Open Sans",
|
|
|
|
|
center_aligned=True,
|
|
|
|
|
visible_groups=[
|
|
|
|
|
"4",
|
|
|
|
|
"5",
|
|
|
|
|
"6",
|
|
|
|
|
"f1",
|
|
|
|
|
"f7",
|
|
|
|
|
"f3",
|
|
|
|
|
],
|
|
|
|
|
hide_unused=True,
|
|
|
|
|
rules=get_groupbox_rules(monitor_specific=False),
|
|
|
|
|
),
|
|
|
|
|
widget.Spacer(length=20),
|
|
|
|
|
widget.Mpris2(
|
|
|
|
|
name="mpris2",
|
|
|
|
|
width=350,
|
|
|
|
|
scroll=True,
|
|
|
|
|
scroll_clear=True,
|
2026-02-23 18:17:48 +01:00
|
|
|
foreground=THEME["fg1"],
|
2026-02-23 17:56:46 +01:00
|
|
|
format="{xesam:title} - {xesam:artist}",
|
|
|
|
|
paused_text="{track} ",
|
|
|
|
|
popup_layout=MPRIS2_LAYOUT,
|
|
|
|
|
poll_interval=15,
|
|
|
|
|
popup_show_args={"relative_to": 2, "relative_to_bar": True, "y": 3},
|
|
|
|
|
mouse_callbacks={"Button1": lazy.widget["mpris2"].toggle_player()},
|
|
|
|
|
),
|
|
|
|
|
widget.Spacer(),
|
|
|
|
|
widget.Clock(mouse_callbacks={"Button1": lazy.function(calendar)}),
|
|
|
|
|
widget.Spacer(length=2),
|
|
|
|
|
widget.TextBox(
|
|
|
|
|
fontsize=20,
|
|
|
|
|
text=" ",
|
|
|
|
|
mouse_callbacks={"Button1": lazy.function(power_menu)},
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-02-23 18:17:48 +01:00
|
|
|
background=THEME["bg0_hard"],
|
2026-02-23 17:56:46 +01:00
|
|
|
opacity=0.75,
|
|
|
|
|
size=32,
|
|
|
|
|
margin=[3, 3, 0, 3],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
notifier = Notifier(
|
|
|
|
|
x=int((2560 / 2) - (350 / 2)),
|
|
|
|
|
y=38,
|
|
|
|
|
width=350,
|
|
|
|
|
height=80,
|
|
|
|
|
format="<b>{summary}</b>\n{app_name}\n{body}",
|
|
|
|
|
# file_name='/home/cerberus/.config/qtile/normal.png', # Not working
|
2026-02-23 18:17:48 +01:00
|
|
|
foreground=THEME["fg1"],
|
2026-02-23 17:56:46 +01:00
|
|
|
background=(
|
2026-02-23 18:17:48 +01:00
|
|
|
THEME["bg0_hard"],
|
|
|
|
|
THEME["bg0_hard"],
|
|
|
|
|
THEME["orange"],
|
2026-02-23 17:56:46 +01:00
|
|
|
),
|
|
|
|
|
horizontal_padding=10,
|
|
|
|
|
vertical_padding=10,
|
|
|
|
|
opacity=0.65,
|
|
|
|
|
border_width=0,
|
|
|
|
|
font="Open Sans",
|
|
|
|
|
font_size=16,
|
|
|
|
|
overflow="more_width",
|
|
|
|
|
fullscreen="show",
|
|
|
|
|
screen=2,
|
|
|
|
|
actions=True,
|
|
|
|
|
wrap=True,
|
|
|
|
|
)
|