fiddle around with rules and new bar layout
This commit is contained in:
@@ -25,85 +25,68 @@ from popups.brightness_notification import BRIGHTNESS_NOTIFICATION
|
|||||||
|
|
||||||
from res.themes.colors import gruvbox_dark
|
from res.themes.colors import gruvbox_dark
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
# GroupBox2 rules
|
# GroupBox2 rules
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
# def set_app_group_color(rule, box):
|
def colorize_group_lables(rule, box):
|
||||||
# if box.has.win.name("Jellyfin Media Player"):
|
for win in box.group.windows:
|
||||||
# rule.foreground = gruvbox_dark
|
if "kitty" in win.name:
|
||||||
# # elif box.occupied:
|
return True
|
||||||
# # rule.text = "◎"
|
return False
|
||||||
# # else:
|
|
||||||
# # rule.text = "○"
|
|
||||||
|
|
||||||
# return True
|
|
||||||
|
|
||||||
|
|
||||||
def get_groupbox_rules(monitor_specific=True):
|
def get_groupbox_rules():
|
||||||
# Base rules applied to all GroupBoxes
|
# Base rules applied to all GroupBoxes
|
||||||
rules = [
|
rules = [
|
||||||
GroupBoxRule(text_colour=gruvbox_dark["bg3"]).when(
|
GroupBoxRule(text_colour=gruvbox_dark["bg3"]).when(
|
||||||
focused=False, occupied=True
|
focused=False, occupied=True
|
||||||
),
|
),
|
||||||
# GroupBoxRule(text_colour=gruvbox_dark["aqua"]).when(focused=False, occupied=False),
|
|
||||||
GroupBoxRule(text_colour=gruvbox_dark["fg3"]).when(focused=True),
|
GroupBoxRule(text_colour=gruvbox_dark["fg3"]).when(focused=True),
|
||||||
GroupBoxRule(text_colour=gruvbox_dark["red"]).when(
|
GroupBoxRule(text_colour=gruvbox_dark["red"]).when(
|
||||||
focused=False, occupied=True, urgent=True
|
focused=False, occupied=True, urgent=True
|
||||||
),
|
),
|
||||||
GroupBoxRule(visible=False).when(focused=False, occupied=False),
|
GroupBoxRule(visible=False).when(focused=False, occupied=False),
|
||||||
# GroupBoxRule().when(func=set_app_group_color)
|
GroupBoxRule(text_colour=gruvbox_dark["orange"]).when(
|
||||||
|
func=colorize_group_lables,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
return rules
|
||||||
|
|
||||||
# Add extra rule for a specific monitor (e.g., show "X" as label)
|
# Add extra rule for a specific monitor (e.g., show "X" as label)
|
||||||
if monitor_specific:
|
# if monitor_specific:
|
||||||
rules.append(GroupBoxRule(text=""))
|
# rules.append(GroupBoxRule(text=""))
|
||||||
return rules
|
# return rules
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
# Widget Defaults
|
# Widget Defaults
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
widget_defaults = dict(font="Open Sans", fontsize=18, foreground=gruvbox_dark["fg1"])
|
widget_defaults = dict(font="Open Sans", fontsize=20, foreground=gruvbox_dark["fg1"])
|
||||||
extension_defaults = widget_defaults.copy()
|
extension_defaults = widget_defaults.copy()
|
||||||
|
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
# Screens
|
# Screens
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
bar.Bar
|
|
||||||
screens = [
|
screens = [
|
||||||
Screen(
|
Screen(
|
||||||
top=bar.Bar(
|
top=bar.Bar(
|
||||||
[
|
[
|
||||||
widget.TextBox(
|
# widget.TextBox(
|
||||||
text="",
|
# text="",
|
||||||
fontsize=24, # PopUp-Toolkit?
|
# ),
|
||||||
foreground=gruvbox_dark["blue"],
|
|
||||||
mouse_callbacks={"Button1": lazy.function(start_menu)},
|
|
||||||
),
|
|
||||||
widget.GroupBox2(
|
widget.GroupBox2(
|
||||||
padding=5,
|
|
||||||
fontsize=22,
|
|
||||||
font="Open Sans",
|
|
||||||
center_aligned=True,
|
|
||||||
visible_groups=["1", "2", "3", "4", "5", "6", "7"], # , '8', '9'
|
|
||||||
hide_unused=True,
|
hide_unused=True,
|
||||||
rules=get_groupbox_rules(monitor_specific=False),
|
center_aligned=True,
|
||||||
),
|
rules=get_groupbox_rules(),
|
||||||
widget.Spacer(length=20),
|
padding=6,
|
||||||
widget.Mpris2(
|
margin=4,
|
||||||
name="mpris2",
|
fontsize=22,
|
||||||
width=350,
|
visible_groups=["1", "2", "3", "4", "5", "6", "7"], # , '8', '9'
|
||||||
scroll=True,
|
|
||||||
scroll_clear=True,
|
|
||||||
foreground=gruvbox_dark["fg1"],
|
|
||||||
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.Spacer(),
|
||||||
|
widget.Clock(),
|
||||||
|
widget.Spacer(),
|
||||||
widget.Battery(
|
widget.Battery(
|
||||||
format="{char} {percent:2.0%}",
|
format="{char} {percent:2.0%}",
|
||||||
low_percentage=0.25,
|
low_percentage=0.25,
|
||||||
@@ -117,51 +100,109 @@ screens = [
|
|||||||
unknown_char="?",
|
unknown_char="?",
|
||||||
update_interval=1,
|
update_interval=1,
|
||||||
),
|
),
|
||||||
widget.WidgetBox(
|
widget.Systray(),
|
||||||
fontsize=22,
|
|
||||||
text_closed="",
|
|
||||||
text_open=" ",
|
|
||||||
widgets=[
|
|
||||||
widget.Memory(format=" {MemPercent}%"),
|
|
||||||
widget.CPU(format=" {load_percent}%"),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
widget.Spacer(length=2),
|
|
||||||
widget.Systray(
|
|
||||||
icon_size=21,
|
|
||||||
),
|
|
||||||
widget.Spacer(length=6),
|
|
||||||
widget.Clock(mouse_callbacks={"Button1": lazy.function(calendar)}),
|
|
||||||
widget.Spacer(length=2),
|
|
||||||
widget.TextBox(
|
|
||||||
fontsize=20,
|
|
||||||
text=" ",
|
|
||||||
mouse_callbacks={"Button1": lazy.function(power_menu)},
|
|
||||||
),
|
|
||||||
# Invisible widgets for popup notifications at value change
|
|
||||||
widget.BrightnessControl(
|
|
||||||
mode="popup",
|
|
||||||
popup_layout=BRIGHTNESS_NOTIFICATION,
|
|
||||||
device="/sys/class/backlight/intel_backlight",
|
|
||||||
brightness_path="brightness",
|
|
||||||
max_brightness_path="max_brightness",
|
|
||||||
popup_show_args={"relative_to": 8, "y": -70},
|
|
||||||
),
|
|
||||||
widget.PulseVolumeExtra(
|
|
||||||
mode="popup",
|
|
||||||
fmt="",
|
|
||||||
popup_layout=VOL_POPUP,
|
|
||||||
popup_hide_timeout=3,
|
|
||||||
popup_show_args={"relative_to": 8, "y": -70},
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
|
size=34,
|
||||||
|
opacity=1,
|
||||||
background=gruvbox_dark["bg0_hard"],
|
background=gruvbox_dark["bg0_hard"],
|
||||||
opacity=0.75,
|
|
||||||
size=32,
|
|
||||||
margin=[3, 3, 0, 3],
|
margin=[3, 3, 0, 3],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
bar.Bar
|
||||||
|
# screens = [
|
||||||
|
# Screen(
|
||||||
|
# top=bar.Bar(
|
||||||
|
# [
|
||||||
|
# widget.TextBox(
|
||||||
|
# text="",
|
||||||
|
# fontsize=24, # PopUp-Toolkit?
|
||||||
|
# foreground=gruvbox_dark["blue"],
|
||||||
|
# mouse_callbacks={"Button1": lazy.function(start_menu)},
|
||||||
|
# ),
|
||||||
|
# widget.GroupBox2(
|
||||||
|
# padding=5,
|
||||||
|
# fontsize=22,
|
||||||
|
# font="Open Sans",
|
||||||
|
# center_aligned=True,
|
||||||
|
# visible_groups=["1", "2", "3", "4", "5", "6", "7"], # , '8', '9'
|
||||||
|
# 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,
|
||||||
|
# foreground=gruvbox_dark["fg1"],
|
||||||
|
# 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.Battery(
|
||||||
|
# format="{char} {percent:2.0%}",
|
||||||
|
# low_percentage=0.25,
|
||||||
|
# low_foreground=gruvbox_dark["red"],
|
||||||
|
# charging_foreground=gruvbox_dark["green"],
|
||||||
|
# charge_char="",
|
||||||
|
# discharge_char="",
|
||||||
|
# empty_char="!",
|
||||||
|
# full_char="",
|
||||||
|
# not_charging_char="",
|
||||||
|
# unknown_char="?",
|
||||||
|
# update_interval=1,
|
||||||
|
# ),
|
||||||
|
# widget.WidgetBox(
|
||||||
|
# fontsize=22,
|
||||||
|
# text_closed="",
|
||||||
|
# text_open=" ",
|
||||||
|
# widgets=[
|
||||||
|
# widget.Memory(format=" {MemPercent}%"),
|
||||||
|
# widget.CPU(format=" {load_percent}%"),
|
||||||
|
# ],
|
||||||
|
# ),
|
||||||
|
# widget.Spacer(length=2),
|
||||||
|
# widget.Systray(
|
||||||
|
# icon_size=21,
|
||||||
|
# ),
|
||||||
|
# widget.Spacer(length=6),
|
||||||
|
# widget.Clock(mouse_callbacks={"Button1": lazy.function(calendar)}),
|
||||||
|
# widget.Spacer(length=2),
|
||||||
|
# widget.TextBox(
|
||||||
|
# fontsize=20,
|
||||||
|
# text=" ",
|
||||||
|
# mouse_callbacks={"Button1": lazy.function(power_menu)},
|
||||||
|
# ),
|
||||||
|
# # Invisible widgets for popup notifications at value change
|
||||||
|
# widget.BrightnessControl(
|
||||||
|
# mode="popup",
|
||||||
|
# popup_layout=BRIGHTNESS_NOTIFICATION,
|
||||||
|
# device="/sys/class/backlight/intel_backlight",
|
||||||
|
# brightness_path="brightness",
|
||||||
|
# max_brightness_path="max_brightness",
|
||||||
|
# popup_show_args={"relative_to": 8, "y": -70},
|
||||||
|
# ),
|
||||||
|
# widget.PulseVolumeExtra(
|
||||||
|
# mode="popup",
|
||||||
|
# fmt="",
|
||||||
|
# popup_layout=VOL_POPUP,
|
||||||
|
# popup_hide_timeout=3,
|
||||||
|
# popup_show_args={"relative_to": 8, "y": -70},
|
||||||
|
# ),
|
||||||
|
# ],
|
||||||
|
# background=gruvbox_dark["bg0_hard"],
|
||||||
|
# opacity=0.75,
|
||||||
|
# size=32,
|
||||||
|
# margin=[3, 3, 0, 3],
|
||||||
|
# ),
|
||||||
|
# ),
|
||||||
|
# ]
|
||||||
|
|
||||||
|
|
||||||
notifier = Notifier(
|
notifier = Notifier(
|
||||||
x=835,
|
x=835,
|
||||||
@@ -188,4 +229,3 @@ notifier = Notifier(
|
|||||||
actions=True,
|
actions=True,
|
||||||
# wrap=True
|
# wrap=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user