SEARCH

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

You are not logged in.

#1 2011-08-31 23:41:18

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

September 2011 Conky Thread

The monthly conky thread purpose:

  • seek help with conky, and

  • show your conky and config files

-----------------------------------------------------------
And in accordance with the screenshot thread:

Please continue to use thumbnails (please try to avoid the large thumbnail imgur.com code) linking to the larger image to help those of us with slow connections. An example of the code needed is below. Most image hosting sites will automatically generate this for you as well. I've been using postimage.org lately which does a nice job.

[url=http://link.to.your.fullsized.image][img]http://link.to.your.thumbnail.image[/img][/url]

#! 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

Be excellent to each other!

#2 2011-09-01 01:06:01

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

Re: September 2011 Conky Thread

@Sector 11 - need to make this thread sticky big_smile

Simple one-liner using a jpg for background image:

background yes
use_xft yes
#xftfont Sans:pixelsize=10.5
xftfont Droid Sans Fallback:semibold:pixelsize=10
xftalpha 1.0
update_interval 1
total_run_times 0

### Window
own_window yes
own_window_colour 1f1f1f
# own_window_type normal
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window_hints undecorated,sticky,skip_taskbar,skip_pager
###

double_buffer yes
minimum_size 1600 2
maximum_width 1600
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
border_width 1
border_inner_margin 0
border_outer_margin 0

# Default colors and also border colors
default_color e5e5e5
#default_color e7e7ee
#default_color 020200
default_shade_color white
default_outline_color black
#color7 001DFF
color7 0ECB0E
color8 ffff00
color9 f40e0e

#alignment top_left
alignment top_middle
gap_x 0
gap_y 0

max_specials 1024
max_user_text 2048
text_buffer_size 2048
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer right
short_units yes
pad_percents 1
imlib_cache_size 0

#${image ~/conky/bar.xpm -p 0,0 -s 1600x16}
#lua_load ~/conky/conky_luabg.lua
#lua_draw_hook_pre draw_bg

TEXT
${image ~/conky/tb-center.png -p 0,0 -s 1600x16}${goto 40}Uptime:${offset 5}$uptime_short${offset 24}*${offset 24}MB:${offset 5}${if_match ${hwmon 2 temp 1}<=50}${color7}${else}${if_match ${hwmon 2 temp 1}<=70}${color8}${else}${if_match ${hwmon 2 temp 1}>70}${color9}${endif}${endif}${endif}${hwmon 2 temp 1} °C${color}${offset 24}*${offset 24}Sda:${offset 5}${if_match ${hddtemp /dev/sda}<=50}${color7}${else}${if_match ${hddtemp /dev/sda}<=70}${color8}${else}${if_match ${hddtemp /dev/sda}>70}${color9}${endif}${endif}${endif}${hddtemp /dev/sda} °C${color}${offset 24}*${offset 24}Sdb:${offset 5}${if_match ${hddtemp /dev/sdb}<=50}${color7}${else}${if_match ${hddtemp /dev/sdb}<=70}${color8}${else}${if_match ${hddtemp /dev/sdb}>70}${color9}${endif}${endif}${endif}${hddtemp /dev/sdb} °C${color}${offset 24}*${offset 24}Sdc:${offset 5}${if_match ${hddtemp /dev/sdc}<=50}${color7}${else}${if_match ${hddtemp /dev/sdc}<=70}${color8}${else}${if_match ${hddtemp /dev/sdc}>70}${color9}${endif}${endif}${endif}${hddtemp /dev/sdc} °C${color}${offset 24}*${offset 24}CPU:${offset 5}${if_match ${hwmon 1 temp 1}<=50}${color7}${else}${if_match ${hwmon 1 temp 1}<=70}${color8}${else}${if_match ${hwmon 1 temp 1}>70}${color9}${endif}${endif}${endif}${hwmon 1 temp 1} °C${color}${offset 24}*${offset 24}CPU:${offset 5}${if_match ${cpu}<=50}${color7}${else}${if_match ${cpu}<=70}${color8}${else}${if_match ${cpu}>70}${color9}${endif}${endif}${endif}${cpu cpu1}%${color}${offset 24}*${offset 24}Mem:${offset 5}${if_match ${memperc}<=50}${color7}${else}${if_match ${memperc}<=70}${color8}${else}${if_match ${memperc}>70}${color9}${endif}${endif}${endif}$memperc%${color}${offset 24}*${offset 24}Eth0:${offset 5}Down:${offset 5}${downspeedf eth0} kb/s${offset 24}*${offset 24}Up:${offset 5}${upspeedf eth0} kb/s${offset 24}*${offset 24}Download:${offset 5}${totaldown eth0}${offset 24}*${offset 24}Upload:${offset 5}${totalup eth0}

tYTU2ZA


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

Offline

#3 2011-09-01 01:50:57

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

Re: September 2011 Conky Thread

PackRat wrote:

@Sector 11 - need to make this thread sticky big_smile

Simple one-liner using a jpg for background image:

tYTU2ZA


NICE!!!

I can't, I've asked a mod to do so.  Probably happen later today.


#! 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

#4 2011-09-01 02:09:04

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

Re: September 2011 Conky Thread

Sector11 wrote:
PackRat wrote:

@Sector 11 - need to make this thread sticky big_smile

Simple one-liner using a jpg for background image:

tYTU2ZA


NICE!!!

I can't, I've asked a mod to do so.  Probably happen later today.

Darn, I'm to slow!  I wanted to be the first to post on the new thread. sad

Offline

#5 2011-09-01 07:06:08

dlm955
#! CrunchBanger
From: Mansfield,Ohio USA
Registered: 2011-07-23
Posts: 128

Re: September 2011 Conky Thread

Sector11 sorry I missed the question about what conky version I am using last month
for the code that changes icons when you change network connection eth0/wlan
the version is Conky 1.8.0 compiled Fri Apr 23 10:38:37 UTC 2010


Give a man a truth and he will think for a day.
Teach a man to reason and he will think for a lifetime!

Offline

#6 2011-09-02 02:34:14

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

Re: September 2011 Conky Thread

dlm955 wrote:

Sector11 sorry I missed the question about what conky version I am using last month
for the code that changes icons when you change network connection eth0/wlan
the version is Conky 1.8.0 compiled Fri Apr 23 10:38:37 UTC 2010

I'll have to go look for that.  Memory is on vacation I think.  big_smile


#! 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

#7 2011-09-02 02:39:53

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

Re: September 2011 Conky Thread

In following PackRat - another nice simple little one line conky with a calendar by mobilediesel.

thmb_cal-1_liner.png

today:

background no
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints skip_taskbar,skip_pager
own_window_title CBL-Today
own_window_class CBL-Today

double_buffer yes
use_spacer right
override_utf8_locale yes
use_xft yes
xftfont monospace:bold:size=8
xftalpha 1.0
update_interval 1
uppercase no
stippled_borders 0
border_inner_margin 0
border_width 0
default_outline_color black
default_shade_color black
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no

# Colors
default_color DCDCDC #Gainsboro
color0 7FFF00 #Chartreuse
color1 FFA07A #LightSalmon
color2 FF8C00 #Darkorange
color3 778899 #LightSlateGrey
color4 FFD700 #Gold
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red

text_buffer_size 1028
no_buffers yes
short_units yes
pad_percents 2

alignment bl
gap_x 50
gap_y 5

minimum_size 180 0
maximum_width 180
override_utf8_locale yes 

TEXT
${goto 60}${font LCDMono:bold:size=18}${color3}${time %a}${color}
${voffset -0}${execpi 3600 ~/Conky/scripts/week.sh}
${voffset 10}${goto 30}${font LCDMono:bold:size=18}${color3}${time %b %Y}${color}${font}

week.sh

#!/bin/bash
# by mobilediesel

font=("\${font monospace:size=5}" "\${voffset -4}\${font monospace:size=10}" "\${voffset -5}\${font monospace:size=16}" "\${voffset -8}\${font monospace:size=25}\${color 7095BB}" "\${voffset -3}\${font monospace:size=16}" "\${voffset -2}\${font monospace:size=10}" "\${voffset -2}\${font monospace:size=5}")
color=("" "" "" "\${color}" "" "" "")

for i in $(seq -3 3); do
echo -n "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${offset 3}"
done

one_line:

background no
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

double_buffer yes
use_spacer right
override_utf8_locale yes
use_xft yes
xftfont DejaVu Sans Mono:bold:size=8
xftalpha 1.0 
update_interval 1
uppercase no
stippled_borders 0
border_inner_margin 0
border_width 0
default_outline_color black
default_shade_color black
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no

# Colors
default_color DCDCDC #Gainsboro
color0 7FFF00 #Chartreuse
color1 FFA07A #LightSalmon
color2 FF8C00 #Darkorange
color3 778899 #LightSlateGrey
color4 FFD700 #Gold
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red

text_buffer_size 1028
no_buffers yes
short_units yes
pad_percents 2
alignment bm  # Aligned position on screen: tl, tr, tm, bl, br, bm, ml, mr
gap_x 00
gap_y 30

minimum_size 750 0
maximum_width 750

TEXT
${color3}CPU: ${color4}${cpu cpu0}${goto 50}${color3}% RAM: ${color4}${memperc} ${color3}${goto 110}% Disk: ${color4}${fs_used_perc /}${goto 176}${color3}% ${color5}Temps: ${color3}CPU: ${execpi 8 sensors | grep 'Core0' | cut --characters 15-16 | xargs ~/Conky/scripts/ColorTempCore.sh}°${goto 290}${color3}GPU: ${execpi 8 sh -c "DISPLAY=:0.0 nvclock -T | grep GPU | cut -c21-22" | xargs ~/Conky/scripts/ColorTempGPU.sh}°${goto 350}${color3}SDA: ${execpi 8 hddtemp /dev/sda | cut --characters 34-37 | xargs ~/Conky/scripts/ColorTempHDD.sh}${goto 410}${color3}eth0: ${color4}${addr eth0} ${color3}Email: ${color}${execi 120 conkyEmail --servername=xxxxxxxxxxxx --servertype=POP --ssl --port=995 --username=xxxxxx --password=xxxxxx}·${execi 120 conkyEmail --servername=xxxxxxxxxxxx --servertype=POP --ssl --port=995 --username=xxxxxx --password=xxxxxx}·${execi 120 conkyEmail --servername=xxxxxxxxxxxx --servertype=POP --ssl --port=995 --username=xxxxxx --password=xxxxxx} ${color3}UP${color6}/${color1}DN: ${color3}${upspeed eth0}${color6}/${color1}${downspeed eth0}${color}

ColorTempCore.sh

#!/bin/bash
# colorize.sh
# by: Crinos512

COOL=55
WARM=70

if [[ $1 < $COOL ]]
   then echo "\${color7}"$1    # COOL
elif [[ $1 > $WARM ]]
   then echo "\${color9}"$1    # HOT
else echo "\${color8}"$1       # WARM
fi

exit 0

ColorTempGPU.sh

#!/bin/bash
# colorize.sh
# by: Crinos512

COOL=65
WARM=80

if [[ $1 < $COOL ]]
   then echo "\${color7}"$1    # COOL
elif [[ $1 > $WARM ]]
   then echo "\${color9}"$1    # HOT
else echo "\${color8}"$1       # WARM
fi

exit 0

ColorTempHDD.sh

#!/bin/bash
# colorize.sh
# by: Crinos512

COOL=45
WARM=56

if [[ $1 < $COOL ]]
   then echo "\${color7}"$1    # COOL
elif [[ $1 > $WARM ]]
   then echo "\${color9}"$1    # HOT
else echo "\${color8}"$1       # WARM
fi

exit 0

Last edited by Sector11 (2011-09-02 02:43:05)


#! 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

#8 2011-09-02 03:10:23

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

Re: September 2011 Conky Thread

@sector11

Excellent calendar.

And, for general consumption, a modification of the Crinos512 colorizing script you're using. The main difference is that when the cpu, hdd, etc .. gets into the hot zone, gdialog will put a message box on the desktop as a warning. I believe an Ubuntu user named Easybake came up with that modification. I used it on my laptop for temps and battery usage.

colorize.sh -

#!/bin/sh
# colorize.sh
# by Crinos512
# Usage:
#  ${execpi 6 sensors | grep Core0 | paste -s | cut -c15-18 | xargs ~/.conky/colorize.sh} ... $color
#
# Note: Assign color7, color8, and color9 to COOL, WARM, and HOT respectively
#   your .conkyrc

# COOL = less than equal to 60
# WARM = 61 - 80
# HOT  = greater than 80

case $1 in
  [0-4][0-9] | 5[0-9] | 60) 
    echo "\${color7}"$1 ;;   # COOL 
  60[1-9] | 7[0-9] | 80)         
    echo "\${color8}"$1 ;;   # WARM
  8[1-9] | 9[0-9] | 1[0-9][0-9]) 
    echo "\${color9}"$1; exec gdialog --infobox "Check temperatures" 200 100;;   # HOT
esac

exit 0

Last edited by PackRat (2011-09-02 03:11:39)


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

Offline

#9 2011-09-02 03:48:45

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

Re: September 2011 Conky Thread

PackRat wrote:

@sector11

Excellent calendar.

And, for general consumption, a modification of the Crinos512 colorizing script you're using. The main difference is that when the cpu, hdd, etc .. gets into the hot zone, gdialog will put a message box on the desktop as a warning. I believe an Ubuntu user named Easybake came up with that modification. I used it on my laptop for temps and battery usage.

colorize.sh -

#!/bin/sh
# colorize.sh
# by Crinos512
# Usage:
#  ${execpi 6 sensors | grep Core0 | paste -s | cut -c15-18 | xargs ~/.conky/colorize.sh} ... $color
#
# Note: Assign color7, color8, and color9 to COOL, WARM, and HOT respectively
#   your .conkyrc

# COOL = less than equal to 60
# WARM = 61 - 80
# HOT  = greater than 80

case $1 in
  [0-4][0-9] | 5[0-9] | 60) 
    echo "\${color7}"$1 ;;   # COOL 
  60[1-9] | 7[0-9] | 80)         
    echo "\${color8}"$1 ;;   # WARM
  8[1-9] | 9[0-9] | 1[0-9][0-9]) 
    echo "\${color9}"$1; exec gdialog --infobox "Check temperatures" 200 100;;   # HOT
esac

exit 0

OH, now that's handy! Thanks for sharing!!!
Now that's GOOD!  I've heard of EasyBake, I'll check that out see if it was him.  big_smile

thmb_gdialog.png


#! 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

#10 2011-09-02 10:49:06

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

Re: September 2011 Conky Thread

Sector11 wrote:

In following PackRat - another nice simple little one line conky with a calendar by mobilediesel.

thmb_cal-1_liner.png

That's neat, I especially like the calendar part.   smile

Offline

#11 2011-09-02 14:04:15

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

Re: September 2011 Conky Thread

ackernan wrote:

That's neat, I especially like the calendar part.   smile

Yea that it is, mobilediesel does some nice work.
Obviously not mine, what I know about bash scripts you could put on a pixel.

Last edited by Sector11 (2011-09-02 14:04:28)


#! 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

#12 2011-09-02 15:25:45

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

Re: September 2011 Conky Thread

I am having difficulty figuring how to center the Day and Month/Date (and perhaps the time) in this clock conky. Please any help is appreciated.

Screen Shot:
http://postimage.org/image/2joedo7s4/

My rc:

# Use Xft?
use_xft yes
xftfont Droid Sans:size=8
xftalpha 1
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# 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_transparent no
# Uncomment following line for Gnome/KDE, comment for LXDE/XFCE
own_window_argb_visual yes
# own_window_argb_value 255
own_window_type normal
own_window_class conky-semi
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 185 185
maximum_width 185

# Draw shades?
draw_shades no
default_color D6D6D6 #4D4D4D
# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
# border_margin 5

# border width
border_width 1

# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
#alignment bottom_left
alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 160
gap_y 40

# -- Lua Load -- #
# lua_load ~/.draw_bg.lua
# lua_draw_hook_pre draw_bg

# -- Size of Progress Bars (L W) -- #
default_bar_size 125 12

default_color 6ED6FF
color1 5EC6EF
color2 AAAAAA
color3 888888
color4 666666

lua_load ~/.conky/conky_grey.lua
lua_draw_hook_post main

TEXT
${voffset 48}${alignc 10}${font Droid Sans:size=11}$color1${time %A}
${goto 39}${font Droid Sans:style=bold:size=35}${time %l:%M}
${voffset -35}${alignc 10}${font Droid Sans:size=11}${color1}${time %B %e}

and the lua:

--==============================================================================
--                                 conky_grey.lua
--
--  author  : SLK
--  version : v2011062101
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    clock DATA
-- HOURS
clock_h = {
    {
    name='time',                   arg='%l',                    max_value=12,
    x=97,                          y=100,
    graph_radius=85,
    graph_thickness=10,
    graph_unit_angle=30,           graph_unit_thickness=30,
    graph_bg_colour=0x6ED6FF,      graph_bg_alpha=0.1,
    graph_fg_colour=0x6ED6FF,      graph_fg_alpha=0.7,
    txt_radius=87,
    txt_weight=1,                  txt_size=11.0,
    txt_fg_colour=0xFFFF00,        txt_fg_alpha=0.9,
    graduation_radius=85,
    graduation_thickness=10,       graduation_mark_thickness=1,
    graduation_unit_angle=30,
    graduation_fg_colour=0xffffff, graduation_fg_alpha=0.1,
    },
}
-- MINUTES
clock_m = {
    {
    name='time',                   arg='%M',                    max_value=60,
    x=97,                         y=100,
    graph_radius=75,
    graph_thickness=3,
    graph_unit_angle=6,            graph_unit_thickness=6,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xff976e,      graph_fg_alpha=0.7,
    txt_radius=66,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0xff976e,        txt_fg_alpha=0.9,
    graduation_radius=73,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- SECONDS
clock_s = {
    {
    name='time',                   arg='%S',                    max_value=60,
    x=97,                         y=100,
    graph_radius=60,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=2,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.0,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.2,
    txt_radius=57,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.3,
    graduation_radius=0,
    graduation_thickness=0,        graduation_mark_thickness=0,
    graduation_unit_angle=0,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0,
    },
}

--------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--                                                                 rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

-------------------------------------------------------------------------------
--                                                            angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
    local pos = current_angle + start_angle
    return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end

-------------------------------------------------------------------------------
--                                                              draw_clock_ring
-- displays clock
--
function draw_clock_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']

    -- background ring
    cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)

    -- arc of value
    local val = (value % max_value)
    local i = 1
    while i <= val do
        cairo_arc(display, x, y, graph_radius,(  ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360)  )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
        cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = (graph_unit_angle * i) - graph_unit_thickness

    -- graduations marks
    local graduation_radius = data['graduation_radius']
    local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
    local graduation_unit_angle = data['graduation_unit_angle']
    local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
    if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
        local nb_graduation = 360 / graduation_unit_angle
        local i = 1
        while i <= nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
            cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
            cairo_stroke(display)
            cairo_set_line_width(display, graph_thickness)
            i = i + 1
        end
    end

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2)))
    local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
    cairo_set_font_size (display, txt_size);
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3);
    cairo_show_text (display, value);
    cairo_stroke (display);
end

-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--                                                               go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
    local function load_clock_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_clock_ring(display, data, value)
    end
    
    for i in pairs(clock_h) do
        load_clock_rings(display, clock_h[i])
    end
    for i in pairs(clock_m) do
        load_clock_rings(display, clock_m[i])
    end
    for i in pairs(clock_s) do
        load_clock_rings(display, clock_s[i])
    end
end

-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--                                                                         MAIN
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)
    local display = cairo_create(cs)
    
    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)
    
    if update_num > 5 then
        go_clock_rings(display)
    end
    
    cairo_surface_destroy(cs)
    cairo_destroy(display)
end

Last edited by DrakarNoir (2011-09-02 15:26:48)


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

Offline

#13 2011-09-02 15:29:15

thevdude
#! Junkie
From: Pittsburgh, PA
Registered: 2011-09-01
Posts: 469

Re: September 2011 Conky Thread

Grabbed this conky from xeNull, but I'm having an issue. Learned MoC just to use the music player part, but it's not centering properly. D: GAH.

# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
#  Settings
##############################################
#==============================================================================
#  MinHXR
#
#  Date    : 11/08/2011
#  author  : xeNULL
#  version : v0.1
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#==============================================================================

background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius
short_units yes

double_buffer yes
no_buffers yes
text_buffer_size 2048

gap_x 0
gap_y 10

minimum_size 500 35
maximum_width 800
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tm

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes

default_bar_size 115 30

override_utf8_locale no
use_xft yes
xftfont Terminus:size=7
xftalpha 1.0
uppercase no

default_color FFFFFF ## white
color1 999999 ## Medium Grey
color2 510000 ## Dark Red


TEXT
${color2}${font Humanoid:size=9}o${font}${color} cpu 1 ${goto 50}${cpubar cpu0 5,80}  ${color2}${font Humanoid:size=9}o${font}${color}  disk ${goto 200}${fs_bar 5,80 /}  ${color2}${font Humanoid:size=9}o${font}${color}  ip ${goto 350}${addr wlan0}  ${offset 7}${color2}${font Humanoid:size=9}o${font}${color}
${color2}${font Humanoid:size=9}o${font}${color} cpu 2 ${goto 50}${cpubar cpu1 5,80}  ${color2}${font Humanoid:size=9}o${font}${color}  home ${goto 200}${fs_bar 5,80 /home/xn}  ${color2}${font Humanoid:size=9}o${font}${color}  up ${goto 350}${upspeedgraph wlan0 5,80}  ${color2}${font Humanoid:size=9}o${font}${color}
${color2}${font Humanoid:size=9}o${font}${color} mem ${goto 50}${membar 5,80}  ${color2}${font Humanoid:size=9}o${font}${color}  ehd  ${goto 200}${fs_bar 5,80 /media/XEHD}  ${color2}${font Humanoid:size=9}o${font}${color}  down ${goto 350}${upspeedgraph wlan0 5,80}  ${color2}${font Humanoid:size=9}o${font}${color}
${color2}${font Humanoid:size=9}o${font}${color} vol ${goto 50}${mixerbar 'PCM' 5,80}  ${color2}${font Humanoid:size=9}o${font}${color}  r/w  ${goto 200}${diskiograph 5,80}  ${color2}${font Humanoid:size=9}o${font}${color}  qual ${goto 350}${wireless_link_bar 5,80 wlan0}  ${color2}${font Humanoid:size=9}o${font}${color}

${if_running mocp}${alignc}${font sans:size=8}${exec mocp -Q %song}  ${color2}${font Humanoid:size=9}o${font}${color} ${exec mocp -Q %artist} ${color2}${font Humanoid:size=9}o${font}${color} ${exec mocp -Q %album}${font}${else}${endif}

JU2ubl.jpg

It doesn't cut off anymore, I changed the width. Maybe I'll find what I need looking through it more. I just want the music line to actually be centered.

EDIT: So apparently, the music part is centered fine. I have to ${alignc} everything else, I guess. Is there any way to do that to a large part of it at once? D: Ugh, the goto moves it by pixels, doesn't it? This is weird.

Last edited by thevdude (2011-09-02 15:35:48)

Offline

#14 2011-09-02 20:25:33

nolla
Member
Registered: 2010-08-26
Posts: 13

Re: September 2011 Conky Thread

I've been working on this for a day or two. Still not happy with the overall composition.

boxcutter_wp_with_conky_by_nolla-d48n4wv.png

The code isn't too tricky, of course. Plus, it is ripped and tweaked. I'm not much of a hacker.

${font Know Your Product:size=30}${time %H}${font Know Your Product:size=20}${time %M}${font}
${voffset 10}${font Know Your Product:size=20}${time %d}${font Know Your Product:size=50}${voffset -15}${time %b}
${voffset -80}${font Know Your Product:size=13}${time %a}
${voffset 5}${font Know Your Product:size=10}Arch:${font Know Your Product:size=20}${fs_used_perc /}${voffset -12}${font Know Your Product:size=10} Home:${font Know Your Product:size=20}${fs_used_perc /home}

