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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue