.conkyrc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. -- -*- mode: lua; -*-
  2. conky.config = {
  3. out_to_x = false,
  4. background = false,
  5. cpu_avg_samples = 2,
  6. net_avg_samples = 2,
  7. no_buffers = true,
  8. out_to_console = true,
  9. out_to_stderr = false,
  10. extra_newline = false,
  11. update_interval = 1.0,
  12. uppercase = false,
  13. use_spacer = left,
  14. times_in_seconds = true,
  15. };
  16. -- Colors are in dzen2 format.
  17. conky.text =
  18. [[^fg(grey)${time %a %d %b} \
  19. \
  20. ^fg(grey)CPU:^fg(DeepSkyBlue)$cpu% \
  21. ^fg(grey)RAM:^fg(DeepSkyBlue)${if_match ${to_bytes $memeasyfree} < 536870912}^fg(Red)${endif}$memperc% \
  22. ^fg(grey)↓^fg(DeepSkyBlue)${downspeedf ${gw_iface}} \
  23. ^fg(grey)↑^fg(DeepSkyBlue)${upspeedf ${gw_iface}} \
  24. ${if_match "${exec pactl list sinks | awk '/^\tMute:/ {print $2;exit}'}" == "no"}^fg(grey)♪^fg(DeepSkyBlue)${exec pactl list sinks | awk '/^\tVolume:/ {print $5;exit}'}${endif} \
  25. ${if_match $battery_percent != 0}^fg(grey)⚡^fg(DeepSkyBlue)${if_match ${battery_time} <= 600}^fg(Red)${endif}${battery_short}: ${format_time ${battery_time} "(\dd )(\hh )\mmin"} ${endif}\
  26. ${if_match ${to_bytes ${diskio nvme0n1}} > 1048576}^fg(grey)nvme0n1:^fg(DeepSkyBlue)${diskio nvme0n1}${endif} \
  27. ${if_match ${to_bytes ${diskio sda}} > 1048576}^fg(grey)sda:^fg(DeepSkyBlue)${diskio sda}${endif} \
  28. ${if_match ${to_bytes ${diskio sdb}} > 1048576}^fg(grey)sdb:^fg(DeepSkyBlue)${diskio sdb}${endif} \
  29. ${if_match ${to_bytes ${diskio sdc}} > 1048576}^fg(grey)sdc:^fg(DeepSkyBlue)${diskio sdc}${endif} \
  30. ${if_match ${to_bytes ${fs_free /}} < 1073741824}^fg(grey)/:^fg(Red)${fs_free /}${endif} \
  31. ${if_match ${to_bytes ${fs_free /home}} < 1073741824}^fg(grey)/home:^fg(Red)${fs_free /home}${endif} \
  32. ]]
  33. -- mu unread emails: This is treacherously distracting...
  34. -- ${if_existing .mu/}^fg(grey)✉^fg(DeepSkyBlue)${execi 30 mu find --nocolor --sortfield=d --maxnum=500 flag:unread AND NOT flag:trashed 2>/dev/null | wc -l} ${endif}\
  35. -- Unread mail with native 'new_mails' does not seem to support totals.
  36. -- Change color when e-mails are not 0?
  37. -- TODO: Emms current track:
  38. -- ${if_match "${execi 5 emacsclient -e '(and (fboundp (quote emms-playlist-current-selected-track)) (emms-playlist-current-selected-track) (emms-track-description (emms-playlist-current-selected-track)))'}" != "nil"}^fg(grey)♪^fg(DeepSkyBlue)${execi 5 emacsclient -e '(emms-track-description (emms-playlist-current-selected-track))' | tr -d '"'}${endif} \
  39. -- Above line works but polling interferes with bindings (Emacs echoes '<t>' on keypresses).
  40. -- TODO: Conditional display of network, sound.
  41. -- Probably need $lua+$eval for most of the TODOs.
  42. -- TODO: Calling pactl when pulseaudio is not running will fire it up, which can
  43. -- lead to a race condition when relogging: 4 pulseaudio processes will end up
  44. -- running.