• Stars
    star
    143
  • Rank 255,719 (Top 6 %)
  • Language
    Lua
  • License
    GNU General Publi...
  • Created over 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easily create beautiful conky graphs and draws

conky-draw

Easily create beautiful conky graphs and drawings.

The main idea is this: stop copying and pasting random code from the web to your monolithic conkyrc + something.lua. Start using a nicely defined set of visual elements, in a very clean config file, separated from the code that has the drawing logic. "You ask, conky_draw draws".

Also, Daguhh made a GUI to generate the configs! ConkyLuaMakerGUIv2

Examples

./samples/sample1.png

Simple disk usage.

{
    kind = 'bar_graph',
    conky_value = 'fs_used_perc /home/',
    from = {x = 0, y = 45},
    to = {x = 180, y = 45},
    background_thickness = 20,
    bar_thickness = 16,
},

./samples/sample2.png

Normal vs critical mode. You can even decide what changes when critical values are reached.

{
    kind = 'bar_graph',
    conky_value = 'fs_used_perc /home/',
    from = {x = 50, y = 120},
    to = {x = 120, y = 45},

    background_thickness = 5,
    background_color = 0x00E5FF,

    bar_thickness = 5,
    bar_color = 0x00E5FF,

    critical_threshold = 60,

    change_color_on_critical = true,
    change_thickness_on_critical = true,

    background_color_critical = 0xFFA0A0,
    background_thickness_critical = 10,

    bar_color_critical = 0xFF0000,
    bar_thickness_critical = 13
},

./samples/graduated_line_graph.jpg

Idem with graduation

{
    kind = 'bar_graph',
    conky_value = 'fs_used_perc /home/',
    from = {x = 50, y = 120},
    to = {x = 120, y = 45},

    background_thickness = 5,
    background_color = 0x00E5FF,

    bar_thickness = 5,
    bar_color = 0x00E5FF,

    critical_threshold = 60,

    change_color_on_critical = true,
    change_thickness_on_critical = true,

    background_color_critical = 0xFFA0A0,
    background_thickness_critical = 10,

    bar_color_critical = 0xFF0000,
    bar_thickness_critical = 13,

    graduated= true,
    number_graduation= 30,
    space_between_graduation=2,
},

./samples/sample3.png

Everybody loves ring graphs in conky.

{
    kind = 'ring_graph',
    conky_value = 'fs_used_perc /home/',
    center = {x = 75, y = 100},
    radius = 30,
},

./samples/graduated_ring.png

Ring with graduation

{
     kind = 'ring_graph',
     center = {x = 50, y = 50},
     conky_value = 'fs_used_perc /home/',
     radius = 30,
     graduated = true,
     number_graduation=40,
     angle_between_graduation=3,
     start_angle = 0,
     end_angle = 360,
     color= 0xFF6600,
     background_color= 0xD75600,
 },

./samples/sample4.png

Lord of the customized rings.

{
    kind = 'ring_graph',
    conky_value = 'fs_used_perc /home/',
    center = {x = 75, y = 100},
    radius = 30,

    background_color = 0xFFFFFF,
    background_alpha = 1,
    background_thickness = 35,

    bar_color = 0x00E5FF,
    bar_alpha = 1,
    bar_thickness = 15,
},

./samples/sample5.png

Or even ring fragments.

{
    kind = 'ring_graph',
    conky_value = 'fs_used_perc /home/',
    center = {x = 75, y = 100},
    radius = 30,

    background_color = 0xFFFFFF,
    background_alpha = 0.7,
    background_thickness = 2,

    bar_color = 0xFFFFFF,
    bar_alpha = 1,
    bar_thickness = 6,

    start_angle = 140,
    end_angle = 300,
},

./samples/ellipse.png

Simple and graduated ellipse_graph

{
     kind = 'ellipse_graph',
     center = {x = 10, y = 10},
     conky_value = 'fs_used_perc /home/',
     radius = 5,
     width= 10,
     height= 20,
     graduated = true,
     number_graduation=40,
     angle_between_graduation=3,
     start_angle = 0,
     end_angle = 360,
     color= 0xFF6600,
     background_color= 0xD75600,
 },

 {
     kind = 'ellipse_graph',
     center = {x = 30, y = 10},
     conky_value = 'fs_used_perc /home/',
     radius = 5,
     width= 10,
     height= 20,
     start_angle = 0,
     end_angle = 360,
     color= 0xFF6600,
     background_color= 0xD75600,
 },

