custom bar

This commit is contained in:
zoe 2022-09-01 11:31:00 +02:00
parent 4720f01bfe
commit 66f3cb5bc3
2 changed files with 39 additions and 32 deletions

View File

@ -5,6 +5,7 @@ from libqtile.lazy import lazy
import autostart
import my_layouts
import my_widgets
mod = "mod4"
@ -97,39 +98,10 @@ for i in groups:
)
widget_defaults = dict(
font="sans",
fontsize=12,
padding=3,
)
extension_defaults = widget_defaults.copy()
extension_defaults = my_widgets.get_defaults().copy()
screens = my_widgets.get_screens()
screens = [
Screen(
bottom=bar.Bar(
[
widget.CurrentLayout(),
widget.GroupBox(),
widget.Prompt(),
widget.WindowName(),
widget.Chord(
chords_colors={
"launch": ("#ff0000", "#ffffff"),
},
name_transform=lambda name: name.upper(),
),
widget.TextBox("default config", name="default"),
widget.TextBox("Press <M-r> to spawn", foreground="#d75f5f"),
widget.Systray(),
widget.Clock(format="%Y-%m-%d %a %I:%M %p"),
widget.QuickExit(),
],
24,
# border_width=[2, 0, 2, 0], # Draw top and bottom borders
# border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta
),
),
]
layouts = my_layouts.get_layouts()

35
my_widgets.py Normal file
View File

@ -0,0 +1,35 @@
from libqtile.config import Screen
from libqtile import bar, widget
colors = {"bg": "#282a36", "onbg": "#f8f8f2"}
_bar = bar.Bar(
[
widget.Systray(),
widget.GroupBox(),
widget.Spacer(length=bar.STRETCH),
widget.Clock(format="%d.%m.%y %H:%M:%S"),
widget.NetGraph(),
widget.Volume(),
widget.CurrentLayoutIcon(),
],
24,
border_width=[2, 0, 2, 0],
background=colors["bg"],
)
def get_defaults():
return dict(
font="CaskaydiaCove Nerd Font",
fontsize=12,
padding=3,
)
def get_screens():
return [
Screen(bottom=_bar),
]