SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#4701 2013-01-29 15:32:55

ragamatrix
#! CrunchBanger
From: Horgen Switzerland
Registered: 2012-12-05
Posts: 232

Re: The New Monster Conky Thread

@lionhead,
I got a perl script witch can display pictures photos maps or what you want in conky. I don't know what you wanted to do with the las tlua script ? May be this ?
You only want a lua script for that ?

Offline

Help fund CrunchBang, donate to the project!

#4702 2013-01-29 18:29:34

I-sty
New Member
Registered: 2013-01-28
Posts: 7

Re: The New Monster Conky Thread

Bradi wrote:

Your setup looks sweet, I-sty

Thanks Bradi wink

Offline

#4703 2013-01-29 21:54:42

bartos
Member
Registered: 2011-12-20
Posts: 25

Re: The New Monster Conky Thread

Simple conky. Gives me all the info I want.

eb1156234619694.jpg


Conky code

##################################
## VinDSL | rev. 11-05-06 15:37 ##
## Modified by mrpeachy June 2011 version 3 ##
##################################
## changes from original version
## simplification of formatting
## simplification of fonts
## simplification of calendar
## added additional objects
## set maximum width for conky to 245
## optimised for 900 pixel high resolution
##################################

####
## Prerequisites (required)
#
#  conky-all 1.8.0 or 1.8.1
#  conkyForecast 2.16 or newer
#  Weather.com XML Data Feed (XOAP)
#  UTF-8 Compatible Text Editor
#  gcal (available from repositories)

####
## Installed fonts (required)
#  (list has been modified)
#  Sans (almost certainly installed)
#  OpenLogos
#  ConkyWeather (Stanko Metodiev)
#  ConkyWindNESW (Stanko Metodiev)
#  Moon Phases (Curtis Clark)
#  OpenLogos (Icoma) not required in this version
#  PizzaDude Bullets (Jakob Fischer)
#  Radio Space (Iconian Fonts)
#  StyleBats (Vinterstille)
#  Weather (Jonathan Macagba)
#  formintElegance
#  [url]http://www.box.net/shared/a2tz2o9444[/url] this one for mint heading
#
## Tips n' Tricks from Mr. Peachy, djyoung4, and 42dorian (Thanks!)
## All necessary fonts can be found here: [url]http://ompldr.org/vODYxOQ[/url]
##  NOTE this archive contains additional fonts for the original version
## Unzip the fonts into your font folder, for example: /home/username/.fonts
## Run this command in a terminal (rebuilds font cache file): sudo fc-cache -fv

####
## Use XFT? Required to Force UTF8 (see below)
#
use_xft yes
xftfont Sans:size=10

####
## Force UTF8? Requires XFT (see above)
## Displays degree symbol, instead of °, etc.
#
override_utf8_locale yes

####
## This buffer is used for text, single lines, output from $exec, and other variables.
## Increasing the text buffer size (too high) will drastically reduce Conky's performance.
## Decreasing the size (too low) will truncate content and cause strange display output.
## Standard text buffer size is 256 bytes (cannot be less). Adjust YOUR buffer wisely!
#
text_buffer_size 384

####
## Daemonize Conky, aka 'fork to background'.
#
background yes

####
## Update interval in seconds.
#
update_interval 2

####
## This is the number of times Conky will update before quitting.
## Set to zero to run forever.
#
total_run_times 0

####
## Create own window instead of using desktop (required in nautilus)?
#
own_window yes
own_window_type desktop
own_window_transparent no
own_window_colour black

####
## Force images to redraw when they change.
#
imlib_cache_size 0

####
## Use double buffering? Reduces flicker.
#
double_buffer yes

####
## Draw shades?
#
draw_shades no

####
## Draw outlines?
#
draw_outline no

####
## Draw borders around text?
#
draw_borders no

####
## Draw borders around graphs?
#
draw_graph_borders yes

####
## Print text to stdout?
## Print text in console?
#
out_to_ncurses no
out_to_console no

####
## Text alignment.
#
alignment top_right

####
## Minimum size of text area.
#
minimum_size 1050 100
maximum_width 260
####
## Gap between text and screen borders.
#
gap_x 1390
gap_y 50

####
## Shorten MiB/GiB to M/G in stats.
#
short_units yes

####
## Pad % symbol spacing after numbers.
#
pad_percents 0

####
## Pad spacing between text and borders.
#
border_inner_margin 4

####
## Limit the length of names in "Top Processes".
#
top_name_width 6

####
## Subtract file system -/+buffers/cache from used memory?
## Set to yes, to produce meaningful physical memory stats.
#
no_buffers yes

####
## Set to yes, if you want all text to be in UPPERCASE.
#
uppercase no

####
## Number of cpu samples to average.
## Set to 1 to disable averaging.
#
cpu_avg_samples 2

####
## Number of net samples to average.
## Set to 1 to disable averaging.
#
net_avg_samples 2

####
## Add spaces to keep things from moving around?
## Only affects certain objects.
#
use_spacer right

####
## Colors
#
color1 Grey        ##icons
color2 Ivory       ##text
color3 DarkGrey    ##divider lines
color4 Orange        ##headings
color5 bfff80

#####
## Load Lua for shading (optional)
## Set the path to your script here.
#
lua_load /home/bill/.lua/test.lua
lua_draw_hook_pre draw_lua


TEXT
${voffset 3}${color2}${font}${voffset -3}${font Sans:size=18}${color4}Waldorf${font}

${font Sans:bold:size=10.25}${color4}Time & Date  ${color2}${hr 2}
${time %d %b. %Y}$alignr ${time %H:}${time %M:}${time %S}
${font Sans:bold:size=10.25}${color4}SYSTEM  ${color3}${hr 2}
${voffset 4}${font Stylebats:size=10}${color1}j${voffset -1}${font}${color2} ${sysname} ${kernel}${alignr}${machine}
${font StyleBats:size=10}${color1}q${voffset -1}${font}${color2} System Uptime${alignr}${uptime_short}
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} File System${alignr}${fs_type}
${voffset 4}${font Sans:bold:size=8}${color4}PROCESSORS  ${color3}${hr 2}

${goto 22}CPU 1${goto 80}CPU 2${goto 150}CPU 3${goto 220}CPU 4
${voffset 140}${font StyleBats:size=10}${color1}k${voffset -1}${font}${color2}${goto 20}${cpu cpu1}% ${font}${color2}${goto 85}${cpu cpu2}% ${font}${color2}${goto 156}${cpu cpu3}% ${font}${color2}${goto 230}${cpu cpu4}%
${font StyleBats:size=10}${color1}k${voffset -1}${font}${color2} ${freq_g 1} GHz  ${freq_g 2} GHz  ${freq_g 3} GHz  ${freq_g 4} GHz
${voffset 8}${font Sans:bold:size=8.25}${color4}MEMORY  ${color3}${hr 2}
${voffset 4}${font StyleBats:size=10}${color1}l${voffset -2}${font}${color2} RAM${goto 97}${mem}${goto 133}/ ${memmax}${alignr}${memperc}% Used
${font Sans:bold:size=8.25}${color4}CPU and FANS  ${color3}${hr 2}${font}
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} CPU temp ${alignr}${execi 1 cat /sys/module/k10temp/drivers/pci:k10temp/0000:00:18.3/temp1_input|cut -c  1,2} °C
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} Case Fan:${alignr} ${exec sensors | grep "fan1:" | sed 's/fan1/Case Fan/' | cut -c17-26}$color
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} Mobo Temp:${alignr} ${exec sensors | grep 'temp2' | cut -c15-20}c${color} 
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} NVidia Temp:${alignr} ${nvidia temp} °C
${font Sans:bold:size=8.25}${color4}HDD  ${color3}${hr 2}${font}
${voffset 4}${font StyleBats:size=10}${color1}x${font}${color2} ROOT${goto 95}${fs_used /}${goto 133}/ ${fs_size /}${alignr}${fs_free_perc /}% Free
${font StyleBats:size=10}${color1}x${font}${color2} HOME${goto 95}${fs_used /home}${goto 133}/ ${fs_size /home}${alignr}${fs_free_perc /home}% Free

${font Sans:bold:size=8.25}${color4}TOP PROCESSES  ${color3}${hr 2}${font}
${voffset 4}${font StyleBats:size=10}${color1}l${voffset -1}${font}${color4} RAM${goto 155}${font StyleBats:size=10}${color1}k${voffset -1}${font}${color4} CPU
${voffset 4}${color2}${top_mem name 1}${goto 60}${top_mem mem_res 1}${goto 100}${top_mem mem 1}%${goto 155}${top name 1}${goto 210}${top cpu 1}%
${top_mem name 2}${goto 60}${top_mem mem_res 2}${goto 100}${top_mem mem 2}%${goto 155}${top name 2}${goto 210}${top cpu 2}%
${top_mem name 3}${goto 60}${top_mem mem_res 3}${goto 100}${top_mem mem 3}%${goto 155}${top name 3}${goto 210}${top cpu 3}%
${voffset 4}${font Sans:bold:size=8.25}${color4}NETWORK  ${color3}${hr 2}${font}
${voffset 4}${color2}Public IP${alignr}${execi 1800 curl ifconfig.me}
Private IP${alignr}${addr eth0}${goto 150}
${font PizzaDude Bullets:size=9.5}${color1}U${font}${color2} Download${goto 103}${totaldown eth0}${goto 150}${font PizzaDudeBullets:size=9.5}${color1}T${font}${color2} Down${alignr}${downspeed eth0}
${font PizzaDudeBullets:size=9.5}${color1}O${font}${color2} Upload${goto 100}${totalup eth0}${goto 150}${font PizzaDudeBullets:size=9.5}${color1}N${font}${color2} Up${alignr}${upspeed eth0}

${font Arial:size=12}${color ffe595}WEATHER ${font}${hr 2}$color${texeci 500 bash $HOME/Accuweather_Conky_Int_Images/acc_int_images}
${image $HOME/Accuweather_Conky_Int_Images/cc.png -p 40,720 -s 120x72}
${font Arial:size=10}${color ffe595}TODAY${font}
${goto 165}${color ffe595}TEMP:  $color${execpi 600 sed -n '29p' $HOME/Accuweather_Conky_Int_Images/curr_cond}°C 
${goto 165}${color ffe595}WIND:  $color${execpi 600 sed -n '31p' $HOME/Accuweather_Conky_Int_Images/curr_cond} 
${goto 165}${color ffe595}HIGH:  $color${execpi 600 sed -n '26p' $HOME/Accuweather_Conky_Int_Images/first_days}°C 
${goto 165}${color ffe595}LOW:   $color${execpi 600 sed -n '27p' $HOME/Accuweather_Conky_Int_Images/first_days}°C
${font Arial:size=10}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_Int_Images/messages}
Chance of Precip: ${execpi 600 sed -n '28p' $HOME/Accuweather_Conky_Int_Images/first_days}
${hr 1}
${font}${color ffe595}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_Int_Images/first_days}${image $HOME/Accuweather_Conky_Int_Images/6.png -p 40,850 -s 120x72}
${goto 165}${color ffe595}HIGH:  $color${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_Int_Images/first_days}°C
${goto 165}${color ffe595}LOW:   $color${execpi 600 sed -n '31p' $HOME/Accuweather_Conky_Int_Images/first_days}°C

${voffset 40}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_Int_Images/messages}

And section of lua changed to get bars vertical

--line 1 title
cairo_rotate (cr,0*math.pi/180)
cairo_show_text (cr, "CPU");
cairo_rotate (cr, -90*math.pi/180)

bar_adjust=-2

--bar setup------------------------------------------------
settings={--CPU GRAPH CPU1
number=tonumber(conky_parse("${cpu cpu1}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=-305,--x coordinate
bar_starty=25+bar_adjust,--y coordinate
divisions=38,--number of blocks
div_width=2,--horizontal size
div_height=25,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)

Geek by nature
Linux by choice.
Crunchbang by default

Offline

#4704 2013-01-29 22:08:54

otak
#! Member
Registered: 2013-01-01
Posts: 50

Re: The New Monster Conky Thread

Hello try2ops.

  Do you use 'statler' or 'waldorf' version ?

  What is the output of:

  apt-cache policy conky

  You might succeed with this command:

  apt-get -t squeeze install conky.

I hope that helps.

Offline

#4705 2013-01-30 13:33:17

I-sty
New Member
Registered: 2013-01-28
Posts: 7

Re: The New Monster Conky Thread

bartos wrote:

Simple conky. Gives me all the info I want.

http://thumbnails101.imagebam.com/23462/eb1156234619694.jpg


Conky code

##################################
## VinDSL | rev. 11-05-06 15:37 ##
## Modified by mrpeachy June 2011 version 3 ##
##################################
## changes from original version
## simplification of formatting
## simplification of fonts
## simplification of calendar
## added additional objects
## set maximum width for conky to 245
## optimised for 900 pixel high resolution
##################################

####
## Prerequisites (required)
#
#  conky-all 1.8.0 or 1.8.1
#  conkyForecast 2.16 or newer
#  Weather.com XML Data Feed (XOAP)
#  UTF-8 Compatible Text Editor
#  gcal (available from repositories)

####
## Installed fonts (required)
#  (list has been modified)
#  Sans (almost certainly installed)
#  OpenLogos
#  ConkyWeather (Stanko Metodiev)
#  ConkyWindNESW (Stanko Metodiev)
#  Moon Phases (Curtis Clark)
#  OpenLogos (Icoma) not required in this version
#  PizzaDude Bullets (Jakob Fischer)
#  Radio Space (Iconian Fonts)
#  StyleBats (Vinterstille)
#  Weather (Jonathan Macagba)
#  formintElegance
#  [url]http://www.box.net/shared/a2tz2o9444[/url] this one for mint heading
#
## Tips n' Tricks from Mr. Peachy, djyoung4, and 42dorian (Thanks!)
## All necessary fonts can be found here: [url]http://ompldr.org/vODYxOQ[/url]
##  NOTE this archive contains additional fonts for the original version
## Unzip the fonts into your font folder, for example: /home/username/.fonts
## Run this command in a terminal (rebuilds font cache file): sudo fc-cache -fv

####
## Use XFT? Required to Force UTF8 (see below)
#
use_xft yes
xftfont Sans:size=10

####
## Force UTF8? Requires XFT (see above)
## Displays degree symbol, instead of °, etc.
#
override_utf8_locale yes

####
## This buffer is used for text, single lines, output from $exec, and other variables.
## Increasing the text buffer size (too high) will drastically reduce Conky's performance.
## Decreasing the size (too low) will truncate content and cause strange display output.
## Standard text buffer size is 256 bytes (cannot be less). Adjust YOUR buffer wisely!
#
text_buffer_size 384

####
## Daemonize Conky, aka 'fork to background'.
#
background yes

####
## Update interval in seconds.
#
update_interval 2

####
## This is the number of times Conky will update before quitting.
## Set to zero to run forever.
#
total_run_times 0

####
## Create own window instead of using desktop (required in nautilus)?
#
own_window yes
own_window_type desktop
own_window_transparent no
own_window_colour black

####
## Force images to redraw when they change.
#
imlib_cache_size 0

####
## Use double buffering? Reduces flicker.
#
double_buffer yes

####
## Draw shades?
#
draw_shades no

####
## Draw outlines?
#
draw_outline no

####
## Draw borders around text?
#
draw_borders no

####
## Draw borders around graphs?
#
draw_graph_borders yes

####
## Print text to stdout?
## Print text in console?
#
out_to_ncurses no
out_to_console no

####
## Text alignment.
#
alignment top_right

####
## Minimum size of text area.
#
minimum_size 1050 100
maximum_width 260
####
## Gap between text and screen borders.
#
gap_x 1390
gap_y 50

####
## Shorten MiB/GiB to M/G in stats.
#
short_units yes

####
## Pad % symbol spacing after numbers.
#
pad_percents 0

####
## Pad spacing between text and borders.
#
border_inner_margin 4

####
## Limit the length of names in "Top Processes".
#
top_name_width 6

####
## Subtract file system -/+buffers/cache from used memory?
## Set to yes, to produce meaningful physical memory stats.
#
no_buffers yes

####
## Set to yes, if you want all text to be in UPPERCASE.
#
uppercase no

####
## Number of cpu samples to average.
## Set to 1 to disable averaging.
#
cpu_avg_samples 2

####
## Number of net samples to average.
## Set to 1 to disable averaging.
#
net_avg_samples 2

####
## Add spaces to keep things from moving around?
## Only affects certain objects.
#
use_spacer right

####
## Colors
#
color1 Grey        ##icons
color2 Ivory       ##text
color3 DarkGrey    ##divider lines
color4 Orange        ##headings
color5 bfff80

#####
## Load Lua for shading (optional)
## Set the path to your script here.
#
lua_load /home/bill/.lua/test.lua
lua_draw_hook_pre draw_lua


TEXT
${voffset 3}${color2}${font}${voffset -3}${font Sans:size=18}${color4}Waldorf${font}

${font Sans:bold:size=10.25}${color4}Time & Date  ${color2}${hr 2}
${time %d %b. %Y}$alignr ${time %H:}${time %M:}${time %S}
${font Sans:bold:size=10.25}${color4}SYSTEM  ${color3}${hr 2}
${voffset 4}${font Stylebats:size=10}${color1}j${voffset -1}${font}${color2} ${sysname} ${kernel}${alignr}${machine}
${font StyleBats:size=10}${color1}q${voffset -1}${font}${color2} System Uptime${alignr}${uptime_short}
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} File System${alignr}${fs_type}
${voffset 4}${font Sans:bold:size=8}${color4}PROCESSORS  ${color3}${hr 2}

${goto 22}CPU 1${goto 80}CPU 2${goto 150}CPU 3${goto 220}CPU 4
${voffset 140}${font StyleBats:size=10}${color1}k${voffset -1}${font}${color2}${goto 20}${cpu cpu1}% ${font}${color2}${goto 85}${cpu cpu2}% ${font}${color2}${goto 156}${cpu cpu3}% ${font}${color2}${goto 230}${cpu cpu4}%
${font StyleBats:size=10}${color1}k${voffset -1}${font}${color2} ${freq_g 1} GHz  ${freq_g 2} GHz  ${freq_g 3} GHz  ${freq_g 4} GHz
${voffset 8}${font Sans:bold:size=8.25}${color4}MEMORY  ${color3}${hr 2}
${voffset 4}${font StyleBats:size=10}${color1}l${voffset -2}${font}${color2} RAM${goto 97}${mem}${goto 133}/ ${memmax}${alignr}${memperc}% Used
${font Sans:bold:size=8.25}${color4}CPU and FANS  ${color3}${hr 2}${font}
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} CPU temp ${alignr}${execi 1 cat /sys/module/k10temp/drivers/pci:k10temp/0000:00:18.3/temp1_input|cut -c  1,2} °C
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} Case Fan:${alignr} ${exec sensors | grep "fan1:" | sed 's/fan1/Case Fan/' | cut -c17-26}$color
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} Mobo Temp:${alignr} ${exec sensors | grep 'temp2' | cut -c15-20}c${color} 
${font StyleBats:size=10}${color1}o${voffset -1}${font}${color2} NVidia Temp:${alignr} ${nvidia temp} °C
${font Sans:bold:size=8.25}${color4}HDD  ${color3}${hr 2}${font}
${voffset 4}${font StyleBats:size=10}${color1}x${font}${color2} ROOT${goto 95}${fs_used /}${goto 133}/ ${fs_size /}${alignr}${fs_free_perc /}% Free
${font StyleBats:size=10}${color1}x${font}${color2} HOME${goto 95}${fs_used /home}${goto 133}/ ${fs_size /home}${alignr}${fs_free_perc /home}% Free

