Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'cairo'
- function conky_draw_lines()
- local updates=conky_parse('${updates}')
- update_num=tonumber(updates)
- if update_num > 5 then
- if conky_window==nil then return end
- local w=conky_window.width
- local h=conky_window.height
- local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
- cr=cairo_create(cs)
- cairo_select_font_face (cr, "DejaVuSans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
- cairo_set_font_size (cr, 12.0);
- --Line 1 settings
- local a_arg=conky_parse('${exec $HOME/.conky/vol.sh}')
- local a_thick=10
- local a_red=1
- local a_green=0.5
- local a_blue=0
- local a_alpha=1
- local a_start=25
- --line 1 settings end
- local a_num=tonumber(a_arg)
- --line 1 background
- cairo_set_source_rgba (cr, a_red, a_green, a_blue, 0.5);
- cairo_set_line_width (cr, a_thick);
- cairo_move_to (cr, a_start, a_start);
- cairo_rel_line_to (cr, 0 , 100);
- cairo_stroke (cr);
- --line 1 indicator
- cairo_set_source_rgba (cr, a_red, a_green, a_blue, a_alpha);
- cairo_set_line_width (cr, a_thick);
- cairo_move_to (cr, a_start, 125);
- cairo_rel_line_to (cr, 0 ,0-a_num);
- cairo_stroke (cr);
- --line 1 title
- cairo_set_source_rgba (cr, a_red, a_green, a_blue, a_alpha);
- cairo_move_to (cr, 0 , 140);
- cairo_show_text (cr, "Volumen");
- end
- end
- function conky_vol_bar()
- conky_draw_lines()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement