├── wallpaper.png ├── start_conky.sh ├── .conky ├── dropbox │ └── get_quota.py ├── simple.conky ├── filesystem.conky ├── drive │ └── get_quota.py └── conky_simple.lua ├── README.md └── wallpaper.svg /wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fpczk/conky-simple/HEAD/wallpaper.png -------------------------------------------------------------------------------- /start_conky.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | conky -c ~/.conky/simple.conky & 4 | conky -c ~/.conky/filesystem.conky & 5 | -------------------------------------------------------------------------------- /.conky/dropbox/get_quota.py: -------------------------------------------------------------------------------- 1 | import dropbox 2 | 3 | access_token = "..." 4 | 5 | client = dropbox.client.DropboxClient(access_token) 6 | quota = client.account_info()[u'quota_info'] 7 | perc = (100 * (quota[u'normal'] + quota[u'shared'])) / quota[u'quota'] 8 | print perc 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # conky-simple 2 | 3 | Conky setup for a minimalistic desktop. 4 | 5 | ![Screenshot](https://i.redd.it/1oq0vr3hmpty.png) 6 | 7 | ## Setup 8 | 9 | * Copy the .conky folder to ~/.conky 10 | * Apply the attached wallpaper 11 | * For Dropbox support: Insert your access_token in .conky/dropbox/get_quota.py 12 | * For Google Drive support: Download your secret key file and move it to ~/.conky/drive/client_secret.json 13 | * Run the commands given in start_conky.sh 14 | -------------------------------------------------------------------------------- /.conky/simple.conky: -------------------------------------------------------------------------------- 1 | conky.config = { 2 | update_interval=3, 3 | background=false, 4 | text_buffer_size=2048, 5 | double_buffer=true, 6 | no_buffers=true, 7 | use_xft=true, 8 | font='monospace:pixelsize=11', 9 | draw_shades=false, 10 | override_utf8_locale=true, 11 | own_window=true, 12 | own_window_type='normal', 13 | own_window_class='Conky', 14 | own_window_transparent=true, 15 | own_window_hints='undecorated,below,sticky,skip_taskbar,skip_pager', 16 | own_window_colour='#000000', 17 | own_window_argb_visual = true, 18 | own_window_argb_value = 0, 19 | draw_graph_borders=false, 20 | minimum_width = 1680, minimum_height = 1050, 21 | alignment = 'top_left', 22 | gap_x = 0, 23 | gap_y = 0, 24 | default_color = '#494b5a', 25 | lua_load = '~/.conky/conky_simple.lua', 26 | lua_draw_hook_pre = 'conky_main' 27 | }; 28 | 29 | conky.text = [[ 30 | ]]; 31 | -------------------------------------------------------------------------------- /.conky/filesystem.conky: -------------------------------------------------------------------------------- 1 | conky.config = { 2 | update_interval=1800, 3 | background=false, 4 | text_buffer_size=2048, 5 | double_buffer=true, 6 | no_buffers=true, 7 | use_xft=true, 8 | font='monospace:pixelsize=11', 9 | draw_shades=false, 10 | override_utf8_locale=true, 11 | own_window=true, 12 | own_window_type='normal', 13 | own_window_class='Conky', 14 | own_window_transparent=true, 15 | own_window_hints='undecorated,below,sticky,skip_taskbar,skip_pager', 16 | own_window_colour='#000000', 17 | own_window_argb_visual = true, 18 | own_window_argb_value = 0, 19 | draw_graph_borders=false, 20 | minimum_width = 1680, minimum_height = 1050, 21 | alignment = 'top_left', 22 | gap_x = 0, 23 | gap_y = 0, 24 | default_color = '#494b5a', 25 | lua_load = '~/.conky/conky_simple.lua', 26 | lua_draw_hook_pre = 'conky_fs_main' 27 | }; 28 | 29 | conky.text = [[ 30 | ]]; 31 | -------------------------------------------------------------------------------- /.conky/drive/get_quota.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import httplib2 3 | import os 4 | 5 | from apiclient import discovery 6 | from oauth2client import client 7 | from oauth2client import tools 8 | from oauth2client.file import Storage 9 | 10 | try: 11 | import argparse 12 | flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args() 13 | except ImportError: 14 | flags = None 15 | 16 | # If modifying these scopes, delete your previously saved credentials 17 | # at ~/.credentials/drive-python-quickstart.json 18 | SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly' 19 | CLIENT_SECRET_FILE = '~/.conky/drive/client_secret.json' 20 | APPLICATION_NAME = 'Drive API' 21 | 22 | 23 | def get_credentials(): 24 | """Gets valid user credentials from storage. 25 | 26 | If nothing has been stored, or if the stored credentials are invalid, 27 | the OAuth2 flow is completed to obtain the new credentials. 28 | 29 | Returns: 30 | Credentials, the obtained credential. 31 | """ 32 | home_dir = os.path.expanduser('~') 33 | credential_dir = os.path.join(home_dir, '.credentials') 34 | if not os.path.exists(credential_dir): 35 | os.makedirs(credential_dir) 36 | credential_path = os.path.join(credential_dir, 37 | 'drive-python-quickstart.json') 38 | 39 | store = Storage(credential_path) 40 | credentials = store.get() 41 | if not credentials or credentials.invalid: 42 | flow = client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES) 43 | flow.user_agent = APPLICATION_NAME 44 | if flags: 45 | credentials = tools.run_flow(flow, store, flags) 46 | else: # Needed only for compatibility with Python 2.6 47 | credentials = tools.run(flow, store) 48 | print('Storing credentials to ' + credential_path) 49 | return credentials 50 | 51 | def main(): 52 | """Shows basic usage of the Google Drive API. 53 | 54 | Creates a Google Drive API service object and outputs the names and IDs 55 | for up to 10 files. 56 | """ 57 | credentials = get_credentials() 58 | http = credentials.authorize(httplib2.Http()) 59 | service = discovery.build('drive', 'v3', http=http) 60 | 61 | results = service.about().get(fields="user,storageQuota").execute()[u'storageQuota'] 62 | 63 | print(100 * int(results[u'usage']) / int(results[u'limit'])) 64 | 65 | if __name__ == '__main__': 66 | main() 67 | -------------------------------------------------------------------------------- /wallpaper.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 25 | 29 | 30 | 49 | 51 | 52 | 54 | image/svg+xml 55 | 57 | 58 | 59 | 60 | 61 | 62 | 68 | 77 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /.conky/conky_simple.lua: -------------------------------------------------------------------------------- 1 | require 'cairo' 2 | 3 | COLOR_FONT_R = 0.933 4 | COLOR_FONT_G = 0.905 5 | COLOR_FONT_B = 0.894 6 | 7 | COLOR_PRIMARY_R = 0.784 8 | COLOR_PRIMARY_G = 0.431 9 | COLOR_PRIMARY_B = 0.267 10 | 11 | COLOR_SECONDARY_R = 0.4 12 | COLOR_SECONDARY_G = 0.612 13 | COLOR_SECONDARY_B = 0.4 14 | 15 | function init_cairo() 16 | if conky_window == nil then 17 | return false 18 | end 19 | 20 | cs = cairo_xlib_surface_create( 21 | conky_window.display, 22 | conky_window.drawable, 23 | conky_window.visual, 24 | conky_window.width, 25 | conky_window.height) 26 | 27 | cr = cairo_create(cs) 28 | 29 | font = "Mono" 30 | 31 | cairo_select_font_face(cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL) 32 | cairo_set_source_rgba(cr, COLOR_FONT_R, COLOR_FONT_G, COLOR_FONT_B, 1) 33 | 34 | WINDOW_WIDTH = conky_window.width 35 | WINDOW_HEIGHT = conky_window.height 36 | 37 | return true 38 | end 39 | 40 | function conky_main() 41 | if (not init_cairo()) then 42 | return 43 | end 44 | 45 | -- TIME 46 | cairo_set_font_size(cr, 0.077 * WINDOW_WIDTH) 47 | cairo_move_to(cr, 0.381 * WINDOW_WIDTH, 0.217 * WINDOW_HEIGHT) 48 | cairo_show_text(cr, conky_parse("${time %H:%M}")) 49 | cairo_stroke(cr) 50 | 51 | -- DATE 52 | cairo_set_font_size(cr, 0.016 * WINDOW_WIDTH) 53 | cairo_move_to(cr, 0.393 * WINDOW_WIDTH, 0.264 * WINDOW_HEIGHT) 54 | local time_str = string.format('%-12s', conky_parse("${time %A,}"))..conky_parse("${time %d.%m.%Y}") 55 | cairo_show_text(cr, time_str) 56 | cairo_stroke(cr) 57 | 58 | -- CPU GRAPH 59 | -- Non-linear (sqrt instead) so graph area approximatly matches usage 60 | 61 | local cx,cy = 0.142 * WINDOW_WIDTH, 0.552 * WINDOW_HEIGHT 62 | local radius = 0.065 * WINDOW_WIDTH 63 | local half_radius = 0.05 + radius * math.sqrt(0.5) * 0.95 64 | 65 | cairo_set_source_rgba(cr, COLOR_PRIMARY_R, COLOR_PRIMARY_G, COLOR_PRIMARY_B, 1) 66 | local cpu1 = 0.05 + math.sqrt(tonumber(conky_parse("${cpu cpu1}")) / 100.0) * 0.95 67 | local cpu2 = 0.05 + math.sqrt(tonumber(conky_parse("${cpu cpu2}")) / 100.0) * 0.95 68 | local cpu3 = 0.05 + math.sqrt(tonumber(conky_parse("${cpu cpu3}")) / 100.0) * 0.95 69 | local cpu4 = 0.05 + math.sqrt(tonumber(conky_parse("${cpu cpu4}")) / 100.0) * 0.95 70 | cairo_set_line_width(cr, 1) 71 | cairo_move_to(cr, cx + radius * cpu1, cy) 72 | cairo_line_to(cr, cx, cy + radius * cpu2) 73 | cairo_line_to(cr, cx - radius * cpu3, cy) 74 | cairo_line_to(cr, cx, cy - radius * cpu4) 75 | cairo_fill(cr) 76 | 77 | cairo_set_source_rgba(cr, COLOR_FONT_R, COLOR_FONT_G, COLOR_FONT_B,0.4) 78 | cairo_set_line_width(cr, 1) 79 | cairo_move_to(cr, cx + radius, cy) 80 | cairo_rel_line_to(cr, -radius, radius) 81 | cairo_rel_line_to(cr, -radius, -radius) 82 | cairo_rel_line_to(cr, radius, -radius) 83 | cairo_rel_line_to(cr, radius, radius) 84 | cairo_stroke(cr) 85 | 86 | cairo_move_to(cr, cx + half_radius, cy) 87 | cairo_rel_line_to(cr, -half_radius, half_radius) 88 | cairo_rel_line_to(cr, -half_radius, -half_radius) 89 | cairo_rel_line_to(cr, half_radius, -half_radius) 90 | cairo_rel_line_to(cr, half_radius, half_radius) 91 | cairo_stroke(cr) 92 | 93 | cairo_move_to(cr, cx + radius, cy) 94 | cairo_rel_line_to(cr, - 2*radius, 0) 95 | cairo_stroke(cr) 96 | 97 | cairo_move_to(cr, cx, cy + radius) 98 | cairo_rel_line_to(cr, 0, - 2*radius) 99 | cairo_stroke(cr) 100 | 101 | 102 | -- PROCESSES 103 | 104 | cairo_set_source_rgba(cr, COLOR_FONT_R, COLOR_FONT_G, COLOR_FONT_B, 1) 105 | cairo_set_font_size(cr, 0.011 * WINDOW_HEIGHT) 106 | local ps_str = conky_parse("${exec ps -Ao comm,pcpu,%mem --sort=-pcpu | head -n 15}") 107 | local processes = {} 108 | for line in string.gmatch(ps_str, '([^\n]+)') do 109 | table.insert(processes, line) 110 | end 111 | for line = 1,table.getn(processes) do 112 | cairo_move_to(cr, 0.213 * WINDOW_WIDTH, 0.443 * WINDOW_HEIGHT + line * 0.014 * WINDOW_HEIGHT) 113 | cairo_show_text(cr, processes[line]) 114 | end 115 | cairo_stroke(cr) 116 | 117 | 118 | -- MEMORY 119 | 120 | local memperc = tonumber(conky_parse("$memperc")) 121 | 122 | local row,col = 0,0 123 | local rows = 5 124 | local perc = 0.0 125 | local perc_incr = 100.0 / 40.0 126 | local cx,cy = 0.426 * WINDOW_WIDTH, 0.481 * WINDOW_HEIGHT 127 | local grid_width = 0.021 * WINDOW_WIDTH 128 | for i = 1,40 do 129 | if (memperc > perc) then 130 | cairo_set_source_rgba(cr, COLOR_PRIMARY_R, COLOR_PRIMARY_G, COLOR_PRIMARY_B, 1) 131 | cairo_arc(cr, cx, cy, grid_width / 2.7, 0, 2*math.pi) 132 | else 133 | cairo_set_source_rgba(cr, COLOR_SECONDARY_R, COLOR_SECONDARY_G, COLOR_SECONDARY_B, 1) 134 | cairo_arc(cr, cx, cy, grid_width / 8.0, 0, 2*math.pi) 135 | end 136 | cairo_fill(cr) 137 | 138 | row = row + 1 139 | cy = cy + grid_width 140 | if (row >= rows) then 141 | row = row - rows 142 | cy = cy - rows*grid_width 143 | col = col + 1 144 | cx = cx + grid_width 145 | end 146 | perc = perc + perc_incr 147 | end 148 | 149 | end 150 | 151 | -- FILE SYSTEM 152 | 153 | function conky_fs_main() 154 | if (not init_cairo()) then 155 | return 156 | end 157 | 158 | local offset = 0.686 * WINDOW_WIDTH 159 | local gap = 0.053 * WINDOW_WIDTH 160 | 161 | draw_volume(" /", tonumber(conky_parse("${fs_used_perc /}")) , offset) 162 | draw_volume(" media", tonumber(conky_parse("${fs_used_perc /media/hdd/}")) , offset + gap) 163 | 164 | local dropbox_perc = 0 165 | local file = io.popen("python ~/.conky/dropbox/get_quota.py") 166 | for line in file:lines() do 167 | dropbox_perc = tonumber(line) 168 | end 169 | file:close() 170 | draw_volume(" dropbox", dropbox_perc, offset + 2*gap) 171 | 172 | local drive_perc = 0 173 | local file = io.popen("python ~/.conky/drive/get_quota.py") 174 | for line in file:lines() do 175 | drive_perc = tonumber(line) 176 | end 177 | file:close() 178 | draw_volume(" drive", drive_perc , offset + 3*gap) 179 | 180 | 181 | cairo_destroy(cr) 182 | cairo_surface_destroy(cs) 183 | cr = nil 184 | end 185 | 186 | function draw_volume(name, used, cx) 187 | local cy = 0.609 * WINDOW_HEIGHT 188 | local width,height = 0.038 * WINDOW_WIDTH, 0.014 * WINDOW_HEIGHT 189 | local volume_height = 0.132 * WINDOW_HEIGHT 190 | local filled_height = volume_height * used / 100 191 | local line_width = 0.003 * WINDOW_WIDTH 192 | 193 | cairo_set_line_width(cr, line_width) 194 | 195 | cairo_set_source_rgba(cr, COLOR_FONT_R, COLOR_FONT_G, COLOR_FONT_B, 1) 196 | draw_ellipse(cx, cy, width, height); 197 | cairo_stroke(cr) 198 | 199 | cairo_set_source_rgba(cr, COLOR_FONT_R, COLOR_FONT_G, COLOR_FONT_B, 1) 200 | draw_ellipse(cx, cy, width, height); 201 | cairo_stroke(cr) 202 | 203 | cairo_set_line_width(cr, line_width / 2) 204 | 205 | cairo_set_source_rgba(cr, COLOR_FONT_R, COLOR_FONT_G, COLOR_FONT_B, 1) 206 | cairo_move_to(cr, cx - line_width/2 + 1, cy + height/2) 207 | cairo_rel_line_to(cr, 0, -volume_height) 208 | cairo_stroke(cr) 209 | 210 | cairo_move_to(cr, cx + width + line_width/2 - 1, cy + height/2) 211 | cairo_rel_line_to(cr, 0, -volume_height) 212 | cairo_stroke(cr) 213 | 214 | cairo_set_line_width(cr, line_width) 215 | 216 | cairo_set_source_rgba(cr, COLOR_SECONDARY_R, COLOR_SECONDARY_G, COLOR_SECONDARY_B, 1) 217 | cairo_rectangle(cr, cx, cy+height/2, width, -filled_height) 218 | cairo_fill(cr) 219 | 220 | cairo_set_source_rgba(cr, COLOR_SECONDARY_R, COLOR_SECONDARY_G, COLOR_SECONDARY_B, 1) 221 | draw_ellipse(cx, cy, width, height); 222 | cairo_fill(cr) 223 | 224 | cairo_set_source_rgba(cr, COLOR_FONT_R, COLOR_FONT_G, COLOR_FONT_B, 1) 225 | draw_ellipse(cx, cy-filled_height, width, height); 226 | cairo_stroke(cr) 227 | 228 | cairo_set_source_rgba(cr, COLOR_SECONDARY_R, COLOR_SECONDARY_G, COLOR_SECONDARY_B, 1) 229 | draw_ellipse(cx, cy-filled_height, width, height); 230 | cairo_fill(cr) 231 | 232 | cairo_set_source_rgba(cr, COLOR_FONT_R, COLOR_FONT_G, COLOR_FONT_B, 1) 233 | draw_ellipse(cx, cy-volume_height, width, height); 234 | cairo_stroke(cr) 235 | 236 | cairo_set_source_rgba(cr, COLOR_PRIMARY_R, COLOR_PRIMARY_G, COLOR_PRIMARY_B, 1) 237 | draw_ellipse(cx, cy-volume_height, width, height); 238 | cairo_fill(cr) 239 | 240 | cairo_set_source_rgba(cr, COLOR_FONT_R, COLOR_FONT_G, COLOR_FONT_B, 1) 241 | cairo_move_to(cr, cx, cy + 0.038 * WINDOW_HEIGHT) 242 | cairo_show_text(cr, name) 243 | cairo_stroke(cr) 244 | end 245 | 246 | function draw_ellipse(cx, cy, width, height) 247 | cairo_save (cr); 248 | cairo_translate (cr, cx + width / 2., cy + height / 2.); 249 | cairo_scale (cr, width / 2., height / 2.); 250 | 251 | cairo_arc (cr, 0., 0., 1., 0., 2 * math.pi); 252 | cairo_restore (cr); 253 | end 254 | --------------------------------------------------------------------------------