${font Sans:bold:size=8.25}${color4}TOP PROCESSES  ${color3}${hr 2}${font}
${voffset 4}${font StyleBats:size=10}${color1}l${voffset -1}${font}${color4} RAM${goto 155}${font StyleBats:size=10}${color1}k${voffset -1}${font}${color4} CPU
${voffset 4}${color2}${top_mem name 1}${goto 60}${top_mem mem_res 1}${goto 100}${top_mem mem 1}%${goto 155}${top name 1}${goto 210}${top cpu 1}%
${top_mem name 2}${goto 60}${top_mem mem_res 2}${goto 100}${top_mem mem 2}%${goto 155}${top name 2}${goto 210}${top cpu 2}%
${top_mem name 3}${goto 60}${top_mem mem_res 3}${goto 100}${top_mem mem 3}%${goto 155}${top name 3}${goto 210}${top cpu 3}%
${voffset 4}${font Sans:bold:size=8.25}${color4}NETWORK  ${color3}${hr 2}${font}
${voffset 4}${color2}Public IP${alignr}${execi 1800 curl ifconfig.me}
Private IP${alignr}${addr eth0}${goto 150}
${font PizzaDude Bullets:size=9.5}${color1}U${font}${color2} Download${goto 103}${totaldown eth0}${goto 150}${font PizzaDudeBullets:size=9.5}${color1}T${font}${color2} Down${alignr}${downspeed eth0}
${font PizzaDudeBullets:size=9.5}${color1}O${font}${color2} Upload${goto 100}${totalup eth0}${goto 150}${font PizzaDudeBullets:size=9.5}${color1}N${font}${color2} Up${alignr}${upspeed eth0}

${font Arial:size=12}${color ffe595}WEATHER ${font}${hr 2}$color${texeci 500 bash $HOME/Accuweather_Conky_Int_Images/acc_int_images}
${image $HOME/Accuweather_Conky_Int_Images/cc.png -p 40,720 -s 120x72}
${font Arial:size=10}${color ffe595}TODAY${font}
${goto 165}${color ffe595}TEMP:  $color${execpi 600 sed -n '29p' $HOME/Accuweather_Conky_Int_Images/curr_cond}°C 
${goto 165}${color ffe595}WIND:  $color${execpi 600 sed -n '31p' $HOME/Accuweather_Conky_Int_Images/curr_cond} 
${goto 165}${color ffe595}HIGH:  $color${execpi 600 sed -n '26p' $HOME/Accuweather_Conky_Int_Images/first_days}°C 
${goto 165}${color ffe595}LOW:   $color${execpi 600 sed -n '27p' $HOME/Accuweather_Conky_Int_Images/first_days}°C
${font Arial:size=10}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_Int_Images/messages}
Chance of Precip: ${execpi 600 sed -n '28p' $HOME/Accuweather_Conky_Int_Images/first_days}
${hr 1}
${font}${color ffe595}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_Int_Images/first_days}${image $HOME/Accuweather_Conky_Int_Images/6.png -p 40,850 -s 120x72}
${goto 165}${color ffe595}HIGH:  $color${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_Int_Images/first_days}°C
${goto 165}${color ffe595}LOW:   $color${execpi 600 sed -n '31p' $HOME/Accuweather_Conky_Int_Images/first_days}°C

${voffset 40}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_Int_Images/messages}

And section of lua changed to get bars vertical

--line 1 title
cairo_rotate (cr,0*math.pi/180)
cairo_show_text (cr, "CPU");
cairo_rotate (cr, -90*math.pi/180)

bar_adjust=-2

--bar setup------------------------------------------------
settings={--CPU GRAPH CPU1
number=tonumber(conky_parse("${cpu cpu1}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=-305,--x coordinate
bar_starty=25+bar_adjust,--y coordinate
divisions=38,--number of blocks
div_width=2,--horizontal size
div_height=25,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)

@bartos,

Your conky looks well.

I have two questins.
First: I have a IVY Bridge processor, and How do I to get my temp?
Second: Which weather script to use? Can you sent me in a mail? (or here)

Cheers Isti

Offline

#4706 2013-01-31 09:19:17

ragamatrix
#! CrunchBanger
From: Horgen Switzerland
Registered: 2012-12-05
Posts: 232

Re: The New Monster Conky Thread

PackRat wrote:
Sector11 wrote:

Hey PackRat...

How about a nice little clock to go with your conky on the top left?
I think it would look nice with that conky, just an opinion.


Why not.

http://t.imgbox.com/abbN6w9Z.jpg

Hello PackRat,
I find your clock really discret and nice, can you post this clock please ?

Offline

#4707 2013-01-31 13:47:51

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,259

Re: The New Monster Conky Thread


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#4708 2013-01-31 15:59:18

ragamatrix
#! CrunchBanger
From: Horgen Switzerland
Registered: 2012-12-05
Posts: 232

Re: The New Monster Conky Thread

PackRat wrote:

Thanks a lot !
Here's an quite old one but nice too :
clock

Conky:

# Conky settings #
background yes
update_interval 1
own_window_argb_visual yes
cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

temperature_unit fahrenheit

# Window specifications #

own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 200 200
maximum_width 210

alignment tr
gap_x 20
gap_y 178

# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# Text settings #
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5

uppercase no

temperature_unit celsius


default_color FFFFFF

# Lua Load  #
lua_load ~/.conky/conky27/clock_rings.lua
lua_draw_hook_pre clock_rings

lua_load ~/.conky/conky27/transbg.lua
lua_draw_hook_post draw_bg 90 10 10 180 180 0x140C0B 0.3


TEXT

Clock.lua:

--[[
Clock Rings by Linux Mint (2011) reEdited by despot77

This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.

IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/clock_rings.lua
    lua_draw_hook_pre clock_rings
    
Changelog:
+ v1.0 -- Original release (30.09.2009)
   v1.1p -- Jpope edit londonali1010 (05.10.2009)
*v 2011mint -- reEdit despot77 (18.02.2011)
]]

settings_table = {
    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        name='time',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
        arg='%I.%M',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
        max=12,
        -- "bg_colour" is the colour of the base ring.
        bg_colour=0xffffff,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.1,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xFFDEAD,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.3,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
        x=100, y=100,
        -- "radius" is the radius of the ring.
        radius=75,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=5,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
        end_angle=360
    },
    {
        name='time',
        arg='%M.%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF3030,
        fg_alpha=0.7,
        x=100, y=100,
        radius=81,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.3,
        fg_colour=0xEEC900,
        fg_alpha=0.6,
        x=100, y=100,
        radius=87,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    --[[{
        name='time',
        arg='%d',
        max=31,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=100, y=105,
        radius=70,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='time',
        arg='%m',
        max=12,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=1,
        x=100, y=105,
        radius=76,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=50, y=300,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=75, y=350,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=100, y=400,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=125, y=450,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
        {
        name='downspeedf',
        arg='eth0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x339900,
        fg_alpha=0.8,
        x=150, y=500,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
        {
        name='upspeedf',
        arg='eth0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xff6600,
        fg_alpha=0.8,
        x=150, y=500,
        radius=20,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },--]]
}

-- Use these settings to define the origin and extent of your clock.

clock_r=88

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.

clock_x=100
clock_y=100

show_seconds=true

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 draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
    
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)

    -- Draw background ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
    
    -- Draw indicator ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)        
end

function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys
    
    secs=os.date("%S")    
    mins=os.date("%M")
    hours=os.date("%I")
        
    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12
        
    -- Draw hour hand
    
    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)
    
    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,240/255,233/255,194/255,1.0)
    cairo_stroke(cr)
    
    -- Draw minute hand
    
    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)
    
    cairo_set_line_width(cr,3)
    cairo_stroke(cr)
    
    -- Draw seconds hand
    
    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)
    
        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

function conky_clock_rings()
    local function setup_rings(cr,pt)
        local str=''
        local value=0
        
        str=string.format('${%s %s}',pt['name'],pt['arg'])
        str=conky_parse(str)
        
        value=tonumber(str)
        pct=value/pt['max']
        
        draw_ring(cr,pct,pt)
    end
    
    -- Check that Conky has been running for at least 5s

    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=conky_parse('${updates}')
    update_num=tonumber(updates)
    
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    
    draw_clock_hands(cr,clock_x,clock_y)
end

You can uncomment things to have the cpu; mem down and up stufs...

Offline

#4709 2013-02-01 18:26:53

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: The New Monster Conky Thread

So I know I have been gone for awhile but I am back and I brought my version of a clock.
2013_02_01_1359742190_240x219_scrot.png
Mine
2013_02_01_1359742249_216x210_scrot.png
Style set 1
2013_02_01_1359742277_215x211_scrot.png
style set 2
2013_02_01_1359742336_222x206_scrot.png
Style set 3
2013_02_01_1359742360_230x218_scrot.png
Style set 4

I set it up so this clock is completely customizable, so each person can find their own version of the clock. I also labeled the code I copied from mrpeachy. credit where credit is due

