diff --git a/qtile/.config/qtile/bars.py b/qtile/.config/qtile/bars.py index b365143..8175114 100644 --- a/qtile/.config/qtile/bars.py +++ b/qtile/.config/qtile/bars.py @@ -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) diff --git a/qtile/.config/qtile/defines.py b/qtile/.config/qtile/defines.py index a489aab..a23512c 100644 --- a/qtile/.config/qtile/defines.py +++ b/qtile/.config/qtile/defines.py @@ -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'] \ No newline at end of file diff --git a/vim/.vim/plugged/lightline.vim b/vim/.vim/plugged/lightline.vim new file mode 160000 index 0000000..709b2d8 --- /dev/null +++ b/vim/.vim/plugged/lightline.vim @@ -0,0 +1 @@ +Subproject commit 709b2d8dc88fa622d6c076f34b05b58fcccf393f diff --git a/vim/.vim/plugged/nerdcommenter b/vim/.vim/plugged/nerdcommenter new file mode 160000 index 0000000..f02686f --- /dev/null +++ b/vim/.vim/plugged/nerdcommenter @@ -0,0 +1 @@ +Subproject commit f02686f2f60fd9cfb18976f12d791c2663cf17c8 diff --git a/vim/.vim/plugged/nerdtree b/vim/.vim/plugged/nerdtree new file mode 160000 index 0000000..14af897 --- /dev/null +++ b/vim/.vim/plugged/nerdtree @@ -0,0 +1 @@ +Subproject commit 14af89743ac1c31ff9bb43682025eda50333a7d5 diff --git a/vim/.vim/plugged/rainbow b/vim/.vim/plugged/rainbow new file mode 160000 index 0000000..4d15633 --- /dev/null +++ b/vim/.vim/plugged/rainbow @@ -0,0 +1 @@ +Subproject commit 4d15633cdaf61602e1d9fd216a77fc02e0881b2d diff --git a/vim/.vim/plugged/vim-fugitive b/vim/.vim/plugged/vim-fugitive new file mode 160000 index 0000000..7bcfe53 --- /dev/null +++ b/vim/.vim/plugged/vim-fugitive @@ -0,0 +1 @@ +Subproject commit 7bcfe539beee5fe8c542092732b6fd3786c6080e