Skip to content

Commit

Permalink
Try to make Conky config more readable 😥
Browse files Browse the repository at this point in the history
Spoiler alert: I failed. The syntax is very difficult to manage.
Templates don't support escaped newlines either.
  • Loading branch information
elamperti committed Nov 3, 2023
1 parent df2665f commit c38d915
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 126 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.conky]
indent_size = 2
indent_style = tab

[*.md]
# Markdown uses the trailing whitespaces
# https://daringfireball.net/projects/markdown/syntax#block
Expand Down
File renamed without changes.
128 changes: 128 additions & 0 deletions home/.config/conky/taskbar.conky
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
conky.config = {
-- Load helper functions
lua_load = '~/.config/conky/helpers.lua',
lua_draw_hook_pre = 'main',

--avoid flicker
double_buffer = true,

--own window to run 2 or more conkys simultaneously
own_window = true,
own_window_transparent = true,
own_window_type = 'override',
own_window_hints = 'undecorated,above,sticky,skip_taskbar,skip_pager',

--borders
border_inner_margin = 0,
border_outer_margin = 5,
draw_borders = false,
draw_graph_borders = true,
--shades
draw_shades = false,
--position
alignment = 'top_left',
gap_y = 4,
gap_x = 0,
--behaviour
update_interval = 0.5,
--colour
default_color = 'white',
--font
use_xft = true,

-- Force UTF8? note that UTF8 support required XFT
override_utf8_locale = true,
--to prevent window from moving
maximum_width = 1920,
minimum_width = 1920, minimum_height = 22,
default_graph_width = 20, default_graph_height = 100,
format_human_readable = true,
short_units = true,

-- Icon fonts
--font0 = 'System San Francisco Display:style=Bold:size=14',
font1 = 'System San Francisco Display:size=14',
font2 = 'System San Francisco Display:size=12',
font4 = 'System San Francisco Display:size=8',
font7 = 'Font Awesome 5 Free Solid:size=12',
font8 = 'Font Awesome 5 Free Solid:size=6',
font9 = 'Font Awesome 5 Free Solid:size=16',

-- Colors
color0 = '#DFDFDF',

-- Templates

-- 4) Network
template4 = [[${color 454545}${downspeedgraph \1 19,50 1F8729 1BC62C \2 -t}${offset 4}${color 454545}${upspeedgraph \1 19,50 547D93 57AAD6 \3 -t}]],
template5 = [[${goto 1470}${voffset -12}${color0}${font8} ${voffset -4}${color 70b273}${font4}${downspeedf \1} Kb${goto 1470}${voffset 12}${color0}${font8} ${voffset -3}${color 7ca2ba}${font4}${upspeedf \1} Kb]],
};

conky.text = [[
${if_running spotify}\
${if_match "0" == "${exec ~/.config/i3/scripts/spotify-now-playing.sh}"}\
${goto 410}\
${color0}${font7} \
${font2}${color gray}\
${voffset -5}\
${execi 2 ~/.config/i3/scripts/spotify-info.sh}\
${voffset 4}\
${endif}\
${endif}\
\
${goto 945}\
${voffset 2}\
${font System San Francisco Display:style=Bold:size=8}${color gray}${time %a} ${color}${time %d %b} \
${goto 938}\
${voffset -18}\
${font System San Francisco Display:style=Bold:size=14}${color}${time %H:%M}${color darkgray}:${time %S}\
\
${goto 1120}\
${voffset 6}${color0}${font9}\
${voffset -2}${color darkgray}\
${if_match ${memperc} > 65}\
${color FF0000}\
${endif}\
${font1}${memperc}%\
\
${goto 1100}${offset 105}\
${voffset 3}\
${color0}${font9} \
${if_existing /sys/class/net/enp4s0/operstate up} \
${goto 1330}\
${if_existing /sys/class/net/tun0/operstate up}\
${voffset -6}\
${color CF9933}${font7} \
${goto 1330}\
${voffset 11}\
${color C0BC9F}${font System San Francisco Display:style=bold:size=6}VPN\
${voffset -16}\
${else}\
${voffset -1}\
${color0}${font9} \
${endif}\
${goto 1356}\
${template4 enp4s0 16250000 9375000} \
${template5 enp4s0}\
${endif}\
\
${goto 1075}\
${color0}\
${voffset -14}\
${font Font Awesome 5 Pro Regular:size=8}\
${goto 1088}${font System San Francisco Display:style=bold:size=6}\
${if_match ${nvidia temp} > 65}\
${color FF0000}\
${endif}\
${nvidia temp}°C\
\
${goto 1076}\
${color0}\
${voffset 12}\
${font Font Awesome 5 Pro Light:size=7}\
${goto 1088}${font System San Francisco Display:style=bold:size=6}\
${if_match ${hwmon 3 temp 2} > 54}\
${color FF0000}\
${endif}\
${hwmon 3 temp 2}°C\
]];
Binary file added home/.config/conky/taskbar.conky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
126 changes: 0 additions & 126 deletions home/.config/i3/.conky

This file was deleted.

0 comments on commit c38d915

Please sign in to comment.