Right now you can define bar and ring graphs, and static lines and rings. Plans for the future:

  • Draw text elements (on arbitrary positions/areas, not like traditional conkyrc).
  • More basic elements: filled circles, rectangles, ...
  • Other more complex visual elements (example: clocks)

Installation

  1. Copy both conky_draw.lua and conky_draw_config.lua to your .conky folder (your own conkyrc should be there too).
  2. Include this in your conkyrc:
lua_load ./conky_draw.lua
lua_draw_hook_post main

or this if you are using conky 1.10 or newer:

conky.config = {
    -- (...)

    lua_load = 'conky_draw.lua',
    lua_draw_hook_pre = 'main',
};
  1. Customize the conky_draw_config.lua file as you wish. You just need to add elements in the elements variable (examples above).
  2. Be sure to run conky from inside your .conky folder. Example: cd .conky && conky -c conkyrc

Full list of available elements and their properties

Properties marked as required must be defined by you. The rest have default values, you can leave them undefined, or define them with the values you like.

But first, some general notions on the values of properties.

If the property is a... This is what you should know
point Its value should be something with x and y values. Example: from = {x=100, y=100}
color Its value should be a color in hexa. Example (red): color = 0xFF0000
alpha level Its value should be a transpacency level from 0 (fully transparent) to 1 (solid, no transpacency). Example: alpha = 0.2
angle Its value should be expresed in degrees. Angle 0 is east, angle 90 is south, angle 180 is west, and angle 270 is north. Example: start_angle = 90
thickness Its value should be the thickness in pixels. Example: thickness = 5
conky value Its value should be a string of a conky value to use, and when used for graphs, should be something that yields a number. All the possible conky values are listed here. Example: conky_value = 'upspeedf eth0'
max value It should be maximum possible value for the conky value used in a graph. It's needed to calculate the length of the bars in the graphs, so be sure it's correct (for cpu usage values it's 100, for network speeds it's your top speed, etc.). Example: max_value = 100
critical threshold It should be the value at which the graph should change appearance. If you don't want that, just leave it equal to max_value to disable appearance changes. Example: critical_threshold = 90
boolean It should be either true or false, with no quotes. Example: change_color_on_critical = true

Now, the elements and properties

line:

A simple straight line from point A to point B.
from (required) A point where the line should start.
to (required) A point where the line should end.
color Color of the line.
alpha Transpacency level of the line.
thickness Thickness of the line.
graduated specify if the element is graduated.
number_graduation specify the number of graduation.
space_between_graduation specify the space between graduation.

bar_graph:

A bar graph, able to display a value from conky, and optionaly able to change appearance when the value hits a "critical" threshold. It's composed of two lines (rectangles), one for the background, and the other to represent the current value of the conky stat.
from (required) A point where the bar graph should start.
to (required) A point where the bar graph should end.
conky_value (required) Conky value to use on the graph.
max_value and critical_threshold For the conky value being used on the graph.
background_color, background_alpha and background_thickness For the appearance of the background of the graph in normal conditions.
bar_color, bar_alpha and bar_thickness For the appearance of the bar of the graph in normal conditions.
change_color_on_critical, change_alpha_on_critical and change_thickness_on_critical Booleans to control wether the color, alpha and thickness of both background and bar changes when the critical value is reached.
background_color_critical, background_alpha_critical and background_thickness_critical For the appearance of the background of the graph when the value is above critical threshold.
bar_color_critical, bar_alpha_critical and bar_thickness_critical For the appearance of the bar of the graph when the value is above critical threshold.
graduated specify if the element is graduated.
number_graduation specify the number of graduation.
space_between_graduation specify the space between graduation.

ring:

A simple ring (can be a section of the ring too).
center (required) The center point of the ring.
radius (required) The radius of the ring.
color Color of the ring.
alpha Transpacency level of the ring.
thickness Thickness of the ring.
start_angle Angle at which the arc starts. Useful to limit the ring to just a section of the circle.
end_angle Angle at which the arc ends. Useful to limit the ring to just a section of the circle.

Extra tip: start_angle and end_angle can be swapped, to produce oposite arcs. If you don't understand this, just try what happens with this two examples:

  • start_angle=90, end_angle=180
  • start_angle=180, end_angle=90
graduated specify if the element is graduated.
number_graduation specify the number of graduation.
angle_between_graduation specify the angle between graduation.

ring_graph:

A ring graph (can be a section of the ring too) able to display a value from conky, and optionaly able to change appearance when the value hits a "critical" threshold. It's composed of two rings, one for the background, and the other to represent the current value of the conky stat.
center (required) The center point of the ring.
radius (required) The radius of the ring.
conky_value (required) Conky value to use on the graph.
max_value and critical_threshold For the conky value being used on the graph.
background_color, background_alpha and background_thickness For the appearance of the background of the graph in normal conditions.
bar_color, bar_alpha and bar_thickness For the appearance of the bar of the graph in normal conditions.
change_color_on_critical, change_alpha_on_critical and change_thickness_on_critical Booleans to control wether the color, alpha and thickness of both background and bar changes when the critical value is reached.
background_color_critical, background_alpha_critical and background_thickness_critical For the appearance of the background of the graph when the value is above critical threshold.
bar_color_critical, bar_alpha_critical and bar_thickness_critical For the appearance of the bar of the graph when the value is above critical threshold.
start_angle Angle at which the arc starts. Useful to limit the ring to just a section of the circle.
end_angle Angle at which the arc ends. Useful to limit the ring to just a section of the circle.

Extra tip: start_angle and end_angle can be swapped, to produce oposite arcs. If you don't understand this, just try what happens with this two examples:

  • start_angle=90, end_angle=180
  • start_angle=180, end_angle=90
graduated specify if the element is graduated.
number_graduation specify the number of graduation.
angle_between_graduation specify the angle between graduation.

ellipse:

A simple ellipse (can be a section of the ring too).
center (required) The center point of the ellipse.
radius (required) The radius of the ellipse.
width (required) height (required) Define the rectangle which give the ellipse forme
color Color of the ellipse.
alpha Transpacency level of the ellipse.
thickness Thickness of the ellipse.
start_angle Angle at which the arc starts. Useful to limit the ellipse to just a section of the ellipse.
end_angle Angle at which the arc ends. Useful to limit the ellipse to just a section of the ellipse.

Extra tip: start_angle and end_angle can be swapped, to produce oposite arcs. If you don't understand this, just try what happens with this two examples:

  • start_angle=90, end_angle=180
  • start_angle=180, end_angle=90
graduated specify if the element is graduated.
number_graduation specify the number of graduation.
angle_between_graduation specify the angle between graduation.

ellipse_graph:

A ellipse graph (can be a section of the ring too) able to display a value from conky, and optionaly able to change appearance when the value hits a "critical" threshold. It's composed of two ellipse, one for the background, and the other to represent the current value of the conky stat.
center (required) The center point of the ellipse.
radius (required) The radius of the ellipse.
conky_value (required) Conky value to use on the graph.
width (required) height (required) Define the rectangle which give the ellipse forme
max_value and critical_threshold For the conky value being used on the graph.
background_color, background_alpha and background_thickness For the appearance of the background of the graph in normal conditions.
bar_color, bar_alpha and bar_thickness For the appearance of the bar of the graph in normal conditions.
change_color_on_critical, change_alpha_on_critical and change_thickness_on_critical Booleans to control wether the color, alpha and thickness of both background and bar changes when the critical value is reached.
background_color_critical, background_alpha_critical and background_thickness_critical For the appearance of the background of the graph when the value is above critical threshold.
bar_color_critical, bar_alpha_critical and bar_thickness_critical For the appearance of the bar of the graph when the value is above critical threshold.
start_angle Angle at which the arc starts. Useful to limit the ellipse to just a section of the ellipse.
end_angle Angle at which the arc ends. Useful to limit the ellipse to just a section of the ellipse.

Extra tip: start_angle and end_angle can be swapped, to produce oposite arcs. If you don't understand this, just try what happens with this two examples:

  • start_angle=90, end_angle=180
  • start_angle=180, end_angle=90
graduated specify if the element is graduated.
number_graduation specify the number of graduation.
angle_between_graduation specify the angle between graduation.

static_text:

Simple text
from (required) A point where the text should start.
text (required) Displayed text
color Color of the text.
rotation_angle Inclinaison of the text.
font font of the text. default =Liberation Sans
font_size set the size of the text.
bold Set the text in bold.
italic Set the text in italic.
alpha Transpacency level.

variable_text:

Variable text
from (required) A point where the text should start.
conky_value (required) Displayed text
color Color of the text.
rotation_angle Inclinaison of the text.
font font of the text. default =Liberation Sans
font_size set the size of the text.
bold Set the text in bold.
italic Set the text in italic.
alpha Transpacency level.

More Repositories

1

fisa-vim-config

my vim configuration (lot of python, autocompletition, fuzzy finder, debugger, ...)
Vim Script
1,460
star
2

vim-isort

Vim plugin to sort python imports using https://github.com/timothycrosley/isort
Vim Script
219
star
3

vim-ctrlp-cmdpalette

Extension for ctrlp.vim, to have a command palette like sublime text 2
Vim Script
110
star
4

world_cup_learning

Just because I wanted to win a bet, some machine learning about the fifa world cup :)
Python
83
star
5

virtualbackground

Fake webcam that replaces your background with a custom image
Python
76
star
6

fisa-nvim-config

my neovim configuration (lot of python, autocompletion, fuzzy finder, etc, ...)
Vim Script
63
star
7

ulauncher-better-file-browser

A nicer file browser, easier to navigate and with ability to open folders too
Python
39
star
8

zombsole

console zombie survival game
Python
35
star
9

grillo

A small tool to easily send data (files, clipboard) between computers with 0 config, just using audio and mic
Python
19
star
10

docs

Useful asorted docs
17
star
11

fisa-vim-colorscheme

soft color scheme for terminals with 256 colors
Vim Script
17
star
12

system-install

My system install scripts, to run after a clean ubuntu install
Shell
11
star
13

talks

my talks
Jupyter Notebook
9
star
14

simpyt

A very easy to use and configurable virtual deck
Python
9
star
15

simplestmaps

Super simple on-liner maps in python.
Python
8
star
16

sateye

A tool to track and visualize satellites in orbit
Python
6
star
17

ponytor

A small comand line utility and python lib to run automated things when files change
Python
6
star
18

tota

Terminal of the Ancients! Like Dota, but for programmers and running in a terminal
Python
6
star
19

python-basic-course

A basic python course, oriented to people who already develop software.
Jupyter Notebook
5
star
20

twistorpy

Twitter history backup tool
Python
4
star
21

pytalaya

A web based team state viewer
Python
3
star
22

mini-tools

Small tools for specific things I needed
Python
3
star
23

vim-debug.vim

This is not a project, just a workaround to be able to install jabapyth/vim-debug with vundle.
Vim Script
2
star
24

manuscriptminiatures-tagger

Automatic tagger of manuscript miniatures objects, using machine learning
Python
2
star
25

afa_cup_learning

In which I try to predict afa tournament results using machine learning
Python
2
star
26

vimja-python-complete

Vim python omnicomplete using the ninja-ide autocompletition
Vim Script
2
star
27

fisa-tmux-config

My personal tmux configuration
Shell
1
star
28

dpclient

simple command line dotproject client (with code from https://github.com/nqnwebs/h2dp)
Python
1
star
29

plankalkul

Solving a small programming challenge from Machinalis
Python
1
star
30

ejercicios

1
star
31

potato-glados-chrome-extension

A chrome extension for Portal 2 fans (a potato GLaDOS icon which says GLaDOS quotes)
JavaScript
1
star
32

chivalry-server-tools

Chivalry medieval warfare rcon client
Python
1
star
33

asiru

Ubuntu based linux live DVD with lots of python development tools working
Vim Script
1
star
34

chivalry

Here we save the configs from several different chivalry medieval warfare servers.
Shell
1
star
35

keras_experiments

Playing around with the keras neural networks lib
Jupyter Notebook
1
star
36

dcs-natops-based-av8bna-checklists

Checklists for the AV-8B Night Attack, in DCS, based on NATOPS manuals. NOT FOR REAL PLANE USE
1
star