You are not logged in.
elen@zedd:~$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1: +62.0°C (crit = +200.0°C)
k10temp-pci-00c3
Adapter: PCI adapter
temp1: +62.6°C (high = +70.0°C)
(crit = +97.0°C, hyst = +90.0°C)
is my sensors output (yay for running hot)
i'm not sure i set up lm-sensors right - either that or my laptop is too cheap to have sensors installed (which is entirely likely - when i installed lm-sensors it did say no modules detected or whatever)
i like those weather scripts but i'm trying to keep it really simple and only use what's built into conky - my conky.rc is
##############################################
# Settings
##############################################
background yes
use_xft yes
xftfont Droid Sans:size=10
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 295 768
maximum_width 195
maximum_height 768
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
default_color dddddd
default_shade_color 000000
default_outline_color ffffff
alignment top_right
gap_x 12
gap_y 36
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
temperature_unit celsius
##############################################
# Output
##############################################
TEXT
Date:$alignr${time %D}
Uptime:$alignr$uptime
${stippled_hr}
CPU: ${cpu cpu0}% ${cpubar cpu0}
CPU temp:$alignr${acpitemp} C
${stippled_hr}
RAM:$alignr$mem/$memmax
Swap:$alignr$swap/$swapmax
${stippled_hr}
HD1:$alignr${fs_used /usr} / ${fs_size /usr}
${fs_bar /usr}
HD2:$alignr${fs_used /media/Meat Locker} / ${fs_size /media/Meat Locker}
${fs_bar /media/Meat Locker}
${stippled_hr}
Outside temp:$alignr${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ KMKE temperature} F
Currently:$alignr${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ KMKE cloud_cover}
i'm kind of fumbling around with this so any pointers on cleaning it up would be nice too
Offline
A new interactive conky I have been working on. (Peachy's Interactive conky script)
Working on some ugly script cleanup (mine of course) and a couple of hiccups in the GMB conky..
Very close to being done.
Peachy's Wun Lua / Peachy's v9000 / Conky PitStop / My DA Page
........
Offline
elen@zedd:~$ sensors acpitz-virtual-0 Adapter: Virtual device temp1: +62.0°C (crit = +200.0°C) k10temp-pci-00c3 Adapter: PCI adapter temp1: +62.6°C (high = +70.0°C) (crit = +97.0°C, hyst = +90.0°C)
is my sensors output (yay for running hot)
i'm not sure i set up lm-sensors right - either that or my laptop is too cheap to have sensors installed (which is entirely likely - when i installed lm-sensors it did say no modules detected or whatever)i like those weather scripts but i'm trying to keep it really simple and only use what's built into conky - my conky.rc is
i'm kind of fumbling around with this so any pointers on cleaning it up would be nice too
I'm off to bed in seconds ... re-run sensors detect and answer yes to everything! Even the last one.
Run sensors again and see if you get any additional stuff.
Will look at code tomorrow, but a quick glance says it's just fine if your weather stays, I find the NOAA info only stayed about 10 minutes.
Tomorrow... a new day!
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
reran sensors, yes to everything, this is all that comes up at the end
Driver `k10temp' (autoloaded):
* Chip `AMD Family 10h thermal sensors' (confidence: 9)
No modules to load, skipping modules configuration.
Unloading i2c-dev... OK
Unloading cpuid... OK
and the output of sensors is the same. so i think it's just a matter of not really HAVING any sensors on this cheap laptop.
and yeah the noaa weather script seems to have stopped, i guess i'll have to look into other methods. thanks for your help!
Last edited by disparaissant (2013-01-22 05:01:59)
Offline
Offline
why this will not work???
require 'cairo'
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()
function draw_bg(wb)
bg_width=(tonumber(wb.bgw) or tonumber(conky_window.width))
bg_height=(tonumber(wb.bgh) or tonumber(conky_window.height))
bg_posx=(wb.bgx or 0)
bg_posy=(wb.bgy or 0)
bg_colour=(wb.bgcl or 0x000000)
bg_corner=(wb.bgcr or 20)
bg_alpha=(wb.bga or 0.5)
if conky_window==nil then return end
--local bg_width=conky_window.width
--local bg_height=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, bg_width, bg_height)
cr=cairo_create(cs)
cairo_move_to(cr,bg_corner,0)
cairo_line_to(cr,bg_width-bg_corner,0)
cairo_curve_to(cr,bg_width,0,bg_width,0,bg_width,bg_corner)
cairo_line_to(cr,bg_width,bg_height-bg_corner)
cairo_curve_to(cr,bg_width,bg_height,bg_width,bg_height,bg_width-bg_corner,bg_height)
cairo_line_to(cr,bg_corner,bg_height)
cairo_curve_to(cr,0,bg_height,0,bg_height,0,bg_height-bg_corner)
cairo_line_to(cr,0,bg_corner)
cairo_curve_to(cr,0,0,0,0,bg_corner,0)
cairo_close_path(cr)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))
cairo_fill(cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
return ""
end
Offline
Hi I've found something to write in transparent with convert.
Do you think it's possible to add this function in a conky to display time, date, or others conky datas ?
I'm using this stuf to write the name of my town in a weather conky with an extern script, but I don't know how to do for a "normal" conky ?
trans_town
Big thanks to jpdipsy to clean my messy code
Last edited by ragamatrix (2013-01-22 09:35:17)
Offline
reran sensors, yes to everything, this is all that comes up at the end
Driver `k10temp' (autoloaded): * Chip `AMD Family 10h thermal sensors' (confidence: 9) No modules to load, skipping modules configuration. Unloading i2c-dev... OK Unloading cpuid... OK
and the output of sensors is the same. so i think it's just a matter of not really HAVING any sensors on this cheap laptop.
Since ACPI temperature worked for you then why not use it?
Check two things in terminal and post'em here:
mawk -W version
ls -lAh /proc/acpi
Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop
Offline
Since ACPI temperature worked for you then why not use it?
Check two things in terminal and post'em here:
mawk -W version
ls -lAh /proc/acpi
My error, that's the first time I have seen answer yes to everything fail.
Sorry disparaissant.
{hanging head in shame}
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
Hey!
I wanted my conky to "tell" me when the battery gets low...
there is something you can try
check this
:~$ df -h |grep '/run/lock'
tmpfs 5,0M 0 5,0M 0% /run/lock
:~$if it's "tmpfs" for you too, then we are home.
TMPFS is special filesystem residing in RAM (I've moved my /tmp into it wink ) so it means any operation on it are fast.
after some talking about tmpfs and bash and all the things involved we got erverything together ang now:
Akku:${if_match ${battery_percent} < 15}${exec ~/scripts/batlow.sh}${color FF0000}${font BaileysCar:pixelsize=23}$alignr${blink ${battery}}${color}${font}${else}${exec bash -c 'if [ -e /run/lock/batlow ]; then rm -f /run/lock/batlow; fi'}$alignr${battery}${endif}
and the batlow.sh:
#!/bin/bash
#small and easy power notifierscript for #! waldorf by Naik and dk75
##to be run from conky using ${if_match ${battery_percent} < ??}${exec /path/to/batlow.sh} ${else}${exec bash -c 'if [ -e /run/lock/batlow ]; then rm -f /run/lock/batlow; fi'}${endif}
##you may edit /sys/class/power_supply/-???-/online to suit your system and the notification and sound to suit your favour
PWR=$(cat /sys/class/power_supply/AC/online)
if [ ! -e /run/lock/batlow ] && [ $PWR = 0 ]; #IF NOT EXIST /run/lock/batlow AND POWER NOT PLUGGED THEN
then
touch /run/lock/batlow #CREATE /run/lock/batlow
notify-send -i gtk-dialog-info -t 6666 -- "Achtung!" "Akku bald leer!" && mplayer -volume 95 ~/music/batteriealarm.mp3 >/dev/null 2>&1
fi
exit
so, for everyone who is intrested. changeing the sound to your beloved tune or player shouldn`t be a big deal.
also im glad i finaly found a place for the BaileysCar-font from the ttf-larabie-uncommon package
edit: added a funktion to check whether the power-cord is plugged in or not...
Last edited by Naik (2013-01-28 14:00:31)
*kaum macht man es richtig, funktioniert es sofort*
Offline
do u have an idea why this script will not display a specific image (bottom left)?
here a screenshot: http://ompldr.org/vaDZ4bQ
i call the function this way:
display_extern_img({posx=0,posy=205,w=200,h=200,url='http://www.jwst.nasa.gov/WebbCam/CLNRM.jpg',hdd='webb.jpg',iv=30})
other photos will be loaded?! only this photo (webb.jpg) will not be displayed (see example). the 'grabbed image' is ok but lua will not display this photo do u have an idea why?
the whole script?
function display_extern_img(wb)
x=(wb.posx or 0)
y=(wb.posy or 0)
w=(wb.w or 200)
h=(wb.h or 200)
s=wb.url -- url of the webcam
--nw=math.random(os.time()).."_dei.jpg"
--ct=wb.count
nw=(wb.hdd or "webcam.jpg")
print(nw)
file='/home/'..username.."/"..nw -- storage location of the grabbed image
intervall=(wb.iv or 60)
-- grab webcam image and save it to hdd
local updates = tonumber(conky_parse('${updates}'))
if (math.mod(updates, intervall) == 0) then
os.execute("wget -q -O "..file..' "'..s..'"')
end --#
-- load image from harddisk
if file==nil then print("set image file") end
---------------------------------------------
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then
width=imlib_image_get_width()
else
width=tonumber(w)
end
if tonumber(h)==0 then
height=imlib_image_get_height()
else
height=tonumber(h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image_and_decache()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(x, y)
imlib_free_image_and_decache()
show=nil
end
Offline
It took 6s to download this particular image from NASA by wget in terminal.
Then, Eye of GNOME complained, that it is not an image. Geeqie displayed it without the hassle, convert (ImageMagic) changed it to PNG also without any complains.
But when feeded to Conky's ${image} then it displayed nothing, nor printed any error.
Again ImageMagic:
:/tmp$ identify CLNRM.jpg
CLNRM.jpg BMP 736x480 736x480+0+0 8-bit DirectClass 1.413MB 0.000u 0:00.010
So it is an BMP image, and surprisingly, Conky can't display it. It's Imlib2 code can't do anything with it - funny.
I've converted it from JPG container to BMP and here what feh (Imlib2 based image viewer) said:
:/tmp$ feh CLNRM.bmp
feh WARNING: CLNRM.bmp - No Imlib2 loader for that file format
feh: No loadable images specified.
See 'man feh' for detailed usage information
You are fragged. ]:D
Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop
Offline
conky_chrono
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 355 745
maximum_width 355
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_middle
gap_x 190
gap_y 0
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# Maximum size of user text buffer, i.e. layout below TEXT line in config file
# (default is 16384 bytes)
# max_user_text 16384
# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
temperature_unit Fahrenheit
####### Load Lua #########
lua_load ~/Conky/s11_clock.lua
lua_draw_hook_pre main
lua_load /home/luke/Conky/allcombined.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
############################## End LUA ###
${image ~/Conky/debian_horns.png -s 200x200 -p 85,75}
#${image ~/Conky/vsido_orb_blue.png -s 285x285 -p 25,10}
TEXT
${lua tex_bg {20,0,0,365,750,"/home/luke/Conky/brushed.png"}}${lua draw_bg {20,1,1,365,750,0x000000,1,2,1}}
${font WhiteRabbit:size=13}${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p -5,338 -s 190x165}
${font WhiteRabbit:size=13}${goto 165}TEMP${alignr 3}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 165}WIND${alignr 6}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}HUM${alignr 6}${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}PRESS${alignr 3}${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}CLOUD COVER${alignr 3}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}UV INDEX${alignr 10}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}DEW POINT${alignr 6}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}CEILING${alignr 3}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}VISIB.${alignr 3}${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}SUNRISE${alignr 6}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}SUNSET${alignr 6}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${font WhiteRabbit:size=13}${goto 20}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 255}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${image $HOME/Accuweather_Conky_USA_Images/7.png -p 20,477 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/12.png -p 135,477 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 255,477 -s 80x67}
${font WhiteRabbit:size=13}${goto 20}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 140}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 255}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/last_days}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/22.png -p 20,573 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N2.png -p 135,573 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N7.png -p 255,573 -s 80x67}
${font WhiteRabbit:size=13}${goto 20}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 140}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 255}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/last_days}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/N12.png -p 20,667 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N17.png -p 135,667 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N22.png -p 255,667 -s 80x67}
conky_system
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250 525
maximum_width 250
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_left
gap_x 10
gap_y -10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
## Set the path to your script here.
lua_load /home/luke/Conky/allcombined.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
# not for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.5}}
TEXT
${lua tex_bg {20,0,0,260,970,"/home/luke/Conky/brushed.png"}}${lua draw_bg {20,1,1,258,970,0x000000,1,2,1}}${font OpenLogos:size=43} tJ^Jt${font}
${voffset 4}${font Sans:size=10}CPU Average ${lua gradbar {100,67,"${cpu cpu0}",100,33,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu0}%
#${font Sans:normal:size=10}${color1}k${voffset -1}${font}${color2} TEMP ${hwmon 1 temp 1}°C${lua gradbar {90,127,"${hwmon 1 temp 1}",100,50,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}
${font Sans:size=10}${voffset 1}CPU1 ${lua gradbar {50,82,"${cpu cpu1}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu1}%
${font Sans:size=10}CPU2 ${lua gradbar {50,97,"${cpu cpu2}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu2}%
${font Sans:size=10}CPU3 ${lua gradbar {50,112,"${cpu cpu3}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu3}%
${font Sans:size=10}CPU4 ${lua gradbar {50,127,"${cpu cpu4}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu4}%
${hr 2}
${font Sans:size=10}${voffset 10}RAM${goto 90}${mem}${goto 140} / ${memmax}
${lua gradbar {5,182,"${memperc}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${memperc}%
${font Sans:size=10}SWAP${goto 90}${swap}${goto 140} / ${swapmax}
${lua gradbar {5,213,"${swapperc}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${swapperc}%
${hr 2}
${font Sans:size=10}${voffset 10}/Root${goto 90}${fs_used /}${goto 140} / ${fs_size /}
${lua gradbar {5,267,"${fs_used_perc /}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /}%
${font Sans:size=10}/Home${goto 90}${fs_used /home}${goto 140} / ${fs_size /home}
${lua gradbar {5,298,"${fs_used_perc /home}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /home}%
${font Sans:size=10}External${goto 90}${fs_used /media/External}${goto 140} / ${fs_size /media/External}
${lua gradbar {5,328,"${fs_used_perc /media/External}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/External}%
${font Sans:size=10}Software${goto 90}${fs_used /media/sdd5}${goto 140} / ${fs_size /media/sdd5}
${lua gradbar {5,358,"${fs_used_perc /media/sdd5}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/sdd5}%
${font Sans:size=10}Music${goto 90}${fs_used /media/sda5}${goto 140} / ${fs_size /media/sda5}
${lua gradbar {5,388,"${fs_used_perc /media/sda5}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/sda5}%
${font Sans:size=10}Videos${goto 90}${fs_used /media/sdd1}${goto 140} / ${fs_size /media/sdd1}
${lua gradbar {5,418,"${fs_used_perc /media/sdd1}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/sdd1}%
${font Sans:size=10}Storage${goto 90}${fs_used /media/storage}${goto 140} / ${fs_size /media/storage}
${lua gradbar {5,448,"${fs_used_perc /media/storage}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/storage}%
${hr 2}
${font Sans:size=10}CPU Temp
${lua gradbar {5,507,"${platform f71882fg.656 temp 1}",190,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 215}${platform f71882fg.656 temp 1}° F
${font Sans:size=10}System Temp
${lua gradbar {5,536,"${platform f71882fg.656 temp 2}",220,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 215}${platform f71882fg.656 temp 2}° F
${font Sans:size=10}GPU Temp
${lua gradbar {5,566,"${nvidia temp}",220,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 215}${nvidia temp}° F
${hr 2}
NAME ${alignr 5} PID CPU MEM
${top name 1} ${alignr 5} ${top pid 1} ${top cpu 1} ${top mem 1}
${top name 2} ${alignr 5} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${alignr 5} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${alignr 5} ${top pid 4} ${top cpu 4} ${top mem 4}
${top name 5} ${alignr 5} ${top pid 5} ${top cpu 5} ${top mem 5}
${top name 6} ${alignr 5} ${top pid 6} ${top cpu 6} ${top mem 6}
${top name 7} ${alignr 5} ${top pid 7} ${top cpu 7} ${top mem 7}
${top name 8} ${alignr 5} ${top pid 8} ${top cpu 8} ${top mem 8}
${hr 2}
#${voffset 10}${goto 50}${font Sans:size=22}${time %I:%M %p}
#${lua luacal {100,425,"Sans",10,0x00FF00,1,"Sans",10,0xFFFFF0,1,"Mono",14,0x00FF00,1," ",20,18,16,0}}
#${goto 15}${font Sans:bold:size=12}${time %d}${font}
#${goto 15}${time %B}
#${goto 15}${time %Y}
#${voffset 40}${hr 2}
#${voffset 10}${font Sans:size=10}Connection Type ${goto 220}${gw_iface}
#I.P${goto 173}${addr eth0}
${voffset 8}Down Speed${goto 100}${downspeed eth0} ${goto 175}${voffset -8}${color yellow}${downspeedgraph eth0 20,75}${color}
${voffset 8}Up Speed${goto 100}${upspeed eth0} ${goto 175}${voffset -8}${color yellow}${upspeedgraph eth0 20,75}${color}
Downloads
Today:${alignr 10}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $2 $3}'}
Week:${alignr 5}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $3 $4}'}
Month:${alignr 10}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}
Uploads
Today: ${alignr 10}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $5 $6}'}
Week: ${alignr 5}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $6 $7}'}
Month: ${alignr 10}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'}
${voffset 5}
allcombined.lua (by mrpeachy) edited so that draw_bg outlines the config
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function conky_gradbar(bartab)
if conky_window == nil then return 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)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_draw_bg(bgtab)
if conky_window == nil then return 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)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
local draw=bgtab[8]
local lwidth=bgtab[9]
local olcolor=bgtab[10]
local olalpha=bgtab[11]
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))
--the drawing part---------------------------
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)
if draw==1 then
cairo_fill (cr)
elseif draw==2 then
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
elseif draw==3 then
cairo_fill_preserve (cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({olcolor,olalpha}))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
end
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luacal(caltab)
if conky_window == nil then return 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)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luaimage(imtab)
if conky_window == nil then return 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)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--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))
--the drawing part---------------------------
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_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function
function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
if conky_window == nil then return 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)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function
s11_clock.lua (by mrpeachy and Sector11)
--[[ multiple analogue clocks by mrpeachy - 18 Jun 2012
21 Jun 2012 - Chronograph modifications by Sector11
22 Jun 2012 - again with mrpeachy's help day names, numbers and month names
12 Nov 2012 - memory leak plugged - mrpeachy
14 Nov 2012 - Personnalisation - Didier-T (forum Ubuntu.fr)
26 Nov 2012 - The Clock - Sector11 (small version)
use in conkyrc
lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT
-- INDEX
-- ### CLOCK POSITION - AND DEFAULTS ###
-- ### SET BORDER OPTIONS FOR "CLOCKS" ### -- I don't know how to remove this - NOT NEEDED
-- See lines 39 to 41 for overall size changes
-- ### START DIAL B ### Day Names Dial ###
-- See Lines 84 - 87 and 131 for changes
-- ### START DIAL C ### Month Names Dial ###
-- See Lines 150 -153 and 198 for changes
-- ### START DIAL D ### Day Numbers Dial ###
-- See Lines 234 & 265 for changes
-- ### START CLOCK A ###
-- See Lines & and 441 & 467 changes
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
-- CLOCK A HOUR HAND
-- CLOCK A MINUTE HAND SETUP
-- CLOCK A SECOND HAND SETUP
NOTE: Putting ### CLOCK A ### last insures that it's functions are written
over the other dials.
]]
require 'cairo'
-- ### CLOCK POSITION - AND DEFAULTS ##########################################
local init={
center_x=178,
center_y=160,
radius=140,
lang="English", -- English French Greek Spanish
hour=12, -- 12 | 24
second=false, --true | false - Seconds: dots and numbers IF 12HR
line=false, -- true | false - Part Second Hand
color=0xFF0000, --color for day, day number and month IF NO SECOND HAND
alpha=1 --alpha for day, day number and month IF NO SECOND HAND
}
-- ONLY NEED ONE COPY OF THIS FUNCTION
function rgb_to_r_g_b(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local colr, colg, colb, cola=rgb_to_r_g_b(init.color,init.alpha)
function conky_main()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
-- ### CLOCK 12|24 HR SELECTOR ############################
local clock_type_A=init.hour
-- ############################ CLOCK 12|24 HR SELECTOR ###
-- ### SET BORDER OPTIONS FOR "CLOCKS" ####################
--local clock_border_width=0
-- set color and alpha for clock border
--local cbr,cbg,cbb,cba=1,1,1,1 -- full opaque white
-- gap from clock border to minute marks
local b_to_m=0
-- #################### SET BORDER OPTIONS FOR "CLOCKS" ###
-- ### START DIAL B ### Day Names Dial ####################
-- DIAL POSITION
local center_x=init.center_x
local center_y=init.center_y
local radius=22
-- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",} end
if init.lang == "French" then text_days={"dim","lun","mar","mer","jeu","ven","sam",} end
if init.lang == "Greek" then text_days={"ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ","ΚΥΡ",} end
if init.lang == "Spanish" then text_days={"dom","lun","mar","mie","jue","vie","sab",} end
local day_number=tonumber(os.date("%w"))
if init.handday == true then
for i=1,7 do
-- work out points
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
else
for i=1,7 do -- working out points
if day_number == i-1 then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active day names
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=7
for i=1,7 do
if day_number == i-1 then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ######################################### END DIAL B ###
-- ### START DIAL C ### Month Names Dial ##################
-- DIAL POSITION
local center_x=init.center_x --(+85)
local center_y=init.center_y
local radius=53
-- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",} end
if init.lang == "French" then text_days={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} end
if init.lang == "Greek" then text_days={"ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥ","ΙΟΥ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ",} end
if init.lang == "Spanish" then text_days={"ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",} end
local this_month=tonumber(os.date("%m"))
if init.handmonth == true then
for i=1,12 do
-- OUTER POINTS POSTION FOR -- ### START DIAL D ## TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
else
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,0,1,1,0) -- active month colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active month names
end
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=38
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- dots for non-active month names
end
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ######################################### END DIAL C ###
-- ### START DIAL D ### Day Numbers Dial ##################
-- GET NUMBER OF DAYS IN CURRENT MONTH
-- calculate Feb, then set up table
year4num=os.date("%Y")
t1=os.time({year=year4num,month=03,day=01,hour=00,min=0,sec=0});
t2=os.time({year=year4num,month=02,day=01,hour=00,min=0,sec=0});
if init.hour == 12 then
febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))
else
febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
end
-- MONTH TABLE
monthdays={31,febdaynum,31,30,31,30,31,31,30,31,30,31}
this_month=tonumber(os.date("%m"))
number_days=monthdays[this_month]
-- TEXT positioning
local center_x=init.center_x
local center_y=init.center_y
local radius=85
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 20)
local this_day=tonumber(os.date("%d"))
for i=1,number_days do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
--only print even numbers
if math.mod(i, 2) == 0 and math.mod(this_day, 2)==0 then
text=string.format("%02d",i) --formats numbers to double digits
elseif math.mod(i, 2) ~= 0 and math.mod(this_day, 2)~=0 then
text=string.format("%02d",i) --formats numbers to double digits
else
text=""
end --odd even matching
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
if i==this_day then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dim inactive numbers
end
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=70
for i=1,number_days do
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
if i==this_day then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dim the points
end
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- ######################################### END DIAL D ###
-- ### START CLOCK A ######################################
-- SET MARKS ###
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=init.hour
-- set mark length
local m_length_A=0 -- doesn't work but can't delete
-- set mark width
local m_width_A=0 -- doesn't work but can't delete
-- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
-- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,0 -- opaque white -- doesn't work but can't delete
-- SETUP HOUR HANDS ###
-- CLOCK A HOUR HAND
hh_length_A=95
-- set hour hand width
hh_width_A=6
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
-- hhr,hhg,hhb,hha=1,0,1,0 -- fully opaque white --doesn't work
-- SETUP MINUTE HANDS ###
-- CLOCK A MINUTE HAND SETUP
-- set length of minute hand
mh_length_A=115
-- set minute hand width
mh_width_A=6
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
--mhr,mhg,mhb,mha=1,1,1,0.5 -- fully opaque white --doesn't work
-- SETUP SECOND HAND ###
-- CLOCK A SECOND HAND SETUP -- DOESN'T WORK - Why ???????????????????????????
-- set length of seconds hand -- yes I know it is commented out!
--sh_length_A=150
-- set hour hand width
--sh_width_A=2
-- set hour hand line cap
--sh_cap=CAIRO_LINE_CAP_ROUND
-- set seconds hand color
--shr,shg,shb,sha=1,0,0,1 -- fully opaque red
-- PART SECOND HAND
--position
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
if init.line == true then
local arc=(math.pi/180)*((360/60)*seconds)
--calculate point 1
local radius1=100
local x1=0+radius1*math.sin(arc)
local y1=0-radius1*math.cos(arc)
--calculate point 2
local radius2=107
local x2=0+radius2*math.sin(arc)
local y2=0-radius2*math.cos(arc)
--draw line connecting points
cairo_move_to (cr, center_x+x1,center_y+y1)
cairo_line_to (cr, center_x+x2, center_y+y2)
cairo_set_source_rgba (cr,255/255,0/255,0/255,0) -- PART SECOND HAND
cairo_stroke (cr)
end
-- CLOCK A ### 12 HR TIME ###
-- CLOCK SETTINGS
clock_radius=0 --does not work
clock_centerx=init.center_x -- centre of Clock hands
clock_centery=init.center_y -- centre of Clock hands
-- DRAWING CODE
-- DRAW MARKS
-- stuff that can be moved outside of the loop, needs only be set once
-- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_A -- WHAT IS THIS??
-- set line cap type
cairo_set_line_cap (cr, m_cap)
-- set line width
cairo_set_line_width (cr,m_width_A)
-- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
-- START LOOP FOR HOUR MARKS
for i=1,number_marks_A do
-- drawing code using the value of i to calculate degrees
-- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
-- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- draw the line
cairo_stroke (cr)
end -- of for loop
-- HOUR MARKS -- ???????????????????????????????????????????????????????????????
-- TIME CALCULATIONS CLOCK A
if clock_type_A==12 then
hours=tonumber(os.date("%I"))
-- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_A==24 then
hours=tonumber(os.date("%H"))
-- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
-- convert minutes to seconds
m_to_s=minutes*60
-- get current seconds
seconds=tonumber(os.date("%S"))
-- DRAW HOUR HAND ###
-- get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
-- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_A)) -- use equation ~ eliminate decimals
-- set radius to calculate hand points
radius=hh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of hour hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_A)
cairo_set_source_rgba (cr,1,1,1,1) -- active colour Hour Hand ================
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
-- DRAW MINUTE HAND
-- get minutes and seconds just as seconds
msecs=m_to_s+seconds
-- calculate degrees for each second
msec_degs=msecs*0.1
-- set radius to calculate hand points
radius=mh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_A)
cairo_set_source_rgba (cr,1,1,1,1) -- active colour Minute Hand ==============
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
-- ### CLOCK A ###
local center_x=init.center_x -- Centre of the HR / Min Numbers
local center_y=init.center_y -- Centre of the HR / Min Numbers
local radius=init.radius -- 12/24 HR CLOCK Hours/Minutes radius -- seeline 42
cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 25)
cairo_set_source_rgba (cr,1,1,1,1) -- HR Clock numbers
-- TABLE OF TEXT -- in order
if init.hour == 12 then
text_days={"12","01","02","03","04","05","06","07","08","09","10","11",}
for i=1,12 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_set_source_rgba (cr,1,1,1,1)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=111 -- 12 HR Clock
for i=1,12 do
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_set_source_rgba (cr,1,1,1,0)
cairo_stroke (cr)
end
end
if init.hour == 24 then
text_days={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23",}
for i=1,24 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=99 -- 24 HR Clock
for i=1,24 do
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_set_source_rgba (cr,1,1,1,0)
cairo_stroke (cr)
end
end
-- ############################################################################
-- POSITION FOR TEXT HOUR NUMBERS
if init.hour == 12 and init.second == true then
text_days={"","01","02","03","04","","06","07","08","09","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59","",}
-- INNER POINTS POSITION, radius smaller than text circle
cairo_set_source_rgba (cr,1,1,1,.5) -- does not work -- settings moved
cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
for i=1,60 do
local radius=99 -- dots for seconds A Clock
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
if seconds == i-1 then
cairo_set_source_rgba (cr,255/255,0/255,0/255,0) -- does not work - settings moved
else
if i-1 == 0 or i-1 == 5 or i-1 == 10 or i-1 == 15 or i-1 == 25 or i-1 == 30 or i-1 == 35 or i-1 == 40 or i-1 == 45 or i-1 == 50 or i-1 == 55 then
cairo_set_source_rgba (cr,1,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dots for seconds A Clock
end
end
cairo_arc (cr,center_x+x,center_y+y,1/2,0,2*math.pi)
cairo_stroke (cr)
end
radius=radius-3
cairo_set_font_size (cr, 9)
for i=1,60 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
if seconds == tonumber(text) then
cairo_set_source_rgba (cr,1,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- seconds numbers
end
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
end
-- ############################################################################
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end -- end main function
The weather script is by TeoBigusGeekus and you can get the full script along with the edited images by me here
The wallpaper can be found here and the conky background image by jst_joe (but resized) can be found here
Conky | SMXI HowTo | Super Grub | VastOnes GMB HowTo | VSIDO
Offline
It took 6s to download this particular image from NASA by wget in terminal.
Then, Eye of GNOME complained, that it is not an image. Geeqie displayed it without the hassle, convert (ImageMagic) changed it to PNG also without any complains.
But when feeded to Conky's ${image} then it displayed nothing, nor printed any error.
Again ImageMagic::/tmp$ identify CLNRM.jpg CLNRM.jpg BMP 736x480 736x480+0+0 8-bit DirectClass 1.413MB 0.000u 0:00.010
So it is an BMP image, and surprisingly, Conky can't display it. It's Imlib2 code can't do anything with it - funny.
I've converted it from JPG container to BMP and here what feh (Imlib2 based image viewer) said:
:/tmp$ feh CLNRM.bmp feh WARNING: CLNRM.bmp - No Imlib2 loader for that file format feh: No loadable images specified. See 'man feh' for detailed usage information
You are fragged. ]:D
He could change the wget command to end with " && 'comand to covert to png'".
What command you use depends on what you have installed already (imagemagic, graphicsmagick, etc.).
Then display the png image instead of the bmp image.
Offline
@naik -
Nice one
"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe
Offline
i'm displaying the image-of-the-day of the nasa within my lua-template. but i grab the image with the help of an sh-file. this works but i do not wanna use a 'third-party-tool'.
the content of the sh-file:
#!/bin/bash
test=`curl -s http://www.nasa.gov/rss/image_of_the_day.rss | grep 'url=' | sed 's/^.*url="//' | sed 's/".*$//'` && wget -O /tmp/image_nasa.jpg $test
is it possible to 'convert' this into lua?
Offline
Something I came up with, to fit the wallpaper. I call it Cube Conky
As you can see, there are a lot of "empty slots", which can still be filled. Which is why I took the liberty of posting it here, as this is the place for conky configs.
conkyrc
# cube conky
## Written by easysid
# 24-January-2013
######################
# - Conky settings - #
######################
background no
update_interval 3
cpu_avg_samples 1
total_run_times 0
override_utf8_locale yes
short_units yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
imlib_cache_size 0
# For screen size 1368x768
minimum_size 1065 700
maximum_width 1065
gap_x 120
gap_y 10
#####################
# - Text settings - #
#####################
use_xft yes
xftfont ocr a extended:bold:pixelsize=18
xftalpha .8
uppercase no
# Text alignment
alignment top_left
######################
# - Color settings - #
######################
color5 FF0000 # red for battery time out
color6 797979 # dark gray for disconnected
color7 141D23
#default_color 434e59
default_color 212629
default_shade_color gray
default_outline_color black
#############################
# - Window specifications - #
#############################
own_window yes
own_window_colour blue
own_window_argb_visual yes
#own_window_argb_value 28
own_window_transparent yes
#own_window_class Conky
#own_window_type override
own_window_type desktop
#own_window_type dock
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no
TEXT
${voffset 590}\
${goto 65}Kernel $kernel
${goto 65}Uptime ${uptime}
${voffset -295}\
${goto 445}CPU ${cpu cpu0}% ${voffset 5}
${goto 445}RAM ${mem}(${memperc}%)
${voffset 10}
${goto 445}/ ${fs_used /}(${fs_used_perc /}%)
${goto 445}~ ${fs_used /home}(${fs_used_perc /home}%)
${voffset -285}
${goto 710}CPU ${hwmon 1 temp 2}°C${voffset 5}
${goto 710}GPU ${execi 30 aticonfig --odgt | grep 'Temp' | cut -c43,44}°C${voffset 5}
${goto 710}HDD ${execi 100 hddtemp /dev/sda -n }°C${voffset 15}
${goto 715}BRT ${execi 5 cat /sys/class/backlight/acpi_video0/actual_brightness}
${voffset -235}
${goto 925}${processes}
${goto 895}${top_mem name 1} ${font bold:pixelsize=12}
${goto 895}${top_mem mem_res 1}${goto 945}${top_mem cpu 1}${font}
${goto 895}${top_mem name 2} ${font bold:pixelsize=12}
${goto 895}${top_mem mem_res 2}${goto 945}${top_mem cpu 2}${font}
${goto 895}${top_mem name 3} ${font bold:pixelsize=12}
${goto 895}${top_mem mem_res 3}${goto 945}${top_mem cpu 3}${font}
${voffset -280}\
${font ocr a extended:pixelsize=36}
${goto 243}${time %H:%M}${font} ${voffset 25}
${goto 250}${time %A}${voffset 10}
${goto 242}${time %d-%m-%Y}
${voffset -190}
${if_up wlan0} ${if_existing /proc/net/route wlan0}
${goto 508} wlan0 ${voffset 25}\
${goto 500}'${wireless_essid wlan0}'${endif}
Desktop screenshots :: Origami :: github
Offline
is it possible to look for a punctuation sign like .
string.find(geschw_2,'%c.')
Offline
@easysid
This is simply amazing and i love it!
Imagine the posibilities if it would you could foreshorten the conky-output...
any suggestions?
*kaum macht man es richtig, funktioniert es sofort*
Offline
is it possible to look for a punctuation sign like .
string.find(geschw_2,'%c.')
Yes "%." will look for "." instead of "." being used as a wildcard.
There is a decent guide on using string.find here if you want to look at it.
Offline
@easysid
This is simply amazing and i love it!
Thanks.
Imagine the posibilities if it would you could foreshorten the conky-output...
any suggestions?
This is why I posted it here, as I know folks here would use every inch of real estate available. I didn't get much ideas as this is all the info I need. But it can certainly be improved, as I said in OP. [ i didn't quite get the foreshortening the conky-output part.]
One thing I'd really like, is to 'flatten' the output, so that the top surfaces can be used as well. But I have no idea how.
Last edited by easysid (2013-01-26 09:26:35)
Desktop screenshots :: Origami :: github
Offline
hi all,
how to conky downgrade to 1.8.0 from new version? because i want run conky-stock script, author suggest to downgarde 1.8.0.
i try download conky 1.8.0.deb,and run it but last it will auto install new version.
how can i solve this problem?
Offline
hi all,
how to conky downgrade to 1.8.0 from new version? because i want run conky-stock script, author suggest to downgarde 1.8.0.
i try download conky 1.8.0.deb,and run it but last it will auto install new version.
how can i solve this problem?
Offline
stock should run on everything, if it needs some specific version then it is not a stock
What is it?
Maybe the only modification it will be some border settings (few base settings changed name from 1.8 to 1.9) then it will be super easy to fix.
If you insist to downgrade, then it requires to edit system apt/sources and apt/preferences to make it happen.
Last edited by dk75 (2013-01-26 13:09:28)
Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop
Offline
Something I came up with, to fit the wallpaper. I call it Cube Conky
Sweet. I like that.
I've been playing with full screen conkys for a bit and over time I found a way to do it without a single ${voffset}.
Why - because I can - it also controls the real conky window size better. An opinion.
Your first command:
${voffset 590}\
prints to the bottom of the screen then you use a negative voffset to bring it up
two positive voffsets to move text down again and it continues.
There are 1001 ways of doing things, what follows is just other way.
It's all a matter of personal choice
so.....
A bit more work but I find if I set the lines first the conky code is easy to add in.
Line 6 it uses the small font last the ${goto} places it properly:
L 6\
${goto 570}L 6 plus\
${goto 350}${font OCR A Extended:bold:pixelsize=12}L 6
${font}L 7${goto 350}L 7${goto 940}L 7
... and doesn't turn the font off until the beginning of line 7
Line 11 does the same with larger font but with a twist:
${goto 350}L 11\
${goto 940}L 11\
${goto 730}${font OCR A Extended:bold:pixelsize=24}L 11${font OCR A Extended:pixelsize=1}
${font}${goto 350}L 12${goto 940}L 12
large font used last, ${goto} places it properly, then
a really small 1 pixelsize font to bring Line 12 back in line
turn the tiny font off at the start of line 12
Stuff below TEXT
TEXT
L 1 = time H:M${goto 930}${time %H:%M}
L 2 = time x\
${goto 930}${font OCR A Extended:bold:pixelsize=16}${time %x}
${font}L 3\
${goto 350}L 3\
${goto 570}L 3\
${goto 930}L 3
L 4${goto 350}L 4${goto 570}L 4
L 5${goto 350}L 5${goto 570}L 5
L 6\
${goto 570}L 6 plus\
${goto 350}${font OCR A Extended:bold:pixelsize=12}L 6
${font}L 7${goto 350}L 7${goto 940}L 7
L 8${goto 350}L 8${goto 940}L 8
${goto 350}L 9${goto 940}L 9
${goto 350}L 10${goto 730}L 10${goto 940}L 10
${goto 350}L 11\
${goto 940}L 11\
${goto 730}${font OCR A Extended:bold:pixelsize=24}L 11${font OCR A Extended:pixelsize=1}
${font}${goto 350}L 12${goto 940}L 12
${goto 730}L 13${goto 940}L 13
${goto 940}L 14
${goto 940}L 15
${goto 940}L 16
${goto 940}L 17
${goto 520}L 18${goto 940}L 18
${goto 520}L 19
${goto 520}L 20
${goto 520}L 21
${goto 520}L 22
${goto 520}L 23
${goto 520}L 24
${goto 520}L 25
${goto 520}L 26
${goto 520}L 27
${goto 520}L 28
${goto 520}L 29
${goto 200}L 32
${goto 200}L 33
${goto 200}L 34
${goto 200}L 35
${goto 200}L 36
${goto 200}L 37
${goto 200}L 38
${goto 200}L 39
${goto 200}L 40
${goto 200}L 41
${goto 200}L 42
Like I said - another option.
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat