right bar restructuring (powerline style)
@@ -6,6 +6,7 @@ from libqtile import layout, bar, widget
|
|||||||
from libqtile.config import Key, Drag, Click, Group, Screen
|
from libqtile.config import Key, Drag, Click, Group, Screen
|
||||||
from libqtile.command import lazy
|
from libqtile.command import lazy
|
||||||
|
|
||||||
|
|
||||||
#region defines
|
#region defines
|
||||||
term = 'termite'
|
term = 'termite'
|
||||||
focus_color = '#bd93f9'
|
focus_color = '#bd93f9'
|
||||||
@@ -13,34 +14,29 @@ border_width = 2
|
|||||||
mod = 'mod4'
|
mod = 'mod4'
|
||||||
|
|
||||||
#region colors
|
#region colors
|
||||||
foreground_color = ['#f8f8f2','#f8f8f2']
|
light_foreground_color = ['#f8f8f2','#f8f8f2']
|
||||||
|
dark_foreground_color = ['#282a36','#282a36']
|
||||||
background_color0 = ['#000000','#000000']
|
background_color0 = ['#000000','#000000']
|
||||||
background_color8 = ['#4d4d4d','#4d4d4d']
|
background_color8 = ['#4d4d4d','#4d4d4d']
|
||||||
|
base_color = ['#101010','#101010']
|
||||||
# red
|
# red
|
||||||
red_color1 = ['#ff5555','#ff5555']
|
red_color = ['#df253f','#df253f']
|
||||||
red_color9 = ['#ff6e67','#ff6e67']
|
light_red_color = ['#ff5555','#ff5555']
|
||||||
# green
|
# green
|
||||||
green_color2 = ['#50fa7b','#50fa7b']
|
green_color = ['#53a93f','#53a93f']
|
||||||
green_color10 = ['#5af78e','#5af78e']
|
light_green_color = ['#50fa7b','#50fa7b']
|
||||||
|
#orange
|
||||||
|
orange_color = ['#f57900','#f57900']
|
||||||
# yellow
|
# yellow
|
||||||
yellow_color3 = ['#f1fa8c','#f1fa8c']
|
yellow_color = ['#f1fa8c','#f1fa8c']
|
||||||
yellow_color11 = ['#f4f99d','#f4f99d']
|
#blue
|
||||||
|
blue_color = ['#7197e7','#7197e7']
|
||||||
# blue
|
# purple
|
||||||
blue_color4 = ['#bd93f9','#bd93f9']
|
purple_color = ['#bd93f9','#bd93f9']
|
||||||
blue_color12 = ['#caa9fa','#caa9fa']
|
|
||||||
|
|
||||||
# magenta
|
# magenta
|
||||||
magenta_color5 = ['#ff79c6','#ff79c6']
|
magenta_color = ['#ff79c6','#ff79c6']
|
||||||
magenta_color13 = ['#ff92d0','#ff92d0']
|
|
||||||
|
|
||||||
# cyan
|
# cyan
|
||||||
cyan_color6 = ['#8be9fd','#8be9fd']
|
cyan_color = ['#8be9fd','#8be9fd']
|
||||||
cyan_color14 = ['#9aedfe','#9aedfe']
|
|
||||||
|
|
||||||
# white
|
|
||||||
white_color7 = ['#bfbfbf','#bfbfbf']
|
|
||||||
white_color15 = ['#e6e6e6','#e6e6e6']
|
|
||||||
#endregion
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -201,154 +197,223 @@ class MemoryC(widget.base.ThreadedPollText):
|
|||||||
return self.format.format(**val)
|
return self.format.format(**val)
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region widgets
|
||||||
|
|
||||||
|
#region Powerline
|
||||||
|
def powerline_arrow(direction, color1, color2,size):
|
||||||
|
if direction == "r":
|
||||||
|
return [
|
||||||
|
widget.TextBox(
|
||||||
|
text=u"\ue0b0",
|
||||||
|
foreground=color1,
|
||||||
|
background=color2,
|
||||||
|
fontsize=size,
|
||||||
|
borderwidth=0,
|
||||||
|
padding=0
|
||||||
|
),
|
||||||
|
widget.Sep(padding=5, linewidth=0, background=color2),
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
return [
|
||||||
|
widget.TextBox(
|
||||||
|
text=u"\ue0b2",
|
||||||
|
foreground=color2,
|
||||||
|
background=color1,
|
||||||
|
fontsize=size,
|
||||||
|
borderwidth=0,
|
||||||
|
padding=0
|
||||||
|
),
|
||||||
|
]
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Volume_widget
|
||||||
|
def vloume_widget(prev_color,color,size,fontsize):
|
||||||
|
return[
|
||||||
|
*powerline_arrow('l',prev_color,color,size),
|
||||||
|
widget.Volume(
|
||||||
|
foreground=dark_foreground_color,
|
||||||
|
background=color,
|
||||||
|
emoji=True,
|
||||||
|
fontsize=fontsize,
|
||||||
|
),
|
||||||
|
widget.Volume(
|
||||||
|
foreground=dark_foreground_color,
|
||||||
|
background=color,
|
||||||
|
fontsize=fontsize,
|
||||||
|
padding=0
|
||||||
|
),
|
||||||
|
widget.TextBox(" ",background=color),
|
||||||
|
]
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Pacman_widget
|
||||||
|
def pacman_widget(prev_color,color,size,fontsize):
|
||||||
|
return[
|
||||||
|
*powerline_arrow('l',prev_color,color,main_bar_height),
|
||||||
|
widget.Image(
|
||||||
|
filename='~/.config/qtile/icons/pacman.png',
|
||||||
|
margin=5,
|
||||||
|
background=color,
|
||||||
|
),
|
||||||
|
widget.CheckUpdates(
|
||||||
|
colour_have_updates=dark_foreground_color,
|
||||||
|
background=color,
|
||||||
|
fontsize=fontsize,
|
||||||
|
display_format="{updates}",
|
||||||
|
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e "sudo pacman -Syu"')},
|
||||||
|
),
|
||||||
|
]
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region System_widgets
|
||||||
|
def System_widgets(prev_color,last_color,size,fontsize):
|
||||||
|
return [
|
||||||
|
*powerline_arrow('l',prev_color,red_color,size),
|
||||||
|
widget.Image(
|
||||||
|
filename='~/.config/qtile/icons/temp.png',
|
||||||
|
margin=5,
|
||||||
|
background=red_color,
|
||||||
|
),
|
||||||
|
widget.ThermalSensor(
|
||||||
|
foreground=dark_foreground_color,
|
||||||
|
background=red_color,
|
||||||
|
fontsize=fontsize,
|
||||||
|
tag_sensor='Tctl',
|
||||||
|
),
|
||||||
|
*powerline_arrow('l',red_color,green_color,size),
|
||||||
|
widget.Image(
|
||||||
|
filename='~/.config/qtile/icons/cpu.png',
|
||||||
|
margin=5,
|
||||||
|
background=green_color,
|
||||||
|
),
|
||||||
|
widget.CPU(
|
||||||
|
foreground=dark_foreground_color,
|
||||||
|
background=green_color,
|
||||||
|
fontsize=fontsize,
|
||||||
|
format='{load_percent}% @ {freq_current}GHz',
|
||||||
|
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e htop')},
|
||||||
|
),
|
||||||
|
*powerline_arrow('l',green_color,orange_color,size),
|
||||||
|
widget.Image(
|
||||||
|
filename='~/.config/qtile/icons/ram.png',
|
||||||
|
background=orange_color,
|
||||||
|
margin=-10
|
||||||
|
),
|
||||||
|
MemoryC(
|
||||||
|
foreground=dark_foreground_color,
|
||||||
|
background=orange_color,
|
||||||
|
fontsize=fontsize,
|
||||||
|
format=" {MemUsed}GB({MemPercent}%) | {SwapUsed}GB({SwapPercent}%)",
|
||||||
|
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e htop')},
|
||||||
|
),
|
||||||
|
*powerline_arrow('l',orange_color,last_color,size),
|
||||||
|
widget.Image(
|
||||||
|
filename='~/.config/qtile/icons/network.png',
|
||||||
|
background=blue_color,
|
||||||
|
margin=5
|
||||||
|
),
|
||||||
|
widget.Net(
|
||||||
|
background=last_color,
|
||||||
|
foreground=dark_foreground_color,
|
||||||
|
fontsize=fontsize,
|
||||||
|
fmt='{:.9}',
|
||||||
|
format='{down}↓',
|
||||||
|
),
|
||||||
|
widget.Net(
|
||||||
|
background=last_color,
|
||||||
|
foreground=dark_foreground_color,
|
||||||
|
fontsize=fontsize,
|
||||||
|
fmt='{:.9}',
|
||||||
|
format='{up}↑',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region End_widgets
|
||||||
|
def end_widgets(prev_color,size,fontsize):
|
||||||
|
return [
|
||||||
|
*powerline_arrow('l',prev_color,magenta_color,size),
|
||||||
|
widget.Clock(
|
||||||
|
foreground=dark_foreground_color,
|
||||||
|
background=magenta_color,
|
||||||
|
fontsize=fontsize,
|
||||||
|
format='%Y-%m-%d'
|
||||||
|
),
|
||||||
|
*powerline_arrow('l',magenta_color,base_color,size),
|
||||||
|
widget.Clock(
|
||||||
|
font='dseg7 classic bold',
|
||||||
|
fontsize=16,
|
||||||
|
format='%H:%M'
|
||||||
|
),
|
||||||
|
]
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Bars and Widgets
|
#region Bars and Widgets
|
||||||
widget_defaults = dict(
|
widget_defaults = dict(
|
||||||
|
background=base_color,
|
||||||
font='Ubuntu Mono',
|
font='Ubuntu Mono',
|
||||||
fontsize=15,
|
fontsize=15,
|
||||||
padding=3,
|
padding=3,
|
||||||
)
|
)
|
||||||
extension_defaults = widget_defaults.copy()
|
extension_defaults = widget_defaults.copy()
|
||||||
|
|
||||||
main_bar_fontsize=20
|
main_bar_fontsize=22
|
||||||
|
main_bar_height=28
|
||||||
seperator=widget.Sep(linewidth=3,padding=10)
|
secondary_bar_height=24
|
||||||
|
secondary_bar_fontsize=18
|
||||||
|
|
||||||
main_bar = bar.Bar([
|
main_bar = bar.Bar([
|
||||||
widget.CurrentLayoutIcon(),
|
widget.CurrentLayoutIcon(),
|
||||||
widget.GroupBox(
|
widget.GroupBox(
|
||||||
fontsize=main_bar_fontsize,
|
fontsize=main_bar_fontsize,
|
||||||
urgent_border=red_color1,
|
urgent_border=red_color,
|
||||||
urgent_text=red_color1,
|
urgent_text=red_color,
|
||||||
this_current_screen_border=blue_color12,
|
this_current_screen_border=purple_color,
|
||||||
this_screen_border=blue_color12,
|
this_screen_border=purple_color,
|
||||||
),
|
),
|
||||||
|
widget.Image(
|
||||||
|
filename='~/.config/qtile/icons/archlinux-logo-small.png',
|
||||||
|
margin=5,
|
||||||
|
background=blue_color
|
||||||
|
),
|
||||||
|
*powerline_arrow('r',blue_color,base_color,main_bar_height),
|
||||||
widget.Prompt(fontsize=main_bar_fontsize),
|
widget.Prompt(fontsize=main_bar_fontsize),
|
||||||
widget.WindowName(fontsize=16),
|
widget.WindowName(fontsize=16),
|
||||||
widget.Systray(fontsize=main_bar_fontsize),
|
widget.Systray(fontsize=main_bar_fontsize),
|
||||||
seperator,
|
*vloume_widget(base_color,blue_color,main_bar_height,main_bar_fontsize),
|
||||||
widget.Volume(
|
*System_widgets(blue_color,blue_color,main_bar_height,main_bar_fontsize),
|
||||||
fontsize=main_bar_fontsize,
|
*pacman_widget(blue_color,red_color,main_bar_height,main_bar_fontsize),
|
||||||
foreground=cyan_color14,
|
*end_widgets(red_color,main_bar_height,main_bar_fontsize),
|
||||||
padding=0
|
],main_bar_height)
|
||||||
),
|
|
||||||
widget.Volume(
|
|
||||||
emoji=True,
|
|
||||||
fontsize=main_bar_fontsize,
|
|
||||||
foreground=cyan_color14,
|
|
||||||
padding=0
|
|
||||||
),
|
|
||||||
seperator,
|
|
||||||
widget.TextBox(
|
|
||||||
"ᗧ",
|
|
||||||
fonsize=main_bar_fontsize,
|
|
||||||
foreground=red_color1,
|
|
||||||
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e "sudo pacman -Sy"')},
|
|
||||||
),
|
|
||||||
widget.CheckUpdates(
|
|
||||||
fontsize=main_bar_fontsize,
|
|
||||||
display_format="{updates} Updates",
|
|
||||||
colour_have_updates=red_color1,
|
|
||||||
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e "sudo pacman -Syu"')},
|
|
||||||
),
|
|
||||||
seperator,
|
|
||||||
widget.CPU(
|
|
||||||
fontsize=main_bar_fontsize,
|
|
||||||
format='CPU: {load_percent}% @ {freq_current}GHz',
|
|
||||||
foreground=green_color10,
|
|
||||||
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e htop')},
|
|
||||||
),
|
|
||||||
seperator,
|
|
||||||
MemoryC(
|
|
||||||
fontsize=main_bar_fontsize,
|
|
||||||
format="RAM: {MemUsed}GB({MemPercent}%)",
|
|
||||||
foreground=blue_color12,
|
|
||||||
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e htop')},
|
|
||||||
),
|
|
||||||
MemoryC(
|
|
||||||
fontsize=main_bar_fontsize,
|
|
||||||
format="Swap: {SwapUsed}GB({SwapPercent}%)",
|
|
||||||
foreground=magenta_color13,
|
|
||||||
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(term + ' -e htop')},
|
|
||||||
),
|
|
||||||
seperator,
|
|
||||||
widget.NetGraph(
|
|
||||||
fontsize=main_bar_fontsize,
|
|
||||||
border_width=0.5,
|
|
||||||
line_width=2,
|
|
||||||
border_color=yellow_color11,
|
|
||||||
graph_color=yellow_color11
|
|
||||||
),
|
|
||||||
widget.Clock(
|
|
||||||
fontsize=main_bar_fontsize,
|
|
||||||
format='%Y-%m-%d'
|
|
||||||
),
|
|
||||||
widget.Clock(
|
|
||||||
font='dseg7 classic bold',
|
|
||||||
fontsize=16,
|
|
||||||
format='%H:%M'
|
|
||||||
),
|
|
||||||
],26)
|
|
||||||
|
|
||||||
#left bar
|
#left bar
|
||||||
left_bar = bar.Bar([
|
left_bar = bar.Bar([
|
||||||
widget.CurrentLayoutIcon(),
|
widget.CurrentLayoutIcon(),
|
||||||
widget.GroupBox(
|
widget.GroupBox(
|
||||||
urgent_border=red_color1,
|
urgent_border=red_color,
|
||||||
urgent_text=red_color1,
|
urgent_text=red_color,
|
||||||
this_current_screen_border=blue_color12,
|
this_current_screen_border=purple_color,
|
||||||
this_screen_border=blue_color12,
|
this_screen_border=purple_color,
|
||||||
),
|
),
|
||||||
widget.WindowName(),
|
widget.WindowName(),
|
||||||
seperator,
|
*vloume_widget(base_color,blue_color,secondary_bar_height,secondary_bar_fontsize),
|
||||||
widget.Volume(
|
*end_widgets(blue_color,secondary_bar_height,secondary_bar_fontsize)
|
||||||
foreground=cyan_color14,
|
],secondary_bar_height)
|
||||||
padding=0
|
|
||||||
),
|
|
||||||
widget.Volume(
|
|
||||||
emoji=True,
|
|
||||||
foreground=cyan_color14,
|
|
||||||
padding=0
|
|
||||||
),
|
|
||||||
seperator,
|
|
||||||
widget.Clock(
|
|
||||||
format='%Y-%m-%d'
|
|
||||||
),
|
|
||||||
widget.Clock(
|
|
||||||
font='dseg7 classic bold',
|
|
||||||
fontsize=12,
|
|
||||||
format='%H:%M'
|
|
||||||
),
|
|
||||||
],24)
|
|
||||||
|
|
||||||
top_bar = bar.Bar([
|
top_bar = bar.Bar([
|
||||||
widget.CurrentLayoutIcon(),
|
widget.CurrentLayoutIcon(),
|
||||||
widget.GroupBox(
|
widget.GroupBox(
|
||||||
urgent_border=red_color1,
|
urgent_border=red_color,
|
||||||
urgent_text=red_color1,
|
urgent_text=red_color,
|
||||||
this_current_screen_border=blue_color12,
|
this_current_screen_border=purple_color,
|
||||||
this_screen_border=blue_color12,
|
this_screen_border=purple_color,
|
||||||
),
|
),
|
||||||
widget.WindowName(),
|
widget.WindowName(),
|
||||||
seperator,
|
*vloume_widget(base_color,blue_color,secondary_bar_height,secondary_bar_fontsize),
|
||||||
widget.Volume(
|
*end_widgets(blue_color,secondary_bar_height,secondary_bar_fontsize)
|
||||||
foreground=cyan_color14,
|
],secondary_bar_height)
|
||||||
padding=0
|
|
||||||
),
|
|
||||||
widget.Volume(
|
|
||||||
emoji=True,
|
|
||||||
foreground=cyan_color14,
|
|
||||||
padding=0
|
|
||||||
),
|
|
||||||
seperator,
|
|
||||||
widget.Clock(
|
|
||||||
format='%Y-%m-%d'
|
|
||||||
),
|
|
||||||
widget.Clock(
|
|
||||||
font='dseg7 classic bold',
|
|
||||||
fontsize=12,
|
|
||||||
format='%H:%M'
|
|
||||||
),
|
|
||||||
],24)
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Screens
|
#region Screens
|
||||||
|
|||||||
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 753 B |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 9.7 KiB |