-- vim: ts=4 sw=4 noet ai cindent syntax=lua -- ------------------------------------------------------------------ -- -- Description: unified config for standalone conky lemonbar -- Created by: Epsi Nurwijayadi =55}\ ]] .. _h.value('${acpitemp}°C', ci.bad) .. [[ ${endif}${endif}${endif}\ ]] return _h.compose('', 'CPU', cputemp, colorBg) end -- Network function parts.network(colorBg) local download = _h.icon('') .. [[\ ${if_match ${downspeedf ]] .. wlandev .. [[}<1000}\ ]] .. _h.value('${downspeed ' .. wlandev .. '}', ci.good) .. [[ ${else}${if_match ${downspeedf ]] .. wlandev .. [[}<3000}\ ]] .. _h.value('${downspeed ' .. wlandev .. '}', ci.degraded) .. [[ ${else}${if_match ${downspeedf ]] .. wlandev .. [[}>=3000}\ ]] .. _h.value('${downspeed ' .. wlandev .. '}', ci.bad) .. [[ ${endif}${endif}${endif}\ ]] local upload = _h.icon('') .. [[\ ${if_match ${upspeedf ]] .. wlandev .. [[}<300}\ ]] .. _h.value('${upspeed ' .. wlandev .. '}', ci.good) .. [[ ${else}${if_match ${upspeedf ]] .. wlandev .. [[}<800}\ ]] .. _h.value('${upspeed ' .. wlandev .. '}', ci.degraded) .. [[ ${else}${if_match ${upspeedf ]] .. wlandev .. [[}>=800}\ ]] .. _h.value('${upspeed ' .. wlandev .. '}', ci.bad) .. [[ ${endif}${endif}${endif}\ ]] return _h.compose(nil, nil, download .. upload, colorBg) end -- Memory function parts.memory(colorBg) local memory = [[\ ${if_match ${memperc}<30}\ ]] .. _h.value('${memeasyfree}', ci.good) .. [[ ${else}${if_match ${memperc}<70}\ ]] .. _h.value('${memeasyfree}',ci.degraded) .. [[ ${else}${if_match ${memperc}>=70}\ ]] .. _h.value('${memeasyfree}', ci.bad) .. [[ ${endif}${endif}${endif}\ ]] return _h.compose('', 'MEM', memory, colorBg) end -- CPU 0 function parts.cpu0(colorBg) local cpu0 = [[\ ${if_match ${cpu cpu0}<50}\ ]] .. _h.value('${cpu cpu0}%', ci.good) .. [[ ${else}${if_match ${cpu cpu0}<60}\ ]] .. _h.value('${cpu cpu0}%',ci.degraded) .. [[ ${else}${if_match ${cpu cpu0}<=100}\ ]] .. _h.value('${cpu cpu0}%', ci.bad) .. [[ ${endif}${endif}${endif}\ ]] return _h.compose('', 'CPU', cpu0, colorBg) end -- Battery function parts.battery(colorBg) local battery = [[\ ${if_match ${battery_percent}<30}\ ]] .. _h.value('${battery_percent}%', ci.bad) .. [[ ${else}${if_match ${battery_percent}<70}\ ]] .. _h.value('${battery_percent}%', ci.degraded) .. [[ ${else}${if_match ${battery_percent}>=70}\ ]] .. _h.value('${battery_percent}%', ci.good) .. [[ ${endif}${endif}${endif}\ ]] return _h.compose('', 'Battery', battery, colorBg) end -- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- --- -- assembly --[[ disabled = '' -- .. parts.host (colBlue400) -- .. parts.volume (colBlue300) -- .. parts.separator (colBlue300, colGreen400, colBlue500) -- .. parts.battery (colBlue400) -- .. parts.mem (colBlue400) -- .. parts.ssid (colBlue400) -- .. parts.network (colBlue400) -- .. parts.mpd (colBlue400) -- .. parts.date (colBlue400) -- .. parts.time (colBlue400) -- .. parts.machine (colBlue400) enabled = '' .. parts.uptime (colGreen400) .. parts.separator (colGreen400, colBlue500, colGreen200) .. parts.cpu0 (colBlue500) .. parts.separator (colBlue500, colGreen500, colBlue300) .. parts.cputemp (colGreen500) .. parts.separator (colGreen500, colBlue400, colGreen300) .. parts.memory (colBlue400) ]] -- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- --- -- main -- shortcut local _h = helper lf = helper.lemonForeground lb = helper.lemonBackground la = helper.lemonBackgroundAlpha lu = helper.lemonUnderline lr = helper.lemonReset conky.text = [[\ %{l}\ ]] .. lr() .. lf(colRed500) .. [[ \ ]] .. parts.uptime () .. [[\ %{c}\ ]] .. lr() .. [[\ ]] -- .. enabled .. parts.battery () .. parts.cpu0 () .. parts.cputemp () .. parts.memory () .. parts.volume () .. lr() .. [[\ %{r}\ ]] .. lr() .. [[\ ]] .. parts.host () .. [[\ ]] .. lf(colRed500) .. [[ \ ]]