back_backups.conkyrc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. conky.config = {
  2. -- Window settings
  3. own_window = true,
  4. own_window_type = 'override',
  5. own_window_class = 'Conky',
  6. own_window_hints = undecorated,below,sticky,skip_taskbar,skip_pager,
  7. double_buffer = true,
  8. -- Compton doesn't like conky transparent, so this is the fix
  9. -- http://conky.pitstop.free.fr/wiki/index.php5?title=Transparency_in_conky_(en)
  10. own_window_transparent = false,
  11. own_window_argb_visual = true,
  12. own_window_argb_value = 0,
  13. -- fiddle with window
  14. use_spacer = 'none',
  15. use_xft = true,
  16. -- Update interval in seconds
  17. update_interval = 60.0,
  18. -- Draw shades?
  19. draw_shades = false,
  20. -- Text stuff
  21. draw_outline = false, -- # amplifies text if true
  22. draw_borders = false,
  23. font = 'PragmataPro:size=7',
  24. uppercase = false,
  25. -- Default colors and also border colors, grey90 == #e5e5e5
  26. default_color = 'grey',
  27. -- Text alignment, other possible values are commented
  28. -- #alignment = 'top_left',
  29. alignment = 'top_right',
  30. -- #alignment = 'bottom_left',
  31. -- #alignment = 'bottom_right',
  32. -- Gap between borders of screen and text
  33. -- The default size is a bit large
  34. gap_x = 10,
  35. gap_y = 10,
  36. -- Set monitor
  37. -- 0 for main/primary?
  38. xinerama_head = 0,
  39. }
  40. --[[
  41. -- This summarizes the backup pass/fail state.
  42. -- Written to display 'fail' if periodicity not in log, though will look odd.
  43. -- For some reason 'monthly' can't be regexed... though it worked before fixing fail state.
  44. -- As such, 'month' is intentional.
  45. ]]
  46. conky.text = [[
  47. $color
  48. ${color grey90}Backups ${hr 2}$color
  49. ${exec awk -v count=$(wc -l < $HOME/.config/borg/log) 'BEGIN {PASS=0; LC=0; LPASS=0} {if($3=="done"){LPASS="☑ " $4 " " $1 " " $2}; if(NR > count-6){if($3=="done"){PASS=1}};++LC} END {if(PASS==0){print LPASS}}' $HOME/.config/borg/log}
  50. ${exec awk -v count=$(wc -l < $HOME/.config/borg/log) '{if(NR > count-6){if($3=="done"){print "☑",$3,$1,$2} else {print "⚠",$4,$1,$2}}};' $HOME/.config/borg/log}
  51. ]];