lemonbar: Move conky configs into modules
This commit is contained in:
@@ -72,14 +72,41 @@ def format_load(data, module, alert):
|
||||
return (d_v, u_v)
|
||||
|
||||
class ConkyFastModule(LemonModule):
|
||||
# TODO use internal python stuff for stuff like clock, then raise update interval
|
||||
conky_config = """
|
||||
conky.config = {
|
||||
background=false,
|
||||
update_interval=0.2,
|
||||
total_run_times=0,
|
||||
override_utf8_locale=true,
|
||||
short_units=true,
|
||||
uppercase=false,
|
||||
out_to_console=true,
|
||||
out_to_x=false,
|
||||
if_up_strictness='address',
|
||||
format_human_readable=true,
|
||||
}
|
||||
|
||||
conky.text = [[
|
||||
${time %a %d %b %H:%M:%S} \
|
||||
${exec ~/.i3/lemonbar/get_vol.sh} \
|
||||
${if_up wlp3s0}${downspeedf wlp3s0} ${upspeedf wlp3s0}\
|
||||
${else}down down${endif}\
|
||||
\
|
||||
${if_up enp5s0}${downspeedf enp2s0} ${upspeedf enp5s0}\
|
||||
${else}down down${endif}\
|
||||
\
|
||||
]]
|
||||
"""
|
||||
def __init__(self):
|
||||
self.show_secs = False
|
||||
super().__init__()
|
||||
|
||||
def _start_module(self):
|
||||
self.p_handle = subprocess.Popen(['conky', '-c', config.path+'conky_fast'],
|
||||
stdout=subprocess.PIPE, text=True)
|
||||
self.p_handle = subprocess.Popen(['conky', '-c', '-'],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
|
||||
self.p_handle.stdin.write(self.conky_config)
|
||||
self.p_handle.stdin.close() # Otherwise conky doesn't load
|
||||
self.status_handle = self.p_handle.stdout
|
||||
|
||||
self.wlan_load = parser.IconTextUnit('wlan_load', action='wlan', order=13)
|
||||
@@ -150,12 +177,39 @@ class ConkyFastModule(LemonModule):
|
||||
|
||||
class ConkySlowModule(LemonModule):
|
||||
|
||||
conky_config = """
|
||||
conky.config = {
|
||||
background=false,
|
||||
update_interval=5,
|
||||
total_run_times=0,
|
||||
override_utf8_locale=true,
|
||||
short_units=true,
|
||||
uppercase=false,
|
||||
out_to_console=true,
|
||||
out_to_x=false,
|
||||
if_up_strictness='address',
|
||||
format_human_readable=true,
|
||||
}
|
||||
|
||||
conky.text = [[
|
||||
${cpu} \
|
||||
${mem} \
|
||||
${fs_used_perc /} \
|
||||
${fs_used_perc /home} \
|
||||
F100 \
|
||||
100.00 \
|
||||
${exec /home/kuba/.i3/scripts/lang.sh show}
|
||||
]]
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def _start_module(self):
|
||||
self.p_handle = subprocess.Popen(['conky', '-c', config.path+'conky_slow'],
|
||||
stdout=subprocess.PIPE, text=True)
|
||||
self.p_handle = subprocess.Popen(['conky', '-c', '-'],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
|
||||
self.p_handle.stdin.write(self.conky_config)
|
||||
self.p_handle.stdin.close() # Otherwise conky doesn't load
|
||||
self.status_handle = self.p_handle.stdout
|
||||
|
||||
self.sys_load = parser.IconTextUnit('sys_load', action='load', order=10)
|
||||
|
||||
Reference in New Issue
Block a user