-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpu.lua
37 lines (29 loc) · 897 Bytes
/
gpu.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'cairo'
require './_main'
function conky_main ()
if conky_window == nil then
return
end
local surface = cairo_xlib_surface_create(
conky_window.display,
conky_window.drawable,
conky_window.visual,
conky_window.width,
conky_window.height)
local canvas = cairo_create(surface)
local width = 182
cairo_set_source_rgba(canvas, bg_red, bg_green, bg_blue, bg_alpha)
cairo_line_to(canvas, 0, 0)
cairo_line_to(canvas, conky_window.width, 0)
cairo_line_to(canvas, width, conky_window.height)
cairo_line_to(canvas, 0, conky_window.height)
cairo_fill(canvas)
cairo_set_source_rgba(canvas, br_red, br_green, br_blue, br_alpha)
cairo_line_to(canvas, 0, 0)
cairo_line_to(canvas, conky_window.width, 0)
cairo_line_to(canvas, width, conky_window.height)
cairo_line_to(canvas, 0, conky_window.height)
cairo_line_to(canvas, 0, 0)
cairo_stroke(canvas)
canvas = nil
end