fancy bar
This commit is contained in:
parent
2936bf27cb
commit
2592855aaa
|
@ -6,7 +6,6 @@ autostart = [
|
|||
"xfce4-power-manager",
|
||||
"nm-applet",
|
||||
["nitrogen", "--restore"],
|
||||
["notify-send", "welcome!"],
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from libqtile.layout import columns, max, xmonad
|
||||
import my_globals
|
||||
|
||||
default_layout_theme = {
|
||||
"border_width": 2,
|
||||
"margin": 4,
|
||||
"border_color": "#bd93f9",
|
||||
"border_focus": "#50fa7b",
|
||||
"border_width": my_globals.border_width,
|
||||
"margin": my_globals.gap_width,
|
||||
"border_normal": my_globals.colors["accent-dark"],
|
||||
"border_focus": my_globals.colors["accent-light"],
|
||||
}
|
||||
|
||||
|
||||
|
@ -16,7 +17,7 @@ def get_layouts():
|
|||
# layout.Stack(num_stacks=2),
|
||||
# layout.Bsp(),
|
||||
# matrix.Matrix(),
|
||||
xmonad.MonadTall(**default_layout_theme),
|
||||
# xmonad.MonadTall(**default_layout_theme),
|
||||
# layout.MonadWide(),
|
||||
# layout.RatioTile(),
|
||||
# layout.Tile(),
|
||||
|
|
139
my_widgets.py
139
my_widgets.py
|
@ -1,33 +1,132 @@
|
|||
from libqtile.config import Screen
|
||||
from libqtile import bar, widget
|
||||
from enum import Enum
|
||||
import my_globals
|
||||
|
||||
|
||||
_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=[my_globals.border_width, 0, 0, 0],
|
||||
background=my_globals.colors["bg"],
|
||||
)
|
||||
def get_screens():
|
||||
return [
|
||||
Screen(top=_bar),
|
||||
]
|
||||
|
||||
|
||||
def get_defaults():
|
||||
return dict(
|
||||
font="CaskaydiaCove Nerd Font",
|
||||
fontsize=12,
|
||||
padding=3,
|
||||
fontsize=14,
|
||||
padding=6,
|
||||
)
|
||||
|
||||
|
||||
def get_screens():
|
||||
return [
|
||||
Screen(bottom=_bar),
|
||||
]
|
||||
class _PowerLineDirection(Enum):
|
||||
LEFT = 0
|
||||
RIGHT = 1
|
||||
|
||||
|
||||
class _Accent(Enum):
|
||||
A = my_globals.colors["accent-dark"]
|
||||
B = my_globals.colors["bg-light"]
|
||||
|
||||
|
||||
def _get_powerline_arrow(direction: _PowerLineDirection, accent: _Accent, end=False):
|
||||
text = ""
|
||||
if direction is _PowerLineDirection.RIGHT:
|
||||
text = ""
|
||||
|
||||
bg = _Accent.B.value
|
||||
if end:
|
||||
bg = my_globals.colors["bg"]
|
||||
elif accent is _Accent.B:
|
||||
bg = _Accent.A.value
|
||||
|
||||
return widget.TextBox(
|
||||
text=text,
|
||||
foreground=accent.value,
|
||||
background=bg,
|
||||
fontsize=24,
|
||||
padding=0,
|
||||
)
|
||||
|
||||
|
||||
_tray = widget.Systray(
|
||||
**get_defaults(),
|
||||
background=_Accent.A.value,
|
||||
foreground=my_globals.colors["on-bg-light"],
|
||||
)
|
||||
|
||||
_groups = widget.GroupBox(
|
||||
**get_defaults(),
|
||||
highlight_method="line",
|
||||
hide_unused=True,
|
||||
borderwidth=my_globals.border_width,
|
||||
background=my_globals.colors["bg-light"],
|
||||
this_screen_border=my_globals.colors["accent-dark"],
|
||||
this_current_screen_border=my_globals.colors["accent-light"],
|
||||
other_screen_border=my_globals.colors["accent-dark"],
|
||||
other_current_screen_border=my_globals.colors["accent-light"],
|
||||
active=my_globals.colors["on-bg"],
|
||||
inactive=my_globals.colors["on-bg"],
|
||||
highlight_color=[
|
||||
my_globals.colors["bg-light"],
|
||||
my_globals.colors["bg-light"],
|
||||
],
|
||||
)
|
||||
|
||||
_window_name = widget.WindowName(
|
||||
**get_defaults(),
|
||||
for_current_screen=True,
|
||||
)
|
||||
|
||||
_clock = widget.Clock(
|
||||
**get_defaults(),
|
||||
format="%d.%m.%y %H:%M:%S",
|
||||
background=my_globals.colors["accent-dark"],
|
||||
)
|
||||
|
||||
_updates = widget.CheckUpdates(
|
||||
**get_defaults(),
|
||||
distro="Debian",
|
||||
display_format=" {updates}",
|
||||
)
|
||||
|
||||
_volume = widget.Volume(
|
||||
**get_defaults(),
|
||||
background=my_globals.colors["bg-light"],
|
||||
volume_app="pavucontrol",
|
||||
emoji=True,
|
||||
)
|
||||
|
||||
_layout = widget.CurrentLayout(
|
||||
**get_defaults(),
|
||||
background=my_globals.colors["bg-light"],
|
||||
)
|
||||
|
||||
_mpris = widget.Mpris2(**get_defaults())
|
||||
|
||||
_bar = bar.Bar(
|
||||
[
|
||||
_tray,
|
||||
_get_powerline_arrow(_PowerLineDirection.LEFT, _Accent.A),
|
||||
_layout,
|
||||
_groups,
|
||||
_get_powerline_arrow(
|
||||
_PowerLineDirection.LEFT,
|
||||
_Accent.B,
|
||||
end=True,
|
||||
),
|
||||
_window_name,
|
||||
widget.Spacer(**get_defaults(), length=bar.STRETCH),
|
||||
_updates,
|
||||
_get_powerline_arrow(
|
||||
_PowerLineDirection.RIGHT,
|
||||
_Accent.B,
|
||||
end=True,
|
||||
),
|
||||
_volume,
|
||||
_mpris,
|
||||
_get_powerline_arrow(_PowerLineDirection.RIGHT, _Accent.A),
|
||||
_clock,
|
||||
],
|
||||
24,
|
||||
background=my_globals.colors["bg"],
|
||||
)
|
||||
|
|
2
setup.sh
2
setup.sh
|
@ -3,7 +3,7 @@
|
|||
sudo apt install xserver-xorg xinit
|
||||
sudo apt install libpangocairo-1.0-0
|
||||
sudo apt install python3-pip python3-xcffib python3-cairocffi
|
||||
sudo apt install rofi kitty xosd-bin flameshot xfce4-power-manager nm-applet
|
||||
sudo apt install rofi kitty xosd-bin flameshot xfce4-power-manager nm-applet apt-show-versions
|
||||
|
||||
sudo pip install qtile dbus-next
|
||||
|
||||
|
|
Loading…
Reference in New Issue