Float out the bar a little bit if there are no windows, or multiple windows. Make single windows always fullscreen with no margins. Make bar transparent except when hovered over.
This commit is contained in:
parent
fa5bbee56e
commit
d6870c56b0
6 changed files with 178 additions and 10 deletions
48
kuro/utils/bar.py
Normal file
48
kuro/utils/bar.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
from libqtile import bar
|
||||
from libqtile.widget.groupbox import GroupBox
|
||||
from libqtile.log_utils import logger
|
||||
|
||||
|
||||
class KuroBar(bar.Bar):
|
||||
defaults = [
|
||||
("background", "#000000", "Background colour."),
|
||||
("background_normal", "#000000", "Background colour normally."),
|
||||
("background_hover", "#000000", "Background colour on hover."),
|
||||
("opacity", 1, "Bar window opacity."),
|
||||
("margin", 0, "Space around bar as int or list of ints [N E S W]."),
|
||||
("border_color", "#000000", "Border colour as str or list of str [N E S W]"),
|
||||
("border_width", 0, "Width of border as int of list of ints [N E S W]"),
|
||||
(
|
||||
"reserve",
|
||||
True,
|
||||
"Reserve screen space (when set to 'False', bar will be drawn above windows).",
|
||||
),
|
||||
]
|
||||
|
||||
def process_pointer_enter(self, x: int, y: int) -> None:
|
||||
super().process_pointer_enter(x=x, y=y)
|
||||
self.background = self.background_hover
|
||||
# GroupBox Widget background color
|
||||
for widget in self.widgets:
|
||||
if isinstance(widget, GroupBox):
|
||||
if len(widget.highlight_color) in [6, 7]:
|
||||
widget.highlight_color = widget.highlight_color + "FF"
|
||||
else:
|
||||
widget.highlight_color = widget.highlight_color[:-2] + "FF"
|
||||
logger.warning(f"Highlight: {widget.highlight_color}")
|
||||
self.drawer.clear(self.background)
|
||||
self.draw()
|
||||
|
||||
def process_pointer_leave(self, x: int, y: int) -> None:
|
||||
super().process_pointer_leave(x=x, y=y)
|
||||
self.background = self.background_normal
|
||||
# GroupBox Widget background color
|
||||
for widget in self.widgets:
|
||||
if isinstance(widget, GroupBox):
|
||||
if len(widget.highlight_color) in [6, 7]:
|
||||
widget.highlight_color = widget.highlight_color + "88"
|
||||
else:
|
||||
widget.highlight_color = widget.highlight_color[:-2] + "88"
|
||||
logger.warning(f"Highlight: {widget.highlight_color}")
|
||||
self.drawer.clear(self.background)
|
||||
self.draw()
|
||||
|
|
@ -16,10 +16,44 @@ from libqtile.widget.wlan import get_status
|
|||
from libqtile.widget.groupbox import GroupBox
|
||||
from libqtile.command.base import expose_command
|
||||
|
||||
from qtile_extras.widget.decorations import RectDecoration
|
||||
|
||||
from kuro.utils.general import notify, BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, BUTTON_DOWN, BUTTON_UP, BUTTON_MUTE, \
|
||||
call_process, execute
|
||||
|
||||
|
||||
def get_widget_style(config):
|
||||
# active=Config.get('colour_groupbox_icon_active', '#ffffff'),
|
||||
# borderwidth=Config.get('width_groupbox_border', 1),
|
||||
# disable_drag=Config.get('bool_groupbox_disable_drag', False),
|
||||
# font=Config.get('font_groupbox', 'Arial'),
|
||||
# fontsize=Config.get('fontsize_groupbox', 15),
|
||||
# highlight_color=Config.get("colour_groupbox_border_normal", '#444444'),
|
||||
# inactive=Config.get('colour_groupbox_icon_inactive', '#444444'),
|
||||
# rounded=Config.get('bool_groupbox_rounded_borders', True),
|
||||
# this_current_screen_border=Config.get('colour_groupbox_border_focus', '#ffffff'),
|
||||
# this_screen_border=Config.get('colour_groupbox_border_focus', '#ffffff'),
|
||||
# margin=Config.get('margin_groupbox', 0),
|
||||
|
||||
# Config.foreground = colors['color15']
|
||||
# Config.background = colors['color0']
|
||||
# Config.highlight = colors['color3']
|
||||
# Config.inactive_light = colors['color4']
|
||||
# Config.inactive_dark = colors['color5']
|
||||
# Config.bar_background = colors['color1']
|
||||
return {
|
||||
"foreground": "#ffffff",
|
||||
"decorations": [
|
||||
RectDecoration(
|
||||
colour=config.background,
|
||||
radius=12,
|
||||
filled=True,
|
||||
group=True,
|
||||
) # type: ignore
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class DualPaneTextboxBase(base._Widget):
|
||||
"""
|
||||
Base class for widgets that are two boxes next to each other both containing text.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue