save before rework

This commit is contained in:
paul-loedige
2020-12-08 17:05:33 +01:00
parent bad1f85b5d
commit 9a839e3589
7 changed files with 78 additions and 4 deletions
+44 -4
View File
@@ -1,9 +1,48 @@
# coding = utf-8
from libqtile import bar, widget
from libqtile.config import Click
import defines
#region custom_widgets
import psutil
class MemoryC(widget.base.ThreadedPollText):
orientations = widget.base.ORIENTATION_HORIZONTAL
defaults = [
("format", "{MemUsed}GB/{MemTotal}GB", "Formatting for field names."),
("update_interval", 1.0, "Update interval for the Memory"),
]
def __init__(self, **config):
super().__init__(**config)
self.add_defaults(MemoryC.defaults)
def tick(self):
self.update(self.poll())
return self.update_interval
def poll(self):
mem = psutil.virtual_memory()
swap = psutil.swap_memory()
val = {}
val["MemUsed"] = mem.used // 1024 // 1024 // 102.4 / 10
val["MemTotal"] = mem.total // 1024 // 1024 // 102.4 / 10
val["MemPercent"] = mem.percent
val["MemFree"] = mem.free // 1024 // 1024 // 102.4 / 10
val["Buffers"] = mem.buffers // 1024 // 1024 // 102.4 / 10
val["Active"] = mem.active // 1024 // 1024 // 102.4 / 10
val["Inactive"] = mem.inactive // 1024 // 1024 // 102.4 / 10
val["Shmem"] = mem.shared // 1024 // 1024 // 102.4 / 10
val["SwapTotal"] = swap.total // 1024 // 1024 // 102.4 / 10
val["Swapfree"] = swap.free // 1024 // 1024 // 102.4 / 10
val["SwapUsed"] = swap.used // 1024 // 1024 // 102.4 / 10
val["SwapPercent"] = swap.percent
return self.format.format(**val)
#endregion
widget_defaults = dict(
font='sans',
fontsize=12,
fontsize=14,
padding=3,
)
extension_defaults = widget_defaults.copy()
@@ -17,9 +56,10 @@ main_bar = bar.Bar([
widget.Systray(),
widget.TextBox("Vol:"),
widget.Volume(),
widget.CPU(format='CPU: {freq_max}GHz {load_percent}%'),
widget.Memory(format='RAM: {MemUsed}MB'),
widget.Memory(format='Swap: {SwapUsed}MB'),
widget.CheckUpdates(),
widget.CPU(format='CPU: {load_percent}% @ {freq_current}GHz'),
MemoryC(format="RAM: {MemUsed}GB ({MemPercent}%)"),
MemoryC(format="Swap: {SwapUsed}GB ({SwapPercent}%)"),
widget.NetGraph(),
widget.Clock(format='%Y-%m-%d %H:%M'),
],24)
+29
View File
@@ -2,3 +2,32 @@ term = 'termite'
focus_color = '#bd93f9'
border_width = 2
mod = 'mod4'
foreground_color = ['#f8f8f2','#f8f8f2']
background_color0 = ['#000000','#000000']
background_color8 = ['#4d4d4d','#4d4d4d']
# red
red_color1 = ['#ff5555','#ff5555']
red_color9 = ['#ff6e67','#ff6e67']
# green
green_color2 = ['#50fa7b','#50fa7b']
green_color10 = ['#5af78e','#5af78e']
# yellow
yellow_color3 = ['#f1fa8c','#f1fa8c']
yellow_color11 = ['#f4f99d','#f4f99d']
# blue
blue_color4 = ['#bd93f9','#bd93f9']
blue_color12 = ['#caa9fa','#caa9fa']
# magenta
magenta_color5 = ['#ff79c6','#ff79c6']
magenta_color13 = ['#ff92d0','#ff92d0']
# cyan
cyan_color6 = ['#8be9fd','#8be9fd']
cyan_color14 = ['#9aedfe','#9aedfe']
# white
white_color7 = ['#bfbfbf','#bfbfbf']
white_color15 = ['#e6e6e6','#e6e6e6']
Submodule vim/.vim/plugged/lightline.vim added at 709b2d8dc8
Submodule vim/.vim/plugged/nerdcommenter added at f02686f2f6
Submodule vim/.vim/plugged/nerdtree added at 14af89743a
Submodule vim/.vim/plugged/rainbow added at 4d15633cda
Submodule vim/.vim/plugged/vim-fugitive added at 7bcfe539be