Conky updates and some info
check_aur_updates.sh
#!/bin/sh
url='https://aur.archlinux.org/rpc?v=5&'
pacman -Qm | sort >| /tmp/local.pkgs
curl -s "${url}type=info$(printf '&arg[]=%s' $(cut -f 1 /tmp/local.pkgs))" \
| jq -r '.results[]|.Name+" "+.Version' \
| sort | join /tmp/local.pkgs - \
| while read pkg a b; do
[ "$(vercmp $a $b)" -lt 0 ] && echo $pkg;
done
conky.conf
conky.config = {
background = true,
double_buffer = true,
no_buffers = true,
text_buffer_size = 2048,
update_interval = 1,
cpu_avg_samples = 2,
net_avg_samples = 2,
alignment = 'top_right',
gap_x = 8,
gap_y = 32,
minimum_width = 300, -- minimum_height = 781,
maximum_width = 300,
short_units = true,
top_name_width = 23,
own_window = true,
own_window_type = 'dock',-- # options are: normal/override/dock/desktop/panel
own_window_title = 'conky-lua-system',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
-- Window_background
own_window_transparent = true,
own_window_argb_visual = true,
border_width = 0,
border_outer_margin = 0,
border_inner_margin = 5,
lua_load = '~/.conky/lua5-bg.lua' ,
use_xft = true,
xftalpha = 0.8,
font = 'Adwaita Sans:bold:pixelsize=12',
default_color = '#E7E7E6',
color1 = '#2EB398',
};
conky.text = [[
${lua conky_draw_bg 20 0 0 0 0 0x1B2224 1}${font Z003:pixelsize=28:bold}${color1}${alignc}${execpi 7200 lsb_release -sir}${font}${color}
Kernel:${alignr}${kernel}
Uptime:${alignr}${uptime_short}
Desktop session:${alignr}${execpi 3600 echo $DESKTOP_SESSION}
Hostname:${alignr}${nodename}
installed packages:${alignr}${execpi 1200 pacman -Qq | wc -l} packages
Repo updates:${alignr}${execpi 3600 checkupdates | awk 'END { print (NR == 0 ? "0 package" : NR " package" (NR > 1 ? "s" : "")); }'}
Aur updates:${alignr}${execpi 3600 ~/.conky/check_aur_updates.sh | awk 'END { print (NR == 0 ? "0 package" : NR " package" (NR > 1 ? "s" : "")); }'}
]]
lua5-bg.lua
--[[Background originally by londonali1010 (2009)
ability to set any size for background mrpeachy 2011
ability to set variables for bg in conkyrc dk75
the change is that if you set width and/or height to 0
then it assumes the width and/or height of the conky window
so:
lua_load ~/Conky/LUA/draw_bg.lua
TEXT
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
covers the whole window and will change if you change the minimum_size setting
20 corner_radius
0 x_position
0 y_position
0 width
0 height
0x000000 color
0.4 alpha
]]
require 'cairo'
require 'cairo_xlib'
local cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
pacman-contrib and jq need to be installed to check updates in conky