Offline

#15 2011-09-03 00:56:16

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

Re: September 2011 Conky Thread

DrakarNoir wrote:

I am having difficulty figuring how to center the Day and Month/Date (and perhaps the time) in this clock conky. Please any help is appreciated.

TEXT
${voffset 48}${alignc 10}${font Droid Sans:size=11}$color1${time %a}
${goto 39}${font Droid Sans:style=bold:size=35}${time %l:%M}
${voffset -35}${alignc 10}${font Droid Sans:size=11}${color1}${time %B %e}

First thing you are doing in line 1 is placing the centre - then changing the font size - but the centre is for a different size therefore it is off centre

Next you use a goto for the hour and minutes, but without that leading 0 it will always lool "off centre" - I'd suggest %I to get the leading 0.  Just an opinion.

Next I would use a mono font, always looks better where spacing is important.   Again an opinion.

http://conky.pitstop.free.fr/wiki/index … y_%28en%29

A sample:

TEXT
Your code
${voffset 48}${alignc 10}${font Droid Sans:size=11}$color1${time %A}
${goto 39}${font Droid Sans:style=bold:size=35}${time %l:%M}
${voffset -35}${alignc 10}${font Droid Sans:size=11}${color1}${time %B %e}
${font}slight change
${voffset 48}${font Droid Sans:size=11}${alignc 10}${color1}${time %A}
${font Droid Sans:style=bold:size=35}${alignc 10}${time %l:%M}
${voffset -35}${font Droid Sans:size=11}${alignc 10}${time %B %e}
${font}Mono fonts better
${voffset 48}${font LCDMono:size=11}${alignc}$color1${time %a}
${font LCDMono:bold:size=35}${alignc}${time %l:%M}
${voffset -35}${font LCDMono:size=11}${alignc}${color1}${time %B %e}
${font}same spacing but the "0"
 helps with looks
${voffset 48}${font LCDMono:size=11}${alignc}$color1${time %a}
${font LCDMono:bold:size=35}${alignc}${time %I:%M}
${voffset -35}${font LCDMono:size=11}${alignc}${color1}${time %B %e}

I used own_window_colour grey so you can see the limits of the conky window.
thmb_spacing.png
Now it's time for you to play!


#! 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

#16 2011-09-03 03:25:41

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

Re: September 2011 Conky Thread

ackernan wrote:
Sector11 wrote:

In following PackRat - another nice simple little one line conky with a calendar by mobilediesel.

thmb_cal-1_liner.png

That's neat, I especially like the calendar part.   smile

Here's my conky after adding mobilediesel calendar.  I had to change it a little to get it work for me.

thumb051.png

Last edited by ackernan (2011-09-04 10:54:49)

Offline

#17 2011-09-03 03:58:27

rstrcogburn
CrunchRanger
From: New Mexico
Registered: 2010-06-12
Posts: 1,932
Website

Re: September 2011 Conky Thread

@nola

Great concept!


That hawk just kept flying! -Ben Lilly

Offline

#18 2011-09-03 06:15:43

anonymous
The Mystery Member
From: Arch Linux Forums
Registered: 2008-11-29
Posts: 9,418

Re: September 2011 Conky Thread

I recently merged a thread inot here so please do not miss it:

http://crunchbanglinux.org/forums/post/143110/#p143110

Offline

#19 2011-09-03 11:25:31

ackernan
#! Junkie
Registered: 2011-01-10
Posts: 403

Re: September 2011 Conky Thread

anonymous wrote:

I recently merged a thread inot here so please do not miss it:

http://crunchbanglinux.org/forums/post/143110/#p143110

I don't think you use ${alignc} for muliple lines. ${goto} is used to move lines a pixels, you use screenruler from the repository to help with the pixel count.

Offline

#20 2011-09-03 15:06:49

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

Re: September 2011 Conky Thread

nolla wrote:

I've been working on this for a day or two. Still not happy with the overall composition.

The code isn't too tricky, of course. Plus, it is ripped and tweaked. I'm not much of a hacker.

I like it, makes the conky look like part of the paper.


#! 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

#21 2011-09-03 15:23:40

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,010

Re: September 2011 Conky Thread

I thought Sector11 was already a mod, no? O_o

Sector11 wrote:

thmb_cal-1_liner.png

Lovin the clock/calender. One day, I'm probably gonna seek your guidance with getting something like that in the center of my screen.


Point & Squirt

Offline

#22 2011-09-03 15:45:32

xeNULL
#! Pirate
From: The Internet
Registered: 2011-01-23
Posts: 811

Re: September 2011 Conky Thread

Here is mine =] it covers my awesome wm toolbar so I don't have to mess with widgets.

It might be hard to see lol but its below
conky3.th.png

Last edited by xeNULL (2011-09-03 15:46:25)


AKA xii on #crunchbang #!WMFS2
dotshare | dA | 1 1 0 1 0 1 0 0 0

Offline

#23 2011-09-03 15:47:33

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

Re: September 2011 Conky Thread

thevdude wrote:

Grabbed this conky from xeNull, but I'm having an issue. Learned MoC just to use the music player part, but it's not centering properly. D: GAH.

Since the output of MoC is wider than your conky I'd suggest a second conky just for the music output below the original.  Play with the gap_y value to get it right.

# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
#  Settings
##############################################
#==============================================================================
#  MinHXR
#
#  Date    : 11/08/2011
#  author  : xeNULL
#  version : v0.1
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#==============================================================================

background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius
short_units yes

double_buffer yes
no_buffers yes
text_buffer_size 2048

gap_x 0
gap_y 100  ### play with this to move it uo to the original.  

minimum_size 500 35
maximum_width 800
own_window yes
own_window_type desktop
own_window_transparent no #yes
own_window_colour grey
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tm

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes

default_bar_size 115 30

override_utf8_locale no
use_xft yes
xftfont Terminus:size=7
xftalpha 1.0
uppercase no

default_color FFFFFF ## white
color1 999999 ## Medium Grey
color2 510000 ## Dark Red

TEXT
${if_running mocp}${alignc}${font sans:size=8}${exec mocp -Q %song}  ${color2}${font Humanoid:size=9}o${font}${color} ${exec mocp -Q %artist} ${color2}${font Humanoid:size=9}o${font}${color} ${exec mocp -Q %album}${font}${else}${endif}

#! 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

#24 2011-09-03 15:51:46

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 10,163
Website

Re: September 2011 Conky Thread

Challenge for Conky / Script experts...

Situation - I have a program that puts 2 images in /tmp upon execution.. one thumbnail and one regular sized with 2 different randomly generated names (by the app)

I would like a Conky line that can sed/ grep/whatever the latest and largest .png file and then display that using the image= command from Conky...

Doable?


VSIDO | SolusOS

Words That Build Or Destroy

Offline

Be excellent to each other!

#25 2011-09-03 15:52:04

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

Re: September 2011 Conky Thread

Sector11 wrote:

First thing you are doing in line 1 is placing the centre - then changing the font size - but the centre is for a different size therefore it is off centre

Next you use a goto for the hour and minutes, but without that leading 0 it will always lool "off centre" - I'd suggest %I to get the leading 0.  Just an opinion.

Next I would use a mono font, always looks better where spacing is important.   Again an opinion.

http://conky.pitstop.free.fr/wiki/index … y_%28en%29

A sample:

TEXT
${font}same spacing but the "0" helps with looks
${voffset 48}${font LCDMono:size=11}${alignc}$color1${time %a}
${font LCDMono:bold:size=35}${alignc}${time %I:%M}
${voffset -35}${font LCDMono:size=11}${alignc}${color1}${time %B %e}

Now it's time for you to play!

Sector11, thank you for the help. Made the changes you suggested, also changed font size of the time to make room for the leading "0" and read (and bookmarked) the article on spacing in Conky.

Screenshot_1.png

I am not a programmer, just grab and beat my way along until the thing does what I want it to! I appreciate the help. I am off to "play" some more!

Thanks , again.


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

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