SEARCH

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

You are not logged in.

#751 2012-03-11 16:45:12

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

falldown wrote:

Here is the first part of the "cyber Interactive weather concept"

http://youtu.be/sHGt4Bns7Iw <-- fade in display

and

http://youtu.be/qhMFikc66rY <-- sliding from center display

Help decide which one looks better.

easy! have them both available but controlled by a setting in the script big_smile

Offline

Be excellent to each other!

#752 2012-03-11 17:37:14

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

@Sector11

Very nice... Good to see you getting the hang of Lua


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#753 2012-03-11 18:58:05

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

Love the Time to be Creative concept.. and I agree with your wife.!!
Excellent Work Sector11


@Peachy.. I never thought about having both options. Let it be so!! big_smile

Offline

#754 2012-03-11 20:02:44

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

ackernan wrote:

Looks good.

Anybody tell you that you got too much time on your hands! lol

Thanks ... no nobody ever told me that.  Today is the first day in 'forever' I have not been bouncing around like a lacrosse ball in a steel room on a ship in high seas during the perfect storm!

So I'm taking advantage.

When I found that last wallpaper I found this too.  It was another 1280x1024 and my mind went 'SiNiSTeR' as well.  Since that script has time and other stuff in it.
f6c5c8179297189.jpg  9cc1ff179298300.jpg
First thing I did was an empty conky with a transparent white background to get the position and sizing correct!

Then I finished that sucker off:
fe5357179298297.jpg

conky - no ${goto}'s, no ${voffset}'s just spaces, so the Anonymous Pro font is a big part of it:

# To use #! in a conky use: ${exec echo '#!'}
# killall conky && conky -c ~/Conky/S11_Circles_lua.conky &

###  Begin Window Settings  ##################################################
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window_colour yellow
own_window_class Circles
own_window_title Circles

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### 'own_window_type override'
#                                                own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200

minimum_size 440 300     ## width, height
maximum_width 440       ## width, usually a good idea to equal minimum width

gap_x 420 # left-right
gap_y 370 # up-down

alignment tl
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Anonymous Pro:size=8

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color gray
default_outline_color black

default_color DCDCDC #Gainsboro
color0 9ACD32 #YellowGreen
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
# lua_load ~/Conky/LUA/draw-bg.lua
# lua_draw_hook_post draw_bg 0 0 0 0 0 0xffffff 0.8
#
##
#######################################################  End LUA Settings  ###

default_bar_size 120 20 # reverse to commandline and no comma:  ${cpubar 20,102}

# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1

cpu_avg_samples 1                    
net_avg_samples 1


lua_load ~/Conky/LUA/clock_rings.lua
lua_draw_hook_pre clock_rings


TEXT
                   CPU     Cores
                 Avg:        1                 /M/5 Used
                                                   ${fs_used_perc /}%

                   3         2                        

      /       Used
           ${fs_used_perc /}%

                            /home Used
           free

                                 ${fs_used_perc /home}%




                               free


                                                 eth0
                                                   DN

          eth0
            UP

~/Conky/LUA/clock_rings.lua

--[[
Clock Rings by londonali1010 (2009)
Edited by SuiCiDeSiNiSTeR (2012)
Edited for "Circles" by Sector11 (11 Mar 2012)

This script draws percentage meters as rings, and also draws clock hands if you want! It is easily customized; 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 near the end of the script 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-v1.1.1.lua
    lua_draw_hook_pre clock_rings

Changelog:
+ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.1 -- Added colour option for clock hands (07.10.2009)
+ v1.0 -- Original release (30.09.2009)
]]

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', --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=0x000000,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.3, --0.1
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xffffff,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=1.0,
        -- "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=395, y=163,
        -- "radius" is the radius of the ring.
        radius=30,
        -- "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',
        max=60,
        bg_colour=0x000000,
        bg_alpha=0.3,
        fg_colour=0xffffff,
        fg_alpha=1.0,
        x=395, y=163,
        radius=24,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0x000000,
        bg_alpha=0.3,
        fg_colour=0xffffff,
        fg_alpha=1.0,
        x=395, y=163,
        radius=18,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.0,
        fg_colour=0xff0000,
        fg_alpha=1.0,
        x=149, y=31.6,
        radius=12,
        thickness=14,
        start_angle=0,
        end_angle=89
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.0,
        fg_colour=0x0000ff,
        fg_alpha=1.0,
        x=149, y=31.6,
        radius=12,
        thickness=14,
        start_angle=90,
        end_angle=179
    },
    {
        name='cpu',
        arg='cpu3',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.0,
        fg_colour=0xA020F0,
        fg_alpha=0.5,
        x=149, y=31.6,
        radius=12,
        thickness=14,
        start_angle=180,
        end_angle=269
    },
       {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0x000000,
        bg_alpha=0.0,
        fg_colour=0x000000,
        fg_alpha=1.0,
        x=149, y=31.6,
        radius=12,
        thickness=14,
        start_angle=270,
        end_angle=359
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0x000000,
        bg_alpha=0.0,
        fg_colour=0x000000,
        fg_alpha=0.5,
        x=65, y=128,
        radius=44,
        thickness=15,
        start_angle=0,
        end_angle=360
    },
    {
        name='fs_free_perc',
        arg='/',
        max=100,
        bg_colour=0x000000,
        bg_alpha=0.0,
        fg_colour=0x000000,
        fg_alpha=0.5,
        x=65, y=128,
        radius=10,
        thickness=15,
        start_angle=0,
        end_angle=360
    },
    {
        name='fs_used_perc',
        arg='/home',
        max=100,
        bg_colour=0x000000,
        bg_alpha=0.0,
        fg_colour=0x000000,
        fg_alpha=0.5,
        x=198.5, y=185,
        radius=49, --51.5,
        thickness=26,
        start_angle=0,
        end_angle=360
    },
    {
        name='fs_free_perc',
        arg='/home',
        max=100,
        bg_colour=0x000000,
        bg_alpha=0.0,
        fg_colour=0x000000,
        fg_alpha=0.5,
        x=198.5, y=185,
        radius=10,
        thickness=15,
        start_angle=0,
        end_angle=360
    },
    {
        name='fs_used_perc',
        arg='/media/5',
        max=100,
        bg_colour=0x000000,
        bg_alpha=0.0,
        fg_colour=0x000000,
        fg_alpha=0.5,
        x=312.5, y=75,
        radius=32,
        thickness=16,
        start_angle=0,
        end_angle=360
    },
    {
        name='fs_free_perc',
        arg='/media/5',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xffffff,
        fg_alpha=0.5,
        x=312.5, y=75,
        radius=20,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='upspeedf', --red
        arg='eth0',
        max=500,
        bg_colour=0xff0000,
        bg_alpha=0.2,
        fg_colour=0xff0000,
        fg_alpha=1.0,
        x=106, y=268.5,
        radius=11,
        thickness=7,
        start_angle=0,
        end_angle=360
    },
    {
        name='downspeedf',  -- green
        arg='eth0',
        max=500,
        bg_colour=0x00AD00,
        bg_alpha=0.3,
        fg_colour=0x00AD00,
        fg_alpha=1.0,
        x=345, y=235.7,
        radius=15,
        thickness=7,
        start_angle=0,
        end_angle=360
    },
}

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

clock_r=30

-- "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=395
clock_y=165

-- Colour & alpha of the clock hands

clock_colour=0x0000FF
clock_alpha=1.0

-- Do you want to show the seconds hand?

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,rgb_to_r_g_b(clock_colour,clock_alpha))
    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)
        if value == nil then value = 0 end
        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

And again my thanks to SiNiSTeR!

And at this time also like to thank;

  • londonali1010 - for creating that script, to

  • mrpeachy - who has put up with my billion questions and yells for help, to

  • wlourf - for creating some fantastic scripts that helped open the door, and

  • to any others that have spent time with me and LUA.  They know what a pain I've been.

Been a GOOD day!

Both wallpaper specific - but who cares, I like 'em!

Last edited by Sector11 (2012-03-11 20:14:42)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#755 2012-03-11 20:12:33

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

VastOne wrote:

@Sector11

Very nice... Good to see you getting the hang of Lua

Thank you.  "editing" them to be used is the easy part, I couldn't create one from a blank screen and an idea if my life depended on it.  I'm getting pretty good at layouts though  big_smile

falldown wrote:

Love the Time to be Creative concept.. and I agree with your wife.!!
Excellent Work Sector11

@Peachy.. I never thought about having both options. Let it be so!! big_smile

I actually prefer it without the rings as well but since they are there in the script.
Next project a 24 hour clock  - basically the same but at 12 noon the hands will say "6" to anyone who doesn't know.  And they'll think the clock is broken.

I can accept that - both options, like Time to be Creative.  smile
Options are always good.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#756 2012-03-11 20:23:32

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

Sector11 wrote:

Thank you.  "editing" them to be used is the easy part, I couldn't create one from a blank screen and an idea if my life depended on it.  I'm getting pretty good at layouts though  big_smile

Don't sell yourself short. I have read a lot of your post concerning Lua in my own pursuit to better understand Lua...  and have learned a lot from your post.

I actually prefer it without the rings as well but since they are there in the script.
Next project a 24 hour clock  - basically the same but at 12 noon the hands will say "6" to anyone who doesn't know.  And they'll think the clock is broken.

I can accept that - both options, like Time to be Creative.  smile
Options are always good.

Options are always good!! big_smile
I don't believe that I have ever seen an analog 24 hour clock.. Interesting!!

Offline

#757 2012-03-11 20:53:15

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

falldown wrote:

Options are always good!! big_smile
I don't believe that I have ever seen an analog 24 hour clock.. Interesting!!

Yea, maybe so, but where I help is always with layout stuff from scripts that are already existing.  big_smile

24 hour analog clock are rare but they do exist.  And some clock faces use both sets of numbers.
I have a TIMEX watch that has the numbers 13 to 24 as the main large numbers and 1 to 12 as a smaller sub-set of numbers.

http://www.lawsonwatch.com/fr8intr24hom.html

http://staticfree.info/projects/24h_clock/

Me -- I want this watch!

Last edited by Sector11 (2012-03-11 21:07:28)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#758 2012-03-11 21:22:28

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

you could make the hour hand on that clock move slower, ie one complete revolution in 24 hours by editing the clock rings script

line 303 onward is currently this

   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)

if you changed
hours_arc=(2*math.pi/12)*hours+mins_arc/12
to
hours_arc=(2*math.pi/12)*hours+mins_arc/24

that should do it

Offline

#759 2012-03-11 22:03:22

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

Here is the second part of the "cyber Interactive weather concept"

http://youtu.be/etIrdI4aUes<--This is the next 3 hour display..

Its starting to come together!! big_smile

Offline

#760 2012-03-11 23:35:08

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

falldown wrote:

Here is the second part of the "cyber Interactive weather concept"

http://youtu.be/etIrdI4aUes<--This is the next 3 hour display..

Its starting to come together!! big_smile

Of course you're going to post everything when done - OR YOU'RE DEAD!! lol {joke joke}
Really really super nice stuff!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#761 2012-03-11 23:43:25

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

^^ Unbelievably Cool!!!  Wow, nice stuff falldown and Mr P...


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#762 2012-03-11 23:59:08

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

WARNING:  Does not function correctly Needs more work on the math!

The fix(es)

mepeachy came up with a fix here and then came up with a much nicer script here that needs NO image, it has a border and "markers" for numbers.  I modified it and show it running without borders and markers to use the image here.

So take your pick folks.
Thanks to mrpeachy.

BTW mrpeachy's new one is a 12 or 24 hour clock:

--12 OR 24
local clock_type=24
mrpeachy wrote:

if you changed
hours_arc=(2*math.pi/12)*hours+mins_arc/12
to
hours_arc=(2*math.pi/12)*hours+mins_arc/24

that should do it

Not quite ... BUT:

hours_arc=(2*math.pi/24)*hours+mins_arc/24

two 24's did it ... rather than find a wallpaper I have images I used:
-->>6b1945179325659.jpg<-->f3536d179325661.jpg<--
-->    24h_clock_v1.png      <-->     24h_clock_v2.png    <--
If you have a white background (shame on you this is the darkside) do a view image.  big_smile

                High Noon up here
c753ad179326030.jpg aa9acf179326036.jpg
               Midnight down here
Shhhhhhhhhhhhhhhhhh  you're  scaring  the  kids!!!

conky

# To use #! in a conky use: ${exec echo '#!'}
# killall conky && conky -c ~/Conky/S11_24hr.conky &

###  Begin Window Settings  ##################################################
own_window yes
own_window_type override #normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour yellow
own_window_class 24HR Clock
own_window_title 24HR Clock

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### 'own_window_type override'
#                                                own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200

minimum_size 250 250     ## width, height
maximum_width 250       ## width, usually a good idea to equal minimum width

gap_x 50 # left-right
gap_y 50 # up-down

alignment tl
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Anonymous Pro:size=8

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color gray
default_outline_color black

default_color DCDCDC #Gainsboro
color0 9ACD32 #YellowGreen
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
# lua_load ~/Conky/LUA/draw-bg.lua
# lua_draw_hook_post draw_bg 10 0 0 0 0 0xffffff 0.8
#
##
#######################################################  End LUA Settings  ###

default_bar_size 120 20 # reverse to commandline and no comma:  ${cpubar 20,102}

# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1

cpu_avg_samples 1                    
net_avg_samples 1


lua_load ~/Conky/LUA/24-hr_hands.lua
lua_draw_hook_pre clock_rings


TEXT
${image /home/sector11/Conky/images/24h_clock_v2.png -p 0,0 -s 250x250}

24-hr_hands.lua

--[[
Clock Rings by londonali1010 (2009)
Edited by SuiCiDeSiNiSTeR (2012)
Edited by Sector11 for the "24 Hour Clock" (11 Mar 2012)

This script draws percentage meters as rings, and also draws clock hands if you want! It is easily customized; 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 near the end of the script 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-v1.1.1.lua
    lua_draw_hook_pre clock_rings

Changelog:
+ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.1 -- Added colour option for clock hands (07.10.2009)
+ v1.0 -- Original release (30.09.2009)
]]

settings_table = {   -- if you want rings, open the tables
-- NOTE:  The settings_table must exist - even if empty.
--[[    {
        -- 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', --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=0xffffff,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.2,
        -- "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=186, y=186,
        -- "radius" is the radius of the ring.
        radius=170,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=15,
        -- "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',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xffffff,
        fg_alpha=0.2,
        x=186, y=186,
        radius=150,
        thickness=15,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xffffff,
        fg_alpha=0.2,
        x=186, y=186,
        radius=130,
        thickness=15,
        start_angle=0,
        end_angle=360
    }, ]]
}  -- end of settings_table - must exist

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

clock_r=80

-- "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=125
clock_y=125

-- Colour & alpha of the clock hands

clock_colour=0xffffff
clock_alpha=0.7

-- Do you want to show the seconds hand?

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/24)*hours+mins_arc/24

    -- 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,rgb_to_r_g_b(clock_colour,clock_alpha))
    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)
        if value == nil then value = 0 end
        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

Now to hit mrpeachy's HowTo and see how to change the colour of the hands in that sucker!

Been a good day ... hasta mañana!!

Last edited by Sector11 (2012-03-13 15:25:37)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#763 2012-03-12 00:03:36

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

Sector11 wrote:

Of course you're going to post everything when done - OR YOU'RE DEAD!! lol {joke joke}
Really really super nice stuff!

lol lol
Intimidation 101 Classes will be held daily here on the #! forums by Professor Sector11. (please bring pencil and paper for note) lol

Absolutely S11... will be a template ready soon hopefully.. still lots to do.

just kidding about the intimidation comment tongue

@VastOne.. Thank you Sir!! MrPeachy is doing all the hard work. big_smile

Last edited by falldown (2012-03-12 00:05:15)

Offline

#764 2012-03-12 00:15:06

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

The clock Looks Awesome Sector11
You can change colors here..

function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha

Red:0-255
Green:0-255
Blue:0-255

not sure if this is helpful..

Offline

#765 2012-03-12 01:04:45

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

falldown wrote:

lol lol
Intimidation 101 Classes will be held daily here on the #! forums by Professor Sector11. (please bring pencil and paper for note) lol

Intimidation 101 Classes do not require pencils nor paper, they do however require pain killers and splints!

{for me, because you're gonna hurt me, I just know it.}

Last edited by Sector11 (2012-03-12 01:05:27)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#766 2012-03-12 01:06:10

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

falldown wrote:

The clock Looks Awesome Sector11
You can change colors here..

function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha

Red:0-255
Green:0-255
Blue:0-255

not sure if this is helpful..

Tried changing the 255 values - nothing.  sad

EDIT ..... {grumble grumble}

-- Colour & alpha of the clock hands

clock_colour=0xffffff
clock_alpha=0.7

   D O H !

Last edited by Sector11 (2012-03-12 01:07:57)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#767 2012-03-12 01:18:17

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

Sector11 wrote:
-- Colour & alpha of the clock hands

clock_colour=0xffffff
clock_alpha=0.7

   D O H !

WOW! if that had been a snake.. it would have jumped out and bit us both!!

I didn't see that at all.. and I looked at least 3 times.

Offline

#768 2012-03-12 01:19:06

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

WARNING:  Does not function correctly
Needs more work on the math!

When in doubt - force feed the dummy!
7ebd71179334750.jpg

The black clocks:
-->245696179334268.jpg<-->9f2cdd179334435.jpg<<--
-->   24h_clock_v1r.png    <-->    24h_clock_v2r.png    <--

-- Colour & alpha of the clock hands

clock_colour=0x000000
clock_alpha=0.7

Last edited by Sector11 (2012-03-12 14:39:06)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#769 2012-03-12 01:27:19

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

falldown wrote:
Sector11 wrote:
-- Colour & alpha of the clock hands

clock_colour=0xffffff
clock_alpha=0.7

   D O H !

WOW! if that had been a snake.. it would have jumped out and bit us both!!

I didn't see that at all.. and I looked at least 3 times.

I looked at it for about 45 minutes ... I saw what you saw:

function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

... everything else went fuzzy and I went into brain freeze!
Tried everything ... saw what you posted and though ... "What am I missing!"

There it was like a neon sign shining in my face!
{blink    blink    blink    blink}  lol

Last edited by Sector11 (2012-03-12 01:29:28)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#770 2012-03-12 01:44:18

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

im still messing around with conky launchers

http://youtu.be/DhHUTjQObnI

Offline

#771 2012-03-12 01:59:09

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

mrpeachy wrote:

im still messing around with conky launchers

http://youtu.be/DhHUTjQObnI

Cool.. so now I don't have to ask you for a script for image buttons smile

Offline

#772 2012-03-12 02:14:35

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

falldown wrote:
mrpeachy wrote:

im still messing around with conky launchers

http://youtu.be/DhHUTjQObnI

Cool.. so now I don't have to ask you for a script for image buttons smile

@ falldown - you 'need'* to come up with a better start button for the "ConkyDock" or "DockyConky" or ....

We need a naming contest now!  big_smile

LUADock

* as in a polite request.

@ mrpeachy - Wonderful!!!!!

Last edited by Sector11 (2012-03-12 02:15:00)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#773 2012-03-12 02:26:07

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

Sector11 wrote:

@ falldown - you 'need'* to come up with a better start button for the "ConkyDock" or "DockyConky" or ....

We need a naming contest now!  big_smile

LUADock

* as in a polite request.

How about MrP(ea)Dock
Or maybe if Dock then??

lol  I really have no clue!!

Offline

#774 2012-03-12 02:39:19

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

falldown wrote:
mrpeachy wrote:

im still messing around with conky launchers

http://youtu.be/DhHUTjQObnI

Cool.. so now I don't have to ask you for a script for image buttons smile

like this

local main_tlx=20.5
local main_tly=20.5
local main_height=40
local main_width=40
--calculate if click was inside box
if localx>=main_tlx and localx<=main_tlx+main_width and localy>=main_tly and localy<=main_tly+main_height and buttons[1]~=1 then
buttons[1]=1
elseif localx>=main_tlx and localx<=main_tlx+main_width and localy>=main_tly and localy<=main_tly+main_height and buttons[1]==1 then
buttons[1]=0
elseif localx>main_tlx and localx>main_tlx+main_width and localy<main_tly and localy>main_tly+main_height and buttons[1]~=1 then
buttons[1]=0
end
if buttons[1]==1 then
image({x=main_tlx,y=main_tly,w=main_width,h=main_height,file="/home/mcdowall/files/launcher/off.png"})
elseif buttons[1]==0 then
image({x=main_tlx,y=main_tly,w=main_width,h=main_height,file="/home/mcdowall/files/launcher/on.png"})
end

im using the image() function
setting the image to the same coordinates and size as the click box, but just not drawing the box in any way, so all you see is the icon

Offline

Help fund CrunchBang, donate to the project!

#775 2012-03-12 02:46:33

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Conky v1.9 Thread

mrpeachy wrote:
if buttons[1]==1 then
image({x=main_tlx,y=main_tly,w=main_width,h=main_height,file="/home/mcdowall/files/launcher/off.png"})
elseif buttons[1]==0 then
image({x=main_tlx,y=main_tly,w=main_width,h=main_height,file="/home/mcdowall/files/launcher/on.png"})
end

Thats one of the things I was going to ask.. if I could use an on and off button for effect. I can.. so thats cool!!

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.
Server: acrobat

Debian Logo