--this lua script for use in conky
require 'cairo'
extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
function conky_clock()
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 updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--######################################################################
-- Settings ############################################################
--######################################################################
center_x=110
center_y=110
--style set 0 for none or 1, 2, 3, 4, or mine
style_set=1
--clock face 1 or 2
clock_face=2
--hours on the clock 12 or 24
hours=12
--visiblity 1 or 0
hands=1
lights=0
digital=0
chrono=0
gears=0
texts=1
--the second interval displayed 5, 10, or 15
seconds=15
-- Colors
d_font_red=.8
d_font_green=.8
d_font_blue=.8
d_font_alpha=1
br_red=.5
br_green=.5
br_blue=.5
br_alpha=1
bg_red=.05
bg_green=.05
bg_blue=.05
bg_alpha=1
lights_red=.2
lights_green=.2
lights_blue=1
lights_alpha=.75
hands_red=.5
hands_green=.5
hands_blue=.5
hands_ired=.25
hands_igreen=.25
hands_iblue=.25
hands_alpha=1
--######################################################################
-- Style Sets ##########################################################
--######################################################################
if style_set == 1 then
clock_face=1
hours=12
hands=0
lights=1
digital=1
chrono=0
gears=0
texts=1
seconds=5
end
if style_set == 2 then
clock_face=2
hours=12
hands=1
lights=0
digital=0
chrono=0
gears=0
texts=1
seconds=5
end
if style_set == 3 then
clock_face=1
hours=24
hands=0
lights=1
digital=0
chrono=1
gears=1
texts=1
seconds=10
end
if style_set == 4 then
clock_face=2
hours=24
hands=1
lights=0
digital=0
chrono=1
gears=1
texts=1
seconds=10
end
if style_set == mine then
clock_face=2
hours=24
hands=1
lights=1
digital=0
chrono=1
gears=1
texts=1
seconds=5
end
--######################################################################
-- Strings #############################################################
--######################################################################
d_line_width=1
d_math=math.pi/180
d_font="mono"
d_font_size=11
d_font_slant=CAIRO_FONT_SLANT_NORMAL
d_font_face=CAIRO_FONT_WEIGHT_NORMAL
outer_radius=100
year=conky_parse("${time %y}")
month_number=tonumber(conky_parse("${time %m}"))
weekday=conky_parse("${time %u}")
day=conky_parse("${time %a}")
abbr_month=conky_parse("${time %b}")
day_number=conky_parse("${time %d}")
ampm=conky_parse("${time %p}")
second=tonumber(conky_parse("${time %S}"))
minute=tonumber(conky_parse("${time %M}"))
if hours ~= 12 then hours=24 end
if hours == 12 then
hour=tonumber(conky_parse("${time %I}"))
time_hms=conky_parse("${time %r}")
i_start=1
i_end=12
else
hour=tonumber(conky_parse("${time %H}"))
time_hms=conky_parse("${time %T}")
i_start=0
i_end=hours-1
end
--######################################################################
-- Gears ###############################################################
--######################################################################
if gears == 1 then
gear((center_x+45),(center_y+45),25,25,6,second,60,1,.75)
gear((center_x-45),(center_y+45),25,20,6,((minute*60)+second),(60*60),0,.75)
gear((center_x+45),(center_y-45),25,15,6,((hour*60)+(minute*60)+second),(60*60*60),1,.75)
gear((center_x-45),(center_y-45),25,10,6,((day_number*24)+(hour*60)+(minute*60)+second),(60*60*60*24),1,.75)
end
--######################################################################
-- Chrono ##############################################################
--######################################################################
if chrono == 1 then
--left weekday
cairo_set_line_width(cr,2)
cairo_arc(cr,(center_x-35),center_y,25,(0*d_math),(360*d_math))
cairo_arc_negative(cr,(center_x-35),center_y,12,(360*d_math),(0*d_math))
cairo_set_source_rgba(cr,bg_red,bg_green,bg_blue,bg_alpha)
cairo_fill(cr)
cairo_set_line_width(cr,2)
cairo_arc(cr,(center_x-35),center_y,25,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,2)
cairo_arc(cr,(center_x-35),center_y,12,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
cairo_set_source_rgba(cr,d_font_red,d_font_green,d_font_blue,d_font_alpha)
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
for i=1,7 do
weekdays={"S","M","T","W","T","F","S"}
	x,y=pt((center_x-35),center_y,18.5,((360/7)*(i-1)))
	text({y=y,x=x,t=(weekdays[i]),hj="c",vj="m"})
end--for
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
cairo_stroke(cr)
weekday_position=(-90*d_math)+(((360/7)*weekday)*d_math)
cairo_set_line_width(cr,2)
cairo_move_to(cr,(center_x-35),center_y)
cairo_arc(cr,(center_x-35),center_y,20,weekday_position,weekday_position)
cairo_set_source_rgba(cr,.75,.75,.75,1)
cairo_stroke(cr)
--up month day
cairo_set_line_width(cr,2)
cairo_arc(cr,center_x,(center_y-35),25,(0*d_math),(360*d_math))
cairo_arc_negative(cr,center_x,(center_y-35),12,(360*d_math),(0*d_math))
cairo_set_source_rgba(cr,bg_red,bg_green,bg_blue,bg_alpha)
cairo_fill(cr)
cairo_set_line_width(cr,2)
cairo_arc(cr,center_x,(center_y-35),25,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,2)
cairo_arc(cr,center_x,(center_y-35),12,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
month_days={31,28,31,30,31,30,31,31,30,31,30,31}
month_set=month_days[(month_number)]
for i=1,(month_set) do
month_day_marker=(-90*d_math)+(((360/month_set)*i)*d_math)
cairo_set_line_width(cr,1)
cairo_arc(cr,center_x,(center_y-35),25,month_day_marker,month_day_marker)
cairo_arc(cr,center_x,(center_y-35),20,month_day_marker,month_day_marker)
cairo_set_source_rgba(cr,.75,.75,.75,1)
cairo_stroke(cr)
end--for
cairo_set_source_rgba(cr,d_font_red,d_font_green,d_font_blue,d_font_alpha)
cairo_set_font_size (cr,8)
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
for i=1,(month_set) do
	if i == 5 or i == 10 or i == 15 or i == 20 or i == 25 or i == month_set then
	x,y=pt(center_x,(center_y-35),18.5,((360/month_set)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
cairo_stroke(cr)
day_indicator=(-90*d_math)+(((360/month_set)*day_number)*d_math)
cairo_set_line_width(cr,2)
cairo_move_to(cr,center_x,(center_y-35))
cairo_arc(cr,center_x,(center_y-35),20,day_indicator,day_indicator)
cairo_set_source_rgba(cr,.75,.75,.75,1)
cairo_stroke(cr)
--right year
cairo_set_line_width(cr,2)
cairo_arc(cr,(center_x+35),center_y,25,(0*d_math),(360*d_math))
cairo_arc_negative(cr,(center_x+35),center_y,12,(360*d_math),(0*d_math))
cairo_set_source_rgba(cr,bg_red,bg_green,bg_blue,bg_alpha)
cairo_fill(cr)
cairo_set_line_width(cr,2)
cairo_arc(cr,(center_x+35),center_y,25,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,2)
cairo_arc(cr,(center_x+35),center_y,12,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
--when the year needs updated replace the start_year with the current year
start_year=13
cairo_set_font_size(cr,9)
cairo_set_source_rgba(cr,d_font_red,d_font_green,d_font_blue,d_font_alpha)
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
for i=1,4 do
	x,y=pt((center_x+35),center_y,18.5,((360/4)*i))
	text({y=y,x=x,t=(start_year+(i-1)),hj="c",vj="m"})
end--for
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
cairo_stroke(cr)
cairo_set_font_size (cr,d_font_size)
year_indicator=(-90*d_math)+(((360/4)*(year-(start_year-1)))*d_math)
cairo_set_line_width(cr,2)
cairo_move_to(cr,(center_x+35),center_y)
cairo_arc(cr,(center_x+35),center_y,20,year_indicator,year_indicator)
cairo_set_source_rgba(cr,.75,.75,.75,1)
cairo_stroke(cr)
--down month
cairo_set_line_width(cr,2)
cairo_arc(cr,center_x,(center_y+35),25,(0*d_math),(360*d_math))
cairo_arc_negative(cr,center_x,(center_y+35),12,(360*d_math),(0*d_math))
cairo_set_source_rgba(cr,bg_red,bg_green,bg_blue,bg_alpha)
cairo_fill(cr)
cairo_set_line_width(cr,2)
cairo_arc(cr,center_x,(center_y+35),25,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,2)
cairo_arc(cr,center_x,(center_y+35),12,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
for i=1,12 do
month_indicator_marks=((360/12)*d_math)*i
cairo_set_line_width(cr,1)
cairo_arc(cr,center_x,(center_y+35),25,month_indicator_marks,month_indicator_marks)
cairo_arc(cr,center_x,(center_y+35),20,month_indicator_marks,month_indicator_marks)
cairo_set_source_rgba(cr,.75,.75,.75,1)
cairo_stroke(cr)
end--for
cairo_set_source_rgba(cr,d_font_red,d_font_green,d_font_blue,d_font_alpha)
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
for i=1,12 do
	if i == 3 or i == 6 or i == 9 or i == 12 then
	x,y=pt(center_x,(center_y+35),18,((360/12)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
cairo_stroke(cr)
month_indicator=(-90*d_math)+(((360/12)*month_number)*d_math)
cairo_set_line_width(cr,2)
cairo_move_to(cr,center_x,(center_y+35))
cairo_arc(cr,center_x,(center_y+35),20,month_indicator,month_indicator)
cairo_set_source_rgba(cr,.75,.75,.75,1)
cairo_stroke(cr)
end--chrono
--######################################################################
-- Face one ############################################################
--######################################################################
if clock_face == 1 then
--background
cairo_set_line_width(cr,5)
cairo_arc(cr,center_x,center_y,outer_radius,(-90*d_math),(270*d_math))
cairo_arc_negative(cr,center_x,center_y,(outer_radius-35),(270*d_math),(-90*d_math))
cairo_set_source_rgba(cr,bg_red,bg_green,bg_blue,bg_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
--seconds
second_radius1=outer_radius-2.5
second_radius2=second_radius1-10
for i=0,59 do
second_start=((i*(360/60))*d_math)
second_end=second_start+((360/60)*d_math)
second_start_math=(second_end-second_start)/2
second_start1=second_start-second_start_math-(90*d_math)
second_end1=second_start1+((360/60)*d_math)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,center_x,center_y,second_radius1,second_start1,second_end1)
cairo_arc_negative(cr,center_x,center_y,second_radius2,second_end1,second_start1)
cairo_close_path(cr)
if lights == 1 then
if i == second then
cairo_set_source_rgba(cr,lights_red,lights_green,lights_blue,lights_alpha)
cairo_fill_preserve(cr)
end
end--lights
cairo_set_source_rgba(cr,.25,.25,.25,1)
cairo_stroke(cr)
end--for seconds end
--minutes
for i=0,59 do
minute_radius=second_radius2-10
minute_start=((i*(360/60))*d_math)
minute_end=minute_start+((360/60)*d_math)
minute_start_math=(minute_end-minute_start)/2
minute_start1=minute_start-minute_start_math-(90*d_math)
minute_end1=minute_start1+((360/60)*d_math)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,center_x,center_y,second_radius2,minute_start1,minute_end1)
cairo_arc_negative(cr,center_x,center_y,minute_radius,minute_end1,minute_start1)
cairo_close_path(cr)
if lights == 1 then
if i == minute then
cairo_set_source_rgba(cr,lights_red,lights_green,lights_blue,lights_alpha)
cairo_fill_preserve(cr)
end
end--lights
cairo_set_source_rgba(cr,.25,.25,.25,1)
cairo_stroke(cr)
end--for minutes end
--hours
for i=i_start,i_end do
hour_radius=minute_radius-10
hour_start=((i*(360/hours))*d_math)
hour_end=hour_start+((360/hours)*d_math)
hour_start_math=((hour_end-hour_start)/2)
hour_start1=hour_start-hour_start_math-(90*d_math)
hour_end1=hour_start1+((360/hours)*d_math)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,center_x,center_y,minute_radius,hour_start1,hour_end1)
cairo_arc_negative(cr,center_x,center_y,hour_radius,hour_end1,hour_start1)
cairo_close_path(cr)
if lights == 1 then
if i == hour then
cairo_set_source_rgba(cr,lights_red,lights_green,lights_blue,lights_alpha)
cairo_fill_preserve(cr)
end
end--lights
cairo_set_source_rgba(cr,.25,.25,.25,1)
cairo_stroke(cr)
end--for hours end
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
if texts==1 then
cairo_set_source_rgba(cr,d_font_red,d_font_green,d_font_blue,d_font_alpha)
if hours==24 then
for i=0,23 do
	if i==0 or i==2 or i==4 or i==6 or i==8 or i==10 or i==12 or i==14 or i==16 or i==18 or i==20 or i==22 then
	x,y=pt(center_x,center_y,(hour_radius+5),((360/24)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
elseif hours==12 then
for i=1,12 do
	x,y=pt(center_x,center_y,(hour_radius+5),((360/12)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
end--for
end--hours
if seconds==5 then
for i=0,59 do
	if i==0 or i==5 or i==10 or i==15 or i==20 or i==25 or i==30 or i==35 or i==40 or i==45 or i==50 or i==55 then
	x,y=pt(center_x,center_y,(second_radius2),((360/60)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
elseif seconds==10 then
for i=0,59 do
	if i==0 or i==10 or i==20 or i==30 or i==40 or i==50 then
	x,y=pt(center_x,center_y,(second_radius2),((360/60)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
elseif seconds==15 then
for i=0,59 do
	if i==0 or i==15 or i==30 or i==45 then
	x,y=pt(center_x,center_y,(second_radius2),((360/60)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
end--second
cairo_stroke(cr)
end--texts
--######################################################################
-- mrpeacy code end ####################################################
--######################################################################
end--clock face one
--######################################################################
-- Face two ############################################################
--######################################################################
if clock_face == 2 then
hour_markers_radius=outer_radius-20
second_markers_radius=outer_radius-10
--background
cairo_set_line_width(cr,1)
cairo_arc(cr,center_x,center_y,outer_radius,(-90*d_math),(270*d_math))
cairo_arc_negative(cr,center_x,center_y,(hour_markers_radius-13),(270*d_math),(-90*d_math))
cairo_set_source_rgba(cr,bg_red,bg_green,bg_blue,bg_alpha)
cairo_fill(cr)
cairo_set_line_width(cr,5)
cairo_arc(cr,center_x,center_y,outer_radius,(-90*d_math),(270*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,2)
cairo_arc(cr,center_x,center_y,(hour_markers_radius-13),(-90*d_math),(270*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
if texts==1 then
cairo_set_source_rgba(cr,d_font_red,d_font_green,d_font_blue,d_font_alpha)
if hours==24 then
for i=0,23 do
	if i==0 or i==2 or i==4 or i==6 or i==8 or i==10 or i==12 or i==14 or i==16 or i==18 or i==20 or i==22 then
	x,y=pt(center_x,center_y,(hour_markers_radius-5),((360/24)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
elseif hours==12 then
for i=1,12 do
	x,y=pt(center_x,center_y,(hour_markers_radius-5),((360/12)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
end--for
end--hours
if seconds==5 then
for i=0,59 do
	if i==0 or i==5 or i==10 or i==15 or i==20 or i==25 or i==30 or i==35 or i==40 or i==45 or i==50 or i==55 then
	x,y=pt(center_x,center_y,second_markers_radius,((360/60)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
elseif seconds==10 then
for i=0,59 do
	if i==0 or i==10 or i==20 or i==30 or i==40 or i==50 then
	x,y=pt(center_x,center_y,second_markers_radius,((360/60)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
elseif seconds==15 then
for i=0,59 do
	if i==0 or i==15 or i==30 or i==45 then
	x,y=pt(center_x,center_y,second_markers_radius,((360/60)*i))
	text({y=y,x=x,t=i,hj="c",vj="m"})
	end
end--for
end--seconds
cairo_stroke(cr)
end--texts
--######################################################################
-- mrpeacy code end ####################################################
--######################################################################
--second lights
sl_math1=(-90*d_math)+(((360/60)*second)*d_math)
if lights ==1 then
cairo_set_line_width(cr,3)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_arc(cr,center_x,center_y,hour_markers_radius,(-90*d_math),sl_math1)
cairo_set_source_rgba(cr,lights_red,lights_green,lights_blue,lights_alpha)
cairo_stroke(cr)
end--lights
--minute
for i=1,60 do
second_markers_position=(-90*d_math)+((i*(360/60))*d_math)
cairo_set_line_width(cr,d_line_width)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_BUTT)
cairo_arc(cr,center_x,center_y,outer_radius,second_markers_position,second_markers_position)
cairo_arc(cr,center_x,center_y,second_markers_radius,second_markers_position,second_markers_position)
cairo_set_source_rgba(cr,.75,.75,.75,1)
cairo_stroke(cr)
if lights == 1 then
if i == minute then
cairo_set_line_width(cr,6)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_arc(cr,center_x,center_y,(outer_radius-2),second_markers_position,second_markers_position)
cairo_arc(cr,center_x,center_y,(second_markers_radius-5),second_markers_position,second_markers_position)
cairo_set_source_rgba(cr,lights_red,lights_green,lights_blue,lights_alpha)
cairo_stroke(cr)
end--minute
end--lights
end--for
--hour
for i=i_start,i_end do
hour_markers_position=(-90*d_math)+(i*(360/hours))*d_math
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,center_x,center_y,outer_radius,hour_markers_position,hour_markers_position)
cairo_arc(cr,center_x,center_y,hour_markers_radius,hour_markers_position,hour_markers_position)
cairo_set_source_rgba(cr,1,1,1,1)
cairo_stroke(cr)
if lights == 1 then
if i == hour then
cairo_set_line_width(cr,6)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_arc(cr,center_x,center_y,(outer_radius-2),hour_markers_position,hour_markers_position)
cairo_arc(cr,center_x,center_y,(hour_markers_radius-5),hour_markers_position,hour_markers_position)
cairo_set_source_rgba(cr,lights_red,lights_green,lights_blue,lights_alpha)
cairo_stroke(cr)
end--hour
end--lights
end--for hour
--outer ring
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,center_x,center_y,outer_radius,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,1,1,1,1)
cairo_stroke(cr)
end--clock face two
--######################################################################
-- Hands ###############################################################
--######################################################################
if hands == 1 then
hour_hand_radius1=outer_radius-30
hour_hand_radius2=outer_radius-50
hour_position=(-90*d_math)+(((360/(hours*60*60))*((hour*60*60)+(minute*60)+second))*d_math)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,center_x,center_y,10,(hour_position-(20*d_math)),(hour_position+(20*d_math)))
cairo_arc(cr,center_x,center_y,hour_hand_radius2,(hour_position+(5*d_math)),(hour_position+(5*d_math)))
cairo_arc(cr,center_x,center_y,hour_hand_radius1,hour_position,hour_position)
cairo_arc(cr,center_x,center_y,hour_hand_radius2,(hour_position-(5*d_math)),(hour_position-(5*d_math)))
cairo_close_path(cr)
cairo_set_source_rgba(cr,hands_ired,hands_igreen,hands_iblue,hands_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,hands_red,hands_green,hands_blue,hands_alpha)
cairo_stroke(cr)
minute_hand_radius1=outer_radius-15
minute_hand_radius2=outer_radius-35
minute_position=(-90*d_math)+(((360/(60*60))*((minute*60)+second))*d_math)
cairo_set_line_width(cr,d_line_width)
cairo_arc(cr,center_x,center_y,10,(minute_position-(20*d_math)),(minute_position+(20*d_math)))
cairo_arc(cr,center_x,center_y,minute_hand_radius2,(minute_position+(5*d_math)),(minute_position+(5*d_math)))
cairo_arc(cr,center_x,center_y,minute_hand_radius1,minute_position,minute_position)
cairo_arc(cr,center_x,center_y,minute_hand_radius2,(minute_position-(5*d_math)),(minute_position-(5*d_math)))
cairo_close_path(cr)
cairo_set_source_rgba(cr,hands_ired,hands_igreen,hands_iblue,hands_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,hands_red,hands_green,hands_blue,hands_alpha)
cairo_stroke(cr)
second_hand_radius=outer_radius-5
second_position=(-90*d_math)+(((360/60)*second)*d_math)
cairo_set_line_width(cr,2)
cairo_move_to(cr,center_x,center_y)
cairo_arc(cr,center_x,center_y,second_hand_radius,second_position,second_position)
cairo_set_source_rgba(cr,hands_red,hands_green,hands_blue,hands_alpha)
cairo_stroke(cr)
cairo_set_line_width(cr,1)
cairo_arc(cr,center_x,center_y,10,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,0,0,0,1)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,.5,.5,.5,1)
cairo_stroke(cr)
--am & pm
if hours == 12 then
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,10)
cairo_set_source_rgba (cr,d_font_red,d_font_green,d_font_blue,d_font_alpha)
cairo_move_to (cr,(center_x-6.25),(center_y+3.25))
cairo_show_text (cr,ampm)
cairo_stroke (cr)
else
cairo_set_line_width(cr,2)
cairo_arc(cr,center_x,center_y,5,(0*d_math),(360*d_math))
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_fill(cr)
end--am & pm
end-- hands
--######################################################################
-- Digital #############################################################
--######################################################################
if digital == 1 then
ph=15
pw=40
p1x=center_x-pw
p1y=center_y-ph
p2x=center_x+pw
p2y=center_y+ph
pr=10
cairo_set_line_width(cr,2)
cairo_arc(cr,p1x,p1y,pr,(180*d_math),(270*d_math))
cairo_arc(cr,p2x,p1y,pr,(270*d_math),0)
cairo_arc(cr,p2x,p2y,pr,0,(90*d_math))
cairo_arc(cr,p1x,p2y,pr,(90*d_math),(180*d_math))
cairo_close_path(cr)
cairo_set_source_rgba(cr,bg_red,bg_green,bg_blue,bg_alpha)
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,br_red,br_green,br_blue,br_alpha)
cairo_stroke(cr)
for i=1,4 do
line=6
x1=center_x-40
y1=center_y-line
x2=center_x
y2=center_y-line
x3=center_x+25
y3=center_y-line
x4=center_x-45
y4=center_y+15
if hours == 12 then time_s=14 else time_s=18 end
s={16,d_font_size,d_font_size,time_s}
x={x1,x2,x3,x4}
y={y1,y2,y3,y4}
t={day,abbr_month,day_number,time_hms}
cairo_select_font_face (cr,d_font,d_font_slant,d_font_face);
cairo_set_font_size (cr,s[i])
cairo_set_source_rgba (cr,d_font_red,d_font_green,d_font_blue,d_font_alpha)
cairo_move_to (cr,x[i],y[i])
cairo_show_text (cr,t[i])
cairo_stroke (cr)
end--for
end--digital
--######################################################################
--######################################################################
--######################################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
--######################################################################
--Functions ############################################################
--######################################################################
function gear(position_x,position_y,radius,outer_teeth,inner_teeth,speed,speed_scale,direction,visibility)
gear_red=.75
gear_green=.75
gear_blue=.75
gear_line_width=4
gear_math=(math.pi/180)
gear_start=0
gear_end=360*gear_math
outer_teeth_radius=(radius)+gear_line_width
inner_radius=10
inner_teeth_radius=inner_radius+gear_line_width
--outer gear
cairo_set_line_width(cr,gear_line_width)
cairo_set_source_rgba(cr,gear_red,gear_green,gear_blue,(visibility))
cairo_arc(cr,(position_x),(position_y),(radius),gear_start,gear_end)
cairo_stroke(cr)
--outer gear teeth
for i=1,(outer_teeth) do
tooth_size=(360/(outer_teeth))/3
tooth_space=(360/(outer_teeth))
tooth_math=(((i-1)*tooth_space)+tooth_size)*gear_math
tooth_math2=(((360/(speed_scale))*(speed))*gear_math)
if (direction) == 1 then tooth=tooth_math+tooth_math2 else tooth=tooth_math-tooth_math2 end
teeth_s=tooth-((tooth_size/2)*gear_math)
teeth_e=tooth+((tooth_size/2)*gear_math)
cairo_set_line_width(cr,gear_line_width)
cairo_arc(cr,(position_x),(position_y),outer_teeth_radius,teeth_s,teeth_e)
cairo_set_source_rgba(cr,gear_red,gear_green,gear_blue,(visibility))
cairo_stroke(cr)
end--for loop
--inner gear
cairo_set_line_width(cr,gear_line_width)
cairo_set_source_rgba(cr,gear_red,gear_green,gear_blue,(visibility))
cairo_arc(cr,(position_x),(position_y),inner_radius,gear_start,gear_end)
cairo_stroke(cr)
--inner gear teeth
for i=1,(inner_teeth) do
tooth_size=(360/(inner_teeth))/3
tooth_space=(360/(inner_teeth))
tooth_math=(((i-1)*tooth_space)+tooth_size)*gear_math
tooth_math2=(((360/(speed_scale))*(speed))*gear_math)
if (direction) == 1 then tooth=tooth_math+tooth_math2 else tooth=tooth_math-tooth_math2 end
teeth_s=tooth-((tooth_size/2)*gear_math)
teeth_e=tooth+((tooth_size/2)*gear_math)
cairo_set_line_width(cr,gear_line_width)
cairo_arc(cr,(position_x),(position_y),inner_teeth_radius,teeth_s,teeth_e)
cairo_set_source_rgba(cr,gear_red,gear_green,gear_blue,(visibility))
cairo_stroke(cr)
end--for loop
end
--######################################################################
-- mrpeacy code ########################################################
--######################################################################
function pt(px,py,prad,pdeg)
local ppo=(math.pi/180)*pdeg
local px1=px+prad*(math.sin(ppo))
local py1=py-prad*(math.cos(ppo))
return px1,py1
end
function font(fontt)
local name=fontt.f	or default_font_name	or "mono"
local size=fontt.fs	or default_font_size	or 12
local face=fontt.ff	or default_font_face	or "n"
if face=="n" then
cairo_select_font_face(cr,name,CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL)
elseif face=="b" then
cairo_select_font_face(cr,name,CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_BOLD)
elseif face=="i" then
cairo_select_font_face(cr,name,CAIRO_FONT_SLANT_ITALIC,CAIRO_FONT_WEIGHT_NORMAL)
elseif face=="bi" then
cairo_select_font_face(cr,name,CAIRO_FONT_SLANT_ITALIC,CAIRO_FONT_WEIGHT_BOLD)
end
cairo_set_font_size(cr,size)
end
function hexcolor(hexcolort)
local col=hexcolort.c	or default_hex_color	or 0xffffff
local a=hexcolort.a	or default_alpha	or 1
local r,g,b=((col/0x10000) % 0x100)/255,((col/0x100) % 0x100)/255,(col % 0x100)/255
cairo_set_source_rgba(cr,r,g,b,a)
end
function text(textt)
local x=textt.x 		or 100
local y=textt.y 		or 100
local t=textt.t 		or "set txt"
local hj=textt.hj 		or default_horizontal_justify		or "l"
local vj=textt.vj 		or default_vertical_justify		or "n"
local r=textt.r			or default_rotation			or 0
cairo_text_extents(cr,t,extents)
local wx=extents.x_advance
local wd=extents.width
local hy=extents.height
local bx=extents.x_bearing
local by=extents.y_bearing+hy
--hl-- l=left, c=center, r=right
if hj=="l" then
xa=x-bx
rad=0
elseif hj=="c" then
xa=x-((wx-bx)/2)-bx
rad=(wx-bx)/2
elseif hj=="r" then
xa=x-wx
rad=wx-bx
else
print ('hj not set correctly for text: '..t..' - "l", "c" or "r"')
xa=0
rad=0
end
--vj-- n=normal, nb=normal-ybearing, m=middle, mb=middle-ybearing, t=top
if vj=="n" then
ya=y
rad2=0
ry=by
elseif vj=="nb" then
ya=y-by
rad2=-by
ry=by
elseif vj=="m" then
ya=y+((hy-by)/2)
rad2=((hy-by)/2)
ry=((hy-by)/2)-by
elseif vj=="mb" then
ya=y+(hy/2)-by
rad2=(hy/2)-by
ry=((hy-by)/2)-by
elseif vj=="t" then
ya=y+hy-by
rad2=hy-by
ry=0+by
else
print ('vj not set correctly for text: '..t..' - "n", "nb", "m", "mb" or "t"')
ya=0
rad2=0
ry=0
end
--rotation
if r~=0 then
local x2,y2=pt(x,y,rad2,r-180)
local x1,y1=pt(x2,y2,rad,r-90)
cairo_save (cr)
cairo_translate (cr,x1,y1)
cairo_rotate(cr,(math.pi/180)*r)
cairo_show_text (cr,t)
cairo_stroke (cr)
cairo_restore (cr)
else
cairo_move_to (cr,xa,ya)
cairo_show_text (cr,t)
cairo_stroke (cr)
end--if ro
--set non local variables to nil
xa=nil;ya=nil;rad=nil;rad2=nil;ry=nil
end--function text #####################################################

You can find my work here

Make everything ok button

Offline

#4710 2013-02-01 22:42:42

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,428
Website

Re: The New Monster Conky Thread

OH MY!  Now that is really nice work ansem_of_nexus, very nice indeed!


#! Forum Moderator | To #! or not to #!?  That is the question!
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   BBQ Linux

Offline

#4711 2013-02-02 00:03:03

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: The New Monster Conky Thread

Sector11 wrote:

OH MY!  Now that is really nice work ansem_of_nexus, very nice indeed!

Thank you, mrpeachy and HTC were my starting inspiration. Mrpeachy's chronograph was very helpful, without the circle text function I don't know how I would have got the text to work in my clock.


You can find my work here

Make everything ok button

Offline

#4712 2013-02-02 00:19:50

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,428
Website

Re: The New Monster Conky Thread

^ HTC ??  mrpeachy I can see.  But HTC?


#! Forum Moderator | To #! or not to #!?  That is the question!
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   BBQ Linux

Offline

#4713 2013-02-02 00:23:47

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: The New Monster Conky Thread

Sector11 wrote:

^ HTC ??  mrpeachy I can see.  But HTC?

On my phone there is a clock that looks a lot like the first face. I modeled it after that clock, as a digital clock I like it a lot.


You can find my work here

Make everything ok button

Offline

#4714 2013-02-02 01:22:22

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,428
Website

Re: The New Monster Conky Thread

^ OH OK!  That explains that.  Not having an "everything but the kitchen sink" phone I would never have guessed.


#! Forum Moderator | To #! or not to #!?  That is the question!
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   BBQ Linux

Offline

#4715 2013-02-02 23:07:37

DrakarNoir
#! CrunchBanger
From: just beyond the sign post
Registered: 2011-09-02
Posts: 132
Website

Re: The New Monster Conky Thread

Greetings to all...

An anomaly popped up yesterday in my chrono.

The issue:

abbGsMlt.jpg and  adzGmv6M.jpg

As near as I can tell the problem resides in this portion of the clock.lua script (at approximately lines 277 - 281):

-- 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});
febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))

particularly this line (approximately line 281):

febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))

Theerefore, I submit the following change to this line which  (I believe hmm ) corrects the anomaly:

febdaynum=tonumber(((os.difftime(t1,t2))/(12*60*60)/2))

ablmsDem.jpg and  acpSNonq.jpg


"The nine most terrifying words in the English language are, 'I'm from the government and I'm here to help.'.”  ~Ronald Reagan

Offline

#4716 2013-02-02 23:56:42

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,428
Website

Re: The New Monster Conky Thread

@ DrakarNoir

Nice catch - wonderful fix!

Thank you!


#! Forum Moderator | To #! or not to #!?  That is the question!
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   BBQ Linux

Offline

#4717 2013-02-03 00:58:38

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,259

Re: The New Monster Conky Thread

Using a nice and concise HowTo by dkeg - found here - have made a colored conky for i3:

adzmM0bf.jpg

conkyrc:

out_to_x no
own_window no
out_to_console yes
background no
max_text_width 0
update_interval 2.0
total_run_times 0
short_units yes
cpu_avg_samples 4

TEXT
# JSON for i3bar
 
 [
 
        { "full_text" : "  ${time %a %e %b  %k:%M}  " , "color" : "\#E5E5EE" },
	
	{ "full_text" : "  Up: ${uptime_short}  " , "color" : "\#E5E5EE" },
 
        { "full_text" : "  CPU: ${cpu}%  " , "color" :
                ${if_match ${cpu}>10}"\#FF2828"${else}"\#E5E5EE"${endif} },
 		
        { "full_text" : "  CORE0: ${execpi 60 /home/doug/conky/TCore0.sh}°C  " , "color" :
                ${if_match ${execpi 60 /home/doug/conky/TCore0.sh}>=80}"\#FF2828"${else}${if_match ${execpi 60 /home/doug/conky/TCore0.sh}>=50}"\#FAFA10"${else}"\#E5E5EE"${endif}${endif} },	
 
        { "full_text" : "  CORE1: ${execpi 60 /home/doug/conky/TCore1.sh}°C  " , "color" :
                ${if_match ${execpi 60 /home/doug/conky/TCore1.sh}>=80}"\#FF2828"${else}${if_match ${execpi 60 /home/doug/conky/TCore1.sh}>=50}"\#FAFA10"${else}"\#E5E5EE"${endif}${endif} },

        { "full_text" : "  RAM  ${memperc}%  " , "color" :
                ${if_match ${memperc}>20}"\#FF2828"${else}"\#E5E5EE"${endif} } ,
 
        { "full_text" : "  BATT:${battery_percent BAT0}%  " , "color" :
                ${if_match ${battery_percent BAT0}<=15}"\#FF2828"${else}${if_match ${battery_percent BAT0}<=33}"\#FAFA10"${else}"\#E5E5EE"${endif}${endif} } ,
 
        { "full_text" : "  WLAN:${wireless_link_qual_perc wlan0}% " , "color" :
                ${if_match ${wireless_link_qual_perc wlan0}<50}"\#FF2828"${else}"\#E5E5EE"${endif} }

],

"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#4718 2013-02-03 11:02:03

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 456

Re: The New Monster Conky Thread

i've started to create a script to display a webcam only after sunet until sunrise. it should display the dark sky because the webcam shows a telescope.

if i want to run the script with the terminal i always get the error: segmentation fault

i do not know what's the reason for this? the script or my computer? can u please test it?

this is astro.lua

require 'imlib2'
--require 'cairo'

-- ###################################################################
-- ## drop leading character #########################################
-- ###################################################################

function dropChar(numbers)

local lc=nil
local lc=0

local fc=tonumber(string.sub(numbers,1,1))
local output=nil

if fc == lc then
output=string.sub(numbers,2,8)
else
output=string.sub(numbers,1,8)
end -- of if

return output

end -- of function

function convert24(tm,suf)
local tmlen=string.len(tm)
local colon=string.find(tm,":")
	if colon~=nil then
	tmhr=string.sub(tm,1,colon-1)
	tmmn=string.sub(tm,colon+1,tmlen)
	else
	tmhr=tm
	tmmn=""
	end
if suf=="PM" and tonumber(tmhr)~=12 then
tmhr=tmhr+12
elseif suf=="PM" and tonumber(tmhr)==12  then
tmhr=12
elseif suf=="AM" and tonumber(tmhr)<10 then
tmhr="0"..tmhr
elseif suf=="AM" and tonumber(tmhr)>=10 and tonumber(tmhr)~=12 then
tmhr=tmhr
elseif suf=="AM" and tonumber(tmhr)==12 then
tmhr="00"
end
if colon~=nil then
return tmhr..":"..tmmn
else
return tmhr
end--if colon~=nil
end--of function


function grab(wert,tz)

upd=tonumber(conky_parse("${updates}"))
intv=100
timer=(upd % intv)
if timer==0 or conky_start==1 then
used_table={}
local loc_code=tz
local adr="http://www.intellicast.com/Local/Forecast.aspx?location="..loc_code
local grab_file = io.popen("curl "..adr)
grab_out=grab_file:read("*a")
grab_file:close()

--[[
 grove greek observatory, new south wales
 location code: ASXX0001
 url: http://www.gco.org.au/sky.jpg
]]--

if wert=='sunrise' then
 s,f,grab_text=string.find(grab_out,"Rise:</strong> (%d*:%d*%s%u%u)</td>")
 --s,f,grab_text=string.find(grab_out,"<div style=\"float:right;color:#666;\">  As of ([%d%p%a%s]*) %(Local Time%)")
 local a,b,tm=string.find(grab_text,"([%d%p]*)") -- uhrzeit
 local a,b,suf=string.find(grab_text,"(%u%u)")  -- endung
 grab_text=convert24(tm,suf)
elseif wert=='sunset' then
 s,f,grab_text=string.find(grab_out,"Set:</strong> (%d*:%d*%s%u%u)</td>")
 local a,b,tm=string.find(grab_text,"([%d%p]*)") -- uhrzeit
 local a,b,suf=string.find(grab_text,"(%u%u)") -- endung
 grab_text=convert24(tm,suf)
end

conky_start=nil

--print (grab_text)
return grab_text
end

end



--grab('sunrise',"ASXX0001")


--##################################################################
--###### Tag-/ Nachtmodus (day-/night mode) ########################
--################################################################## 

function dnimg()

-- time of the sunrise
local result_1=grab('sunrise',"ASXX0001")
local hour_1=string.sub(result_1,1,2)
local calc_1=tonumber(hour_1)*60
local min_1=string.sub(result_1,4,5)
local total_1=tonumber(min_1)+calc_1

-- time of the sunset
local result_2=grab('sunset',"ASXX0001")
local hour_2=string.sub(result_2,1,2)
local calc_2=tonumber(hour_2)*60
local min_2=string.sub(result_2,4,5)
local total_2=tonumber(min_2)+calc_2

-- actual time
local tz='+09.30'
local vorzeichen=string.sub(tz,1,1)
local tz_hour=string.sub(tz,2,3)
local tz_min=string.sub(tz,5,6)
print('minuten: '..tz_min)

local act_hour=(tonumber(os.date("%H"))*60)+tonumber(tz_hour)
local act_min=(tonumber(os.date("%M")))+tonumber(tz_min)
local act_time=act_hour+act_min

if act_time<total_1 and act_time>total_2 then
-- Funktion für den Tag

print("tags")

else
-- Funktion für die Nacht
--print("webcam")
extern_img({posx=0,posy=0,imgw=200,imgh=200,imgurl="http://www.gco.org.au/sky.jpg",imghdd="opensky.jpg",imgiv=60})

end -- end of the if-section

--return dntz

end -- end of function

-- ##################################################################################
-- ## display local images from hdd #################################################
-- ##################################################################################
function image(im)
x=nil
x=(im.x or 0)
y=nil
y=(im.y or 0)
w=nil
w=(im.w or default_image_width)
h=nil
h=(im.h or default_image_height)
file=nil
file=tostring(im.file)
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--function image #############################################################

-- ###############################################################################
-- ## display external images ####################################################
-- ###############################################################################
function extern_img(wb)
-- define variables
img_x=(wb.posx or 0)
img_y=(wb.posy or 0)
img_w=(wb.imgw or 200)
img_h=(wb.imgh or 200)
s=wb.imgurl -- url of the webcam
img_nw=(wb.imghdd or "external_img.jpg")
img_file="/home/alexander/"..img_nw
img_intervall=(wb.imgiv or 60)
-- grab external image from url and save it to hdd
local updates = tonumber(conky_parse('${updates}'))
if (math.mod(updates, img_intervall) == 0) then
os.execute("wget  -q -O "..img_file..' "'..s..'"')
end
-- load and display image from harddisk
if img_file==nil then print("set image file") end
image({x=img_x,y=img_y,w=img_w,h=img_h,file=img_file})
end--function to display external images ##############################################
-- ####################################################################################

dnimg()

and this is the conky-config file:

# — Conky settings — #
background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 1440
imlib_cache_size 0

# — Window specifications — #

own_window yes
own_window_type normal
own_window_transparent no
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 220 150
maximum_width 400

alignment bl
gap_x 10
gap_y 130

# — Graphics settings — #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# — Text settings — #
use_xft yes
#xftfont PF Tempesta Seven:size=8
xftalpha 0.7
xftfont mono:size=8

uppercase no

default_color d2c8c8

#lua_load ~/v9000/v9000.lua
#lua_draw_hook_pre weather
#lua_load ~/v9000/weather_testing.lua

lua_load ~/v9000/astro.lua
#lua_draw_hook_pre draw_shape

TEXT

please help. i need to know the reason.

Offline

#4719 2013-02-03 13:47:22

DrakarNoir
#! CrunchBanger
From: just beyond the sign post
Registered: 2011-09-02
Posts: 132
Website

Re: The New Monster Conky Thread

Sector11 wrote:

@ DrakarNoir

Nice catch - wonderful fix!

Thank you!

You're welcome


"The nine most terrifying words in the English language are, 'I'm from the government and I'm here to help.'.”  ~Ronald Reagan

Offline

#4720 2013-02-03 16:57:39

McLovin
#! CrunchBanger
From: my computer chair
Registered: 2009-02-28
Posts: 101
Website

Re: The New Monster Conky Thread

Sector11 wrote:
observingly wrote:

how can i download conkyforecast?

Right here: conkyforecast_2.24_all.deb, this is what I use.

Or if you prefer from the Conky Companions PPA that has all of Mark's python script for Conky

I use the PPA, but u have to be careful what one you use, if your using Waldorf (Debian Testing) I would use the precise one, if you're using Statler (Debian Stable) I would use the lucid repo, but thats just me.


monkey Got /? | My Blog, nothing special monkey
The first GUI, and "on-line" system was created in 1968 by Douglas Engelbart, the system included modern day innovations such as video conferencing, and on-line file sharing.

Offline

#4721 2013-02-03 17:21:46

xtro
Member
Registered: 2012-11-18
Posts: 22

Re: The New Monster Conky Thread

Looking for help here, I I'm looking for something that will either a) keep the meters from getting cut off b)keep the current size of the box and Most importantly c) make it less ugly. any suggestions even if the dont pertain to the meters or size are extremely welcome. keep in mind, im not the best coder, so if you have an idea, the coding would be a grateful addition to your post.

# Locale, fonts and font sizes.
use_xft yes
xftfont Liberation Sans:size=9
override_utf8_locale yes

# Conky performance
update_interval 1
total_run_times 0
double_buffer yes
no_buffers no
net_avg_samples 2
text_buffer_size 1024

# Execute it in its own window
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Borders, margins.
draw_borders no
border_margin 1

# Own window color
own_window_colour 393834

# Font colors
default_color ffffff
default_outline_color 000000
#default_color EFEEED



# Text shadows
draw_shades no

# Header colors
color0 DD3A21

# Minimum dimensions
minimum_width 2000
minimum_height 2000

# Conky positioning.
alignment top_middle
gap_x 0
gap_y 0

# Output
TEXT
${voffset 10}${goto 15}${font Xerox Sans Serif Wide:style=Bold:size=20}S Y S${goto 300}${font Xerox Sans Serif Wide:style=Bold:size=20}D S K
#
${voffset -10}${font}
${goto 20}${sysname}-${kernel}-${nodename}${goto 255}Root ${goto 300}${fs_bar 10,90 /} ${fs_free /}
                     ${goto 255}Home ${goto 320}${fs_bar 10,90 /home} ${fs_free /home}
${goto 20}Core 1 ${goto 60}${cpubar cpu1 10,90}  ${cpu cpu1}% 
${goto 20}Core 2 ${goto 60}${cpubar cpu2 10,90}  ${cpu cpu2}% ${goto 255}READ ${goto 300}${diskiograph_read 10,90} ${diskio_read}
${goto 20}RAM${goto 60}${membar 10,90 00FF00}  ${memperc}%
${goto 20}SWAP${goto 60}${swapbar 10,90}  $swapperc% ${goto 255}UPTIME ${uptime}

#
${voffset 55}${goto 15}${font Xerox Sans Serif Wide:style=Bold:size=20}C O M ${goto 250}${font Xerox Sans Serif Wide:style=Bold:size=20}S F T
${voffset -10}${font}
${goto 20}${wireless_essid wlan0} ${goto 255}LOAD ${goto 300}${loadavg}
${goto 20}DOWN${goto 60}${downspeedgraph wlan0 10,90 B7B2AD B7B2AD} ${downspeed wlan0} ${goto 255}NAME ${goto 360} CPU   MEM
${goto 20}UP${goto 60}${upspeedgraph wlan0 10,90 B7B2AD B7B2AD} ${upspeed wlan0} ${goto 255}${top name 1} ${goto 360}${top cpu 1} ${top mem 1}
${goto 20}Downloaded ${goto 95}${totaldown wlan0} ${goto 255}${top name 2} ${goto 360}${top cpu 2} ${top mem 2}
${goto 20}Uploaded   ${goto 100}${totalup wlan0} ${goto 255}${top name 3} ${goto 360}${top cpu 3} ${top mem 3}
${goto 20}Power ${goto 70}${wireless_link_bar 10,60 wlan0}  ${wireless_link_qual wlan0}% ${goto 255}${top name 5} ${goto 360}${top cpu 5} ${top mem 5}
#${goto 20}Internet${goto 70}on

I warned you. It's Ugly

Last edited by xtro (2013-02-03 17:22:21)

Offline

#4722 2013-02-03 17:29:32

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,428
Website

Re: The New Monster Conky Thread

McLovin wrote:
Sector11 wrote:
observingly wrote:

how can i download conkyforecast?

Right here: conkyforecast_2.24_all.deb, this is what I use.

Or if you prefer from the Conky Companions PPA that has all of Mark's python script for Conky

I use the PPA, but u have to be careful what one you use, if your using Waldorf (Debian Testing) I would use the precise one, if you're using Statler (Debian Stable) I would use the lucid repo, but thats just me.

Actually that's not necessary.  I beta tested for Mark. Mark only built his python scripts for Hardy

I only use the Hardy version of all of Mark's scripts and I'm on SID. The only ones I haven't beta tested ate the Google scripts and a couple of music ones.

In fact I don't even use the PPA, I have "all" the files here:

IE:

  • /media/disk/Mark/conkyforecast_2.24.dsc

  • /media/disk/Mark/conkyforecast_2.24.tar.gz

  • /media/disk/Mark/conkyforecast_2.24_all.deb

I used these when conky had to call them thus:

${execpi 900 /path/to/conkyForecast.py --location=ARDF0127 ----datatype=HT --hideunits --startday=1}

that was before templates.

Check the next post I'm going to put up after this.

========================
Saying that I will say your advice has a lot of merit.

Using the Ubuntu PPA on a Debian system is like playing with fire while carrying dynamite.

Last edited by Sector11 (2013-02-03 17:37:09)


#! Forum Moderator | To #! or not to #!?  That is the question!
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   BBQ Linux

Offline

#4723 2013-02-03 17:35:33

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,428
Website

Re: The New Monster Conky Thread

Remember when text conkys with lines ( | - _ ) and + were popular.

Well while doing some house cleaning in /media/5/conky I came across a couple.  One was HUGE and I just broke it up into two as it wasn't finished and looked HORRIBLE!

However, once I took the conkyForecast section out of it and popped it into it's own conky .... well you be the judge ...

And ######## * said conkyForecast was dead.  YEA RIGHT! ... gimme a break!

abib1TPK.jpg

Everything to the left of the weather is one conky ... and not a single ${voffset} in the box.

Now another one I found was 'basically' what you see on the extreme left.  I did some quick editing and changed the font to my favourite mono font today: monofur.

I changed the | _ - and + for the ASCII stuff:

╔ ═ ╦ ═ ╗   ┌ ─ ┬ ─ ┐

║   ║   ║   │   │   │

╠ ═ ╬ ═ ╣   ├ ─ ┼ ─ ┤ 

║   ║   ║   │   │   │

╚ ═ ╩ ═ ╝   └ ─ ┴ ─ ┘

╔═╦═╗   ┌─┬─┐
║ ║ ║   │ │ │
╠═╬═╣   ├─┼─┤ 
║ ║ ║   │ │ │
╚═╩═╝   └─┴─┘

and I'm really impressed with how monofur used those:  glasses

adsgGSmx.jpg
An old style with a new look!

*  name withheld to protect the guilty   devil


#! Forum Moderator | To #! or not to #!?  That is the question!
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   BBQ Linux

Offline

#4724 2013-02-03 17:48:06

McLovin
#! CrunchBanger
From: my computer chair
Registered: 2009-02-28
Posts: 101
Website

Re: The New Monster Conky Thread

das kinda perty right dere


monkey Got /? | My Blog, nothing special monkey
The first GUI, and "on-line" system was created in 1968 by Douglas Engelbart, the system included modern day innovations such as video conferencing, and on-line file sharing.

Offline

Help fund CrunchBang, donate to the project!

#4725 2013-02-03 19:29:27

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,428
Website

Re: The New Monster Conky Thread

xtro wrote:

Looking for help here, I I'm looking for something that will either a) keep the meters from getting cut off b)keep the current size of the box and Most importantly c) make it less ugly. any suggestions even if the dont pertain to the meters or size are extremely welcome. keep in mind, im not the best coder, so if you have an idea, the coding would be a grateful addition to your post.

That's not ugly ... I'll help ... but it will cost you:

A link to that wallpaper, please.  big_smile

OK, now to look at conky code.

Do you want that boxed shadow look?


#! Forum Moderator | To #! or not to #!?  That is the question!
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OHCG'er
StartPage -  protect your privacy   |   BBQ Linux

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo