adds generator function for info bar borders
This commit is contained in:
parent
14a62b39ce
commit
ea5ffd79e9
1 changed files with 53 additions and 103 deletions
|
|
@ -10,12 +10,14 @@ from libqtile import layout, bar, widget, hook
|
|||
from libqtile.lazy import lazy
|
||||
from libqtile.utils import guess_terminal
|
||||
from typing import List # noqa: F401from typing import List # noqa: F401
|
||||
from volume import Volume
|
||||
|
||||
|
||||
from qutils import get_num_screens
|
||||
|
||||
mod = "mod4" # Sets mod key to SUPER/WINDOWS
|
||||
myTerm = "alacritty" # My terminal of choice
|
||||
myBrowser = "qutebrowser" # My browser of choice
|
||||
myBrowser = "firefox" #"qutebrowser" # My browser of choice
|
||||
|
||||
class Colors:
|
||||
bg = ["#282828", "#3c3836"] #background
|
||||
|
|
@ -163,6 +165,23 @@ widget_defaults = dict(
|
|||
)
|
||||
extension_defaults = widget_defaults.copy()
|
||||
|
||||
def widget_border(color_l, color_r, symbol=None):
|
||||
border = [widget.TextBox(
|
||||
text = u'\ue0be',
|
||||
background = color_l,
|
||||
foreground = color_r,
|
||||
padding = 0,
|
||||
fontsize = 26)]
|
||||
if symbol:
|
||||
border.append(widget.TextBox(
|
||||
text = symbol,
|
||||
foreground = Colors.bg,
|
||||
background = color_r,
|
||||
fontsize = 16,
|
||||
width = 15,
|
||||
))
|
||||
return border
|
||||
|
||||
def init_widgets_list():
|
||||
widgets_list = [
|
||||
# widget.Image(
|
||||
|
|
@ -228,9 +247,9 @@ def init_widgets_list():
|
|||
text = u'\ue0be',
|
||||
background = Colors.bg,
|
||||
foreground = Colors.yellow,
|
||||
padding = 0,
|
||||
fontsize = 26,
|
||||
width = 24
|
||||
padding = 0,
|
||||
# width = 24
|
||||
),
|
||||
widget.Battery(
|
||||
battery = 0,
|
||||
|
|
@ -243,143 +262,74 @@ def init_widgets_list():
|
|||
format = '{char} {percent:2.0%} {hour:d}:{min:02d}',
|
||||
background = Colors.yellow,
|
||||
foreground = Colors.bg,
|
||||
padding = 5,
|
||||
),
|
||||
# widget.Battery(
|
||||
# battery = 1,
|
||||
# fmt = ' {}',
|
||||
# charge_char = u'\uf583',
|
||||
# discharge_char = u'\uf57d',
|
||||
# empty_char = u'\uf582',
|
||||
# full_char = u'\uf578',
|
||||
# unknown_char = u'\uf590',
|
||||
# format = '{char} {percent:2.0%} {hour:d}:{min:02d}',
|
||||
# background = Colors.yellow,
|
||||
# foreground = Colors.bg,
|
||||
# ),
|
||||
# widget.Net(
|
||||
# interface = "enp0s31f6",
|
||||
# format = '{down} ↓↑ {up}',
|
||||
# prefix='M',
|
||||
# foreground = Colors.bg,
|
||||
# background = Colors.yellow,
|
||||
# ),
|
||||
widget.TextBox(
|
||||
text = u'\ue0be',
|
||||
widget.Battery(
|
||||
battery = 1,
|
||||
fmt = ' {}',
|
||||
charge_char = u'\uf583',
|
||||
discharge_char = u'\uf57d',
|
||||
empty_char = u'\uf582',
|
||||
full_char = u'\uf578',
|
||||
unknown_char = u'\uf590',
|
||||
format = '{char} {percent:2.0%} {hour:d}:{min:02d}',
|
||||
background = Colors.yellow,
|
||||
foreground = Colors.orange,
|
||||
padding = 0,
|
||||
fontsize = 26,
|
||||
width = 24
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u"\uf8c7",
|
||||
foreground = Colors.bg,
|
||||
background = Colors.orange,
|
||||
fontsize = 14
|
||||
padding = 5,
|
||||
),
|
||||
*widget_border(Colors.yellow, Colors.orange, u"\uf8c7"),
|
||||
widget.ThermalSensor(
|
||||
foreground = Colors.bg,
|
||||
background = Colors.orange,
|
||||
threshold = 90,
|
||||
fmt = ' {}',
|
||||
padding = 5,
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u'\ue0be',
|
||||
background = Colors.orange,
|
||||
foreground = Colors.red,
|
||||
padding = 0,
|
||||
fontsize = 26,
|
||||
width = 24
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u"\uf546",
|
||||
foreground = Colors.bg,
|
||||
background = Colors.red,
|
||||
fontsize = 16
|
||||
),
|
||||
*widget_border(Colors.orange,Colors.red,u"\uf546"),
|
||||
widget.CheckUpdates(
|
||||
update_interval = 1800,
|
||||
distro = "Ubuntu",
|
||||
distro = "Arch",
|
||||
display_format = " {updates}",
|
||||
no_update_string = " 0",
|
||||
foreground = Colors.bg,
|
||||
colour_have_updates = Colors.bg,
|
||||
colour_no_updates = Colors.bg,
|
||||
# mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e sudo apt upgrade')},
|
||||
background = Colors.red
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u'\ue0be',
|
||||
background = Colors.red,
|
||||
foreground = Colors.purple,
|
||||
padding = 0,
|
||||
fontsize = 26,
|
||||
width = 24
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u"\uf85a",
|
||||
foreground = Colors.bg,
|
||||
background = Colors.purple,
|
||||
fontsize = 20
|
||||
padding = 5,
|
||||
),
|
||||
*widget_border(Colors.red,Colors.purple,u"\uf85a"),
|
||||
widget.Memory(
|
||||
foreground = Colors.bg,
|
||||
background = Colors.purple,
|
||||
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e htop')},
|
||||
fmt = '{}',
|
||||
format = '{MemPercent:5.1f} %',
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u'\ue0be',
|
||||
background = Colors.purple,
|
||||
foreground = Colors.blue,
|
||||
padding = 0,
|
||||
fontsize = 26,
|
||||
width = 24
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u"\ufb19",
|
||||
foreground = Colors.bg,
|
||||
background = Colors.blue,
|
||||
fontsize = 18
|
||||
format = '{MemPercent:4.1f}%',
|
||||
padding = 5,
|
||||
),
|
||||
*widget_border(Colors.purple,Colors.blue,u"\ufb19"),
|
||||
widget.CPU(
|
||||
foreground = Colors.bg,
|
||||
background = Colors.blue,
|
||||
fmt = '{}',
|
||||
format = '{load_percent:5.1f}%',
|
||||
format = '{load_percent:4.1f}%',
|
||||
padding = 5,
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u'\ue0be',
|
||||
background = Colors.blue,
|
||||
foreground = Colors.aqua,
|
||||
padding = 0,
|
||||
fontsize = 26,
|
||||
width = 24
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u"\uf026",
|
||||
*widget_border(Colors.blue,Colors.aqua),#u"\uf026"
|
||||
widget.Net(
|
||||
interface = "wlan0",
|
||||
format = '{down} ↓↑ {up}',
|
||||
prefix='M',
|
||||
foreground = Colors.bg,
|
||||
background = Colors.aqua,
|
||||
fontsize = 20
|
||||
),
|
||||
widget.Volume(
|
||||
foreground = Colors.bg,
|
||||
background = Colors.aqua,
|
||||
fmt = '{}',
|
||||
),
|
||||
widget.TextBox(
|
||||
text = u'\ue0be',
|
||||
background = Colors.aqua,
|
||||
foreground = Colors.green,
|
||||
padding = 0,
|
||||
fontsize = 26,
|
||||
width = 24
|
||||
padding = 5,
|
||||
),
|
||||
*widget_border(Colors.aqua,Colors.green),
|
||||
widget.Clock(
|
||||
foreground = Colors.bg,
|
||||
background = Colors.green,
|
||||
format = "%Y-%m-%d %a %H:%M ",
|
||||
padding = 5
|
||||
padding = 5,
|
||||
),
|
||||
]
|
||||
return widgets_list
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue