SEARCH

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

You are not logged in.

#6551 2013-11-03 17:29:44

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: Conky v1.9 Thread

S11, that's amazing! Thank you  big_smile


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

Be excellent to each other!

#6552 2013-11-03 17:58:57

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

Re: Conky v1.9 Thread

Unia wrote:

S11, that's amazing! Thank you  big_smile

I'll pass on your comment to GrouchyGaijin stinkeye and arclance!

It happened in the conky thread over on the on the orange side.  Someone asked if they could kill just one conky ... the answer was (not a direct quote)

"It's all or nothing!"

GG didn't like that answer ...
...  and came up with the first cut of the bash script - then it became a CCCC thing. smile

Linux: if there's a will, there's a way!

It's brilliant!

Last edited by Sector11 (2013-11-03 18:04:43)


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

Offline

#6553 2013-11-03 18:05:23

lcafiero
The #! Guy
From: Felton, California, USA
Registered: 2011-07-21
Posts: 2,225
Website

Re: Conky v1.9 Thread

easysid wrote:

There's also this https://bbs.archlinux.org/viewtopic.php?id=169147, which imitates the Swiss railway clock

Someone just drew my attention to this and I think it's pretty cool. I'm not exactly sure how the code fits into .conkyrc, if indeed that's where it goes.

Has anyone put this Swiss Railway Clock on their Conky and, if so, can you tell me/show me how you did it?

Thanks in advance.


Res publica non dominetur | Larry the CrunchBang Guy speaks of the pompetous of CrunchBang

CrunchBang Forum moderator

Offline

#6554 2013-11-03 18:07:12

Tobu
Member
Registered: 2013-10-23
Posts: 19

Re: Conky v1.9 Thread

Tobu wrote:

Can anyone help me? I would like to make my conky completely transparent by default, and visible on mouseover. How can I go about doing this?

Anyone? I would really appreciate any help.

Offline

#6555 2013-11-03 18:18:01

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

Re: Conky v1.9 Thread

Tobu wrote:
Tobu wrote:

Can anyone help me? I would like to make my conky completely transparent by default, and visible on mouseover. How can I go about doing this?

Anyone? I would really appreciate any help.

That's a trick I've never heard of ... however ... don't give up.

It's beyond me though.


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

Offline

#6556 2013-11-03 18:20:12

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

Re: Conky v1.9 Thread

lcafiero wrote:
easysid wrote:

There's also this https://bbs.archlinux.org/viewtopic.php?id=169147, which imitates the Swiss railway clock

Someone just drew my attention to this and I think it's pretty cool. I'm not exactly sure how the code fits into .conkyrc, if indeed that's where it goes.

Has anyone put this Swiss Railway Clock on their Conky and, if so, can you tell me/show me how you did it?

Thanks in advance.

I missed that .. got it will play and let you know.


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

Offline

#6557 2013-11-03 19:14:43

photonucleon
Quantum Geek
From: Hogwarts
Registered: 2013-06-10
Posts: 952

Re: Conky v1.9 Thread

Tobu wrote:
Tobu wrote:

Can anyone help me? I would like to make my conky completely transparent by default, and visible on mouseover. How can I go about doing this?

Anyone? I would really appreciate any help.

I like the sound of this idea, though I have no idea how to make it work. The only way I can think of would be to write a script to track the location of your mouse pointer, and have it run "conky" when the mouse enters a specified area, and "killall conky" when the mouse leaves that area. How to write a script to do that, I have no idea, and I also imagine that it would be quite a messy hack... sad

Last edited by photonucleon (2013-11-03 19:15:06)


- Ai! Aníron Undómiel. -
- Some things are certain. -
- Et Eärello Endorenna utúlien. Sinome maruvan ar Hildinyar tenn' Ambar-metta. -

Offline

#6558 2013-11-03 19:36:42

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

Re: Conky v1.9 Thread

@ lcafiero

Well, I got it running but the second hand "jerks" there is now way "smooth" comes into it:

This clock also rotates smoothly without "ticks". It will also stop on top for
a configurable delay (look out for the global `delay` value).

It "jerks", not 'ticks' but 'jerks back and forth' around the clock for 58 seconds and pauses for 2 seconds and then the minute hand advances one minute and the second hand starts it's next jerky trip.  It's driving me nuts ... we need a LUA guru to look at it,

2013_11_03_16_17_19_1920x1080_Sector11.jpg

The conky:

# killall conky && conky -c /media/5/Conky/SwissClock/SwissClock.conky &

###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title conky_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 normal
 own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 0 #255

minimum_size 300 300	### w|h
maximum_width 300	### w

gap_x 0	### l|r
gap_y 20	### u|d

# Aligned position on screen: tl, tr, tm, bl, br, bm, ml, mr
alignment tr
##################################left#################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Liberation Sans:size=15
xftfont monofur:bold:size=12

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

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades yes #no # amplifies text if yes
default_shade_color 000000

draw_outline no # amplifies text if yes
default_outline_color 000000

default_color B0E0E6 #176 224 230 PowderBlue
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 D8BFD8 #216 191 216	Thistle
color3 9ACD32 #154 205  50	YellowGreen
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite${hr}
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 5F9EA0 # 95 158 160	CadetBlue
color8 BDB76B #189 183 107	DarkKhaki
color9 CD5C5C #205  92  92	IndianRed
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# 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 1028 # required for the horiz-cal

# 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

## Imlib2 image cache size, in bytes. Defaults to 4MiB. Increase this value
## if you use $image lots.		Set to 0 to disable the image cache.
imlib_cache_size 0

#top_name_width 15

lua_load /media/5/Conky/SwissClock/clock.lua
#lua_shutdown_hook shutdown
lua_draw_hook_pre clock

update_interval 0.1

TEXT

clock.lua

--[[
  A conky clock by Jochen Keil (2013)
  based upon Alison Pitt's Air Clock (2009)

  This clock is designed to resemble the swiss railway clock:

  https://en.wikipedia.org/wiki/Swiss_railway_clock
  https://upload.wikimedia.org/wikipedia/de/7/7c/Minutensprunguhr_animiert.gif

  From the wikipedia article:
  [..]
  The second hand is driven by an electrical motor independent of the
  master clock. It requires only about 58.5 seconds to circle the face, then the
  hand pauses briefly at the top of the clock. It starts a new rotation as soon
  as it receives the next minute impulse from the master clock
  [..]

  This clock also rotates smoothly without "ticks".
  It will also stop on top for a configureable delay (look out for the global delay value)

  The main drawback is resource usage. For smooth circulation, conky needs to be
  updated every 0.1 second. Therefore I strongly recommend to run this in
  a seperate conky process.
  Additionally, if the update_interval is larger than 1 the seconds hand is not
  drawn. Hence, to save battery set update_interval_on_battery to 30 or so.
--]]

require 'cairo'

-- Global Delay Value - how long to pause the seconds hand
delay = 2

-- r, g, b, a
background_color = { 1, 1, 1, 1 }

surface_bg = nil
surface_hours_hand = nil
surface_minutes_hand = nil
surface_seconds_hand = nil

sub_secs = 0
last_secs = 60

function init(window)
  surface_bg = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,window.width, window.height)
  surface_hours_hand = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,window.width, window.height)
  surface_minutes_hand = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,window.width, window.height)
  surface_seconds_hand = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,window.width, window.height)

  draw_seconds_hand(window.width / 2, window.height / 2,math.min(window.width, window.height) / 2)

  draw_marks(window.width / 2, window.height / 2,math.min(window.width, window.height) / 2)
end

function conky_shutdown()
  cairo_surface_destroy(surface_bg)
  cairo_surface_destroy(surface_hours_hand)
  cairo_surface_destroy(surface_minutes_hand)
  cairo_surface_destroy(surface_seconds_hand)
end

function draw_marks(xc, yc, clock_r)
  local cr = cairo_create(surface_bg)

  local minutes_len = clock_r * 0.075
  local minutes_thick = clock_r * 0.025
  local minutes_color = { 0.0, 0, 0, 1.0 }

  local hours_len = clock_r * 0.245
  local hours_thick = clock_r * 0.069
  local hours_color = { 0.0, 0, 0, 1.0 }
  local steps = 360/60

  local r,g,b,a = unpack(background_color)
  cairo_set_source_rgba(cr, r, g, b, a)
  cairo_arc(cr, xc, yc, clock_r, 0, 2 * math.pi)
  cairo_fill(cr)

  for deg = steps, 360, steps do
    local len = minutes_len
    local thick = minutes_thick
    local r,g,b,a = unpack(minutes_color)

    if deg % (360/12) == 0 then
      len = hours_len
      thick = hours_thick
      r,g,b,a = unpack(hours_color)
    end

    xbegin = xc + (clock_r - len) * math.sin(deg / (180/math.pi))
    ybegin = yc - (clock_r - len) * math.cos(deg / (180/math.pi))

    xend = xc + clock_r * math.sin(deg / (180/math.pi))
    yend = yc - clock_r * math.cos(deg / (180/math.pi))

    cairo_move_to(cr,xbegin,ybegin)
    cairo_line_to(cr,xend,yend)

    cairo_set_line_cap(cr,CAIRO_LINE_CAP_BUTT)
    cairo_set_line_width(cr,thick)
    cairo_set_source_rgba(cr,r,g,b,a)
    cairo_stroke(cr)
  end

  cairo_destroy(cr)
end

function draw_hours(xc, yc, clock_r, hours_arc)
  local hours_cr = cairo_create(surface_hours_hand)

  local xbegin=xc+(clock_r * -0.24)*math.sin(hours_arc)
  local ybegin=yc-(clock_r * -0.24)*math.cos(hours_arc)
  local xend=xc+(clock_r * 0.672)*math.sin(hours_arc)
  local yend=yc-(clock_r * 0.672)*math.cos(hours_arc)

  cairo_set_operator(hours_cr, CAIRO_OPERATOR_CLEAR)
  cairo_paint(hours_cr)
  cairo_set_operator(hours_cr, CAIRO_OPERATOR_SOURCE);

  cairo_move_to(hours_cr,xbegin,ybegin)
  cairo_line_to(hours_cr,xend,yend)

  cairo_set_line_width(hours_cr,clock_r * 0.11)
  cairo_stroke(hours_cr)

  cairo_destroy(hours_cr)
end

function draw_minutes(xc, yc, clock_r, mins_arc)
  local mins_cr = cairo_create(surface_minutes_hand)

  local xbegin=xc+(clock_r * -0.25)*math.sin(mins_arc)
  local ybegin=yc-(clock_r * -0.25)*math.cos(mins_arc)
  local xend=xc+(clock_r * 0.94)*math.sin(mins_arc)
  local yend=yc-(clock_r * 0.94)*math.cos(mins_arc)

  cairo_set_operator(mins_cr, CAIRO_OPERATOR_CLEAR)
  cairo_paint(mins_cr)
  cairo_set_operator(mins_cr, CAIRO_OPERATOR_SOURCE);

  cairo_move_to(mins_cr,xbegin,ybegin)
  cairo_line_to(mins_cr,xend,yend)

  cairo_set_line_width(mins_cr,clock_r * 0.08)
  cairo_stroke(mins_cr)

  cairo_destroy(mins_cr)
end

function draw_seconds_hand(xc, yc, clock_r)
  local secs_cr = cairo_create(surface_seconds_hand)

  local xbegin=xc
  local ybegin=yc-(clock_r * -0.34)
  local xend=xc
  local yend=yc-(clock_r * 0.65)

  cairo_set_source_rgba(secs_cr,1.0,0.0,0.0,1.0)

  cairo_move_to(secs_cr,xbegin,ybegin)
  cairo_line_to(secs_cr,xend,yend)

  cairo_set_line_width(secs_cr,clock_r * 0.025)
  cairo_stroke(secs_cr)

  cairo_arc(secs_cr, xend, yend, clock_r * 0.105, 0, 2 * math.pi)
  cairo_fill(secs_cr)

  cairo_destroy(secs_cr)
end

function conky_clock()
  if conky_window == nil then
    return
  elseif conky_window.width == 0 or conky_window.height == 0 then
    return
  end

  local first_run = surface_bg == nil
  if first_run then init(conky_window) end

  local w = conky_window.width
  local h = conky_window.height

  local cs = cairo_xlib_surface_create(conky_window.display,
                                       conky_window.drawable,
                                       conky_window.visual,
                                       w, h)

  local cr = cairo_create(cs)

  -- Settings

  local update_interval = conky_info["update_interval"]

  local clock_r = math.min(w,h) / 2

  local xc=w/2
  local yc=h/2

  local secs = os.date("%S")

  if not (last_secs == tonumber(secs)) then sub_secs = 0 end

  if last_secs > tonumber(secs) then
    local mins=os.date("%M")
    local mins_arc=(2*math.pi/60)*mins
    draw_minutes(xc, yc, clock_r, mins_arc)

    local hours=os.date("%I")
    local hours_arc=(2*math.pi/12)*hours+mins_arc/12
    draw_hours(xc, yc, clock_r, hours_arc)
  end

  last_secs = tonumber(secs)

  cairo_set_source_surface(cr, surface_bg, 0, 0)
  cairo_paint(cr)

  cairo_set_source_surface(cr, surface_hours_hand, 0, 0)
  cairo_paint(cr)

  cairo_set_source_surface(cr, surface_minutes_hand, 0, 0)
  cairo_paint(cr)

  if update_interval <= 1 then
    local secs_arc = 0

    if (update_interval < 1) then
      secs_arc = 2 * math.pi * (secs + sub_secs) / (60 - delay)

      if (secs_arc > 2 * math.pi) then secs_arc = 0 end

      sub_secs = sub_secs + update_interval

    elseif update_interval == 1 then
      secs_arc = 2 * math.pi * ((secs + delay) / 60)
    end

    cairo_translate(cr, xc, yc)
    cairo_rotate(cr, secs_arc)
    cairo_translate(cr, -xc, -yc)
    cairo_set_source_surface(cr, surface_seconds_hand, 0, 0)
    cairo_paint(cr)

  end

  cairo_destroy(cr)
  cairo_surface_destroy(cs)
end

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

Offline

#6559 2013-11-03 19:53:07

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

Re: Conky v1.9 Thread

photonucleon wrote:

I like the sound of this idea, though I have no idea how to make it work. The only way I can think of would be to write a script to track the location of your mouse pointer, and have it run "conky" when the mouse enters a specified area, and "killall conky" when the mouse leaves that area. How to write a script to do that, I have no idea, and I also imagine that it would be quite a messy hack... sad

Yea, that makes more sense start/stop the conky on "mouse over" 'could' work... BUT

1. you inadvertently move the mouse over that area my mistake ... Oops!
2. the conky take a while to load because it beeds to load something from the net,
3. make the "area" too big and you loose that screen real estate for any other use, too small and you hunt for it for a couple of minutes ...

on/off like Unia asked about would be a better option.

Just an opinion ... but hey, Tobu asked about it, he wants it, if he gets it power to him ... it's what Linux is all about.


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

Offline

#6560 2013-11-03 20:02:02

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

Re: Conky v1.9 Thread

photonucleon wrote:
Tobu wrote:
Tobu wrote:

Can anyone help me? I would like to make my conky completely transparent by default, and visible on mouseover. How can I go about doing this?

Anyone? I would really appreciate any help.

I like the sound of this idea, though I have no idea how to make it work. The only way I can think of would be to write a script to track the location of your mouse pointer, and have it run "conky" when the mouse enters a specified area, and "killall conky" when the mouse leaves that area. How to write a script to do that, I have no idea, and I also imagine that it would be quite a messy hack... sad

If you're using openbox, it might be easier to set up a mouse binding for the conky window similar to the main menu - Alt + Mouse 1 on the root window would open the conky window; getting it to close when the mouse is released, or clicked on an empty part of the root window. A key binding for open/close conky would probably be the easiest route.


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

Offline

#6561 2013-11-04 05:34:14

lcafiero
The #! Guy
From: Felton, California, USA
Registered: 2011-07-21
Posts: 2,225
Website

Re: Conky v1.9 Thread

Sector 11: Excellent! I'm working on it, too, though I bet you'll get to a solution long before I do.


Res publica non dominetur | Larry the CrunchBang Guy speaks of the pompetous of CrunchBang

CrunchBang Forum moderator

Offline

#6562 2013-11-04 06:45:42

mf
Member
From: Slovenia
Registered: 2013-10-28
Posts: 37

Re: Conky v1.9 Thread

What about hot corners? I've seen this feature in Ubuntu and I use it daily in Mac OS, I bet you can configure it in #!.

Last edited by mf (2013-11-04 06:46:25)

Offline

#6563 2013-11-04 14:10:21

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

Re: Conky v1.9 Thread

lcafiero wrote:

Sector 11: Excellent! I'm working on it, too, though I bet you'll get to a solution long before I do.

Well, I'm not so sure on that.  I fired up the cony just now ... WTH!!!  I thought Smart Car Conversion Kits were small ... but this is beyond that!  I'd need a microscope!

2013_11_04_10_58_26_1920x1080_Sector11.jpg

Something tells me that it is designed for a doc or bar because the original conky ... doesn't follow the norms ...

conky.config = {
  update_interval = 0.1,
  update_interval_on_battery = 30,

  own_window = true,
  own_window_type = 'normal',
  own_window_title = 'conky_clock',
  own_window_argb_visual = true,
  own_window_transparent = true,

  minimum_width = 300,
  minimum_height = 300,
  alignment = 'top_left',

  background = false,
  draw_shades = false,
  draw_outline = false,
  draw_borders = false,
  double_buffer = true,

  lua_load = 'clock.lua',
  lua_shutdown_hook = 'shutdown',
  lua_draw_hook_pre = 'clock',

};

conky.text = [[]];

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

Offline

#6564 2013-11-04 14:13:31

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

Re: Conky v1.9 Thread

mf wrote:

What about hot corners? I've seen this feature in Ubuntu and I use it daily in Mac OS, I bet you can configure it in #!.

Yea, that could work.

hotcorners+cb-aerosnap by th3pun15h3r


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

Offline

#6565 2013-11-04 23:28:24

liquibyte
#! Member
From: N42°34'30.2664",W71°59'
Registered: 2013-11-04
Posts: 67
Website

Re: Conky v1.9 Thread

I got an idea while hacking on mrpeachy's abstract conky.  I liked the idea of the pips on the seconds ring of the clock and decided I'd like to see that feature on the rest of the clock as well.  One thing led to another and I completely rewrote the clock function into another version of the clock rings lua.  Now before you think that this is just another rewrite, consider:

Hands, rings, pips background rings can be turned on and off.  individual portions of the date (day, month, year, day of the week) can be turned on and off.  Individual rings, hands, pips, and date parts all have their own configurations as far as size, color, widths etc.  The whole thing will scale (minus the date(s)) and move by settings in just 3 seperate lines.  Last but not least, credit has been given to your own mrpeachy.  I like his coding style and once I grokked it, it was easy to implement what I needed to get done.

This is meant as a drop in clock to be syled as you see fit and incorporated with your other lua scripts for a whole conky picture.  I hope someone finds it useful and easy enough to use.  If you like it, let me know.  Thanks mrpeachy for the idea and the coding style that I've adapted to be my own.

Here's a link to a screenshot on my deviant page

--[[Some functions shamelessly lifted from 'abstract conky by mrpeachy 2010' @ this
thread: http://crunchbang.org/forums/viewtopic.php?pid=78796 and clock_rings.lua
by londonali1010 @ http://mylittledesktop.blogspot.com. Updated, fixed and abused
for our purposes.  I think enough of the math and functions have changed that I
could actually call this fairly original though the ideas came from elsewhere.
	liquibyte - http://www.liquibyte.com & http://www.liquibyte.org]]--
require 'cairo'
function draw_ring(co, across, down, circrad, rlw, rstart, rend, rr, rg, rb, ra)
	degrads = math.pi/180
	start = rstart*degrads-math.pi/2
	finish = rend*degrads-math.pi/2
	xring = 0+circrad*(math.sin(degrads*rstart))
	yring = 0-circrad*(math.cos(degrads*rstart))
	cairo_move_to (cr, across+xring, down+yring)
	cairo_arc (cr, across, down, circrad, start, finish)
	cairo_set_line_width (cr, rlw)
	cairo_set_source_rgba (cr, rr, rg, rb, ra)
	cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT)
	cairo_stroke (cr)
end
function draw_hand(co, across, down, circrad, hlw, hx, hy, hr, hg, hb, ha)
	xhours = 0+circrad*math.sin(hours_arc)
	yhours = 0-circrad*math.cos(hours_arc)
	xmins = 0+circrad*math.sin(mins_arc)
	ymins = 0-circrad*math.cos(mins_arc)
	xsecs = 0+circrad*math.sin(secs_arc)
	ysecs = 0-circrad*math.cos(secs_arc)
	cairo_move_to (cr, across, down)
	cairo_line_to (cr, hx+across, hy+down)
	cairo_set_line_width (cr, hlw)
	cairo_set_source_rgba (cr, hr, hg, hb, ha)
	cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT)
	cairo_stroke (cr)
end
function draw_date(co, across, down, font, slant, weight, text, size, dr, dg, db, da)
	cairo_move_to (cr, across, down)
	cairo_set_font_size (cr, size)
	cairo_set_source_rgba (cr, dr, dg, db, da)
	cairo_select_font_face (cr, font, slant, weight);
	cairo_show_text (cr, text)
	cairo_stroke (cr)
end
function conky_draw_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)
--BASIC USER SETTINGS **********************************************************
--------SET HORIZONTAL AND VERTICAL POSITION RELATIVE TO CONKY WINDOW-----------
	across = 1200 --1200 --720 == center
	down = 240 --240 --450 == center
--------CLOCK RADIUS------------------------------------------------------------
	circrad = 120
--------TURN ON AND OFF THE DATE PARTS------------------------------------------
	show_weekday = true
	show_month = true
	show_days = true
	show_year = false
--------TURN ON AND OFF THE SECOND HAND FOR THE CLOCK---------------------------
	show_seconds = true
--------TURN ON AND OFF THE HANDS-----------------------------------------------
	show_hands = true
--------TURN ON AND OFF THE PIPS IN THE RINGS-----------------------------------
	show_pips = true
--------TURN ON AND OFF THE SOLID RINGS-----------------------------------------
	show_rings = false
--------TURN ON AND OFF THE MOVING RINGS----------------------------------------
	show_moving = true
--[[
********************************************************************************
My advice concerning changing anything other than the above is to stick to the
colors, line widths and radii for the clock hands and clock rings.  The circle
radius numbers for the hands are in the format of 'circrad+num+num'.  Only
adjust the first number because the second one is a compensation to allow the
hands to shrink or grow based on the above 'circrad=number'.  Be that as it may,
you can change and break the math if you'd like, it's all up to you.
********************************************************************************
]]--
--------GET TIME AND DATE FROM THE SYSTEM---------------------------------------
    secs = os.date("%S")    
    mins = os.date("%M")
    hours = os.date("%I")
	days = os.date("%e")
	weekday= os.date("%A")
	month = os.date("%B")
	year = os.date("%Y")
--------DEFINE THE ARCS---------------------------------------------------------
    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
--------START AND END DEGREES SECONDS-------------------------------------------
	secsperc = (secs/60)*100
	secsperc2 = secsperc*(360/100)
--------START AND END DEGREES MINUTES-------------------------------------------
	minsperc = (mins/60)*100
	minsperc2 = minsperc*(360/100)+secs_arc
--------START AND END DEGREES HOURS---------------------------------------------
	hoursperc = (hours/12)*100
	hoursperc2 = hoursperc*(360/100)+mins_arc*4.75 --this seems to be a hack but it works
--------HOURS HAND--------------------------------------------------------------
	if show_hands then
		draw_hand(0, across, down, circrad+30+6, 6, xhours, yhours, 0.4, 0.4, 0.4, 0.5)
	end
--------HOURS RINGS-------------------------------------------------------------
	if show_rings then
		draw_ring(0, across, down, circrad+30, 8, 0, 360, 0.4, 0.4, 0.4, 0.5)
	end
	if show_moving then
		draw_ring(0, across, down, circrad+30, 8, hours_arc-math.pi/2-hoursperc2/60, hoursperc2, 0.4, 0.4, 0.4, 0.5)
	end
--------HOURS PIP---------------------------------------------------------------
	if show_pips then
		draw_ring(0, across, down, circrad+30, 8, hoursperc2-1, hoursperc2+1, 0.4, 0.4, 0.4, 1.0)
	end
--------MINUTES HAND------------------------------------------------------------
	if show_hands then
		draw_hand(0, across, down, circrad+40+6, 4, xmins, ymins, 0.5, 0.5, 0.5, 0.5)
	end
--------MINUTES RINGS-----------------------------------------------------------
	if show_rings then
		draw_ring(0, across, down, circrad+40, 8, 0, 360, 0.5, 0.5, 0.5, 0.5)
	end
	if show_moving then
		draw_ring(0, across, down, circrad+40, 8, mins_arc-math.pi/2-minsperc2/60, minsperc2, 0.5, 0.5, 0.5, 0.5)
	end
--------MINUTES PIP-------------------------------------------------------------
	if show_pips then
		draw_ring(0, across, down, circrad+40, 8, minsperc2-0.5, minsperc2+0.5, 0.5, 0.5, 0.5, 1.0)
	end
--------SECONDS HAND------------------------------------------------------------
	if show_seconds then
		if show_hands then
			draw_hand(0, across, down, circrad+50-24, 2, xsecs, ysecs, 0.6, 0.6, 0.6, 0.5)
		end
--------SECONDS RINGS-----------------------------------------------------------
		if show_rings then
			draw_ring(0, across, down, circrad+50, 8, 0, 360, 0.6, 0.6, 0.6, 0.5)
		end
		if show_moving then
			draw_ring(0, across, down, circrad+50, 8, secs_arc-math.pi/2-secsperc2/60, secsperc2, 0.6, 0.6, 0.6, 0.5)
		end
--------SECONDS PIP-------------------------------------------------------------
		if show_pips then
			draw_ring(0, across, down, circrad+50, 8, secsperc2-0.5, secsperc2+0.5, 0.6, 0.6, 0.6, 1.0)
		end
	end
--------DATE--------------------------------------------------------------------
--------DAY OF THE WEEK---------------------------------------------------------
	if show_weekday then
		draw_date(0, across-140, down-185, "Sans", 0, 0, weekday, 34, 0.4, 0.4, 0.4, 0.8)
	end
--------MONTH-------------------------------------------------------------------
	if show_month then
		draw_date(0, across-90, down+205, "Sans", 0, 0, month, 34, 0.5, 0.5, 0.5, 0.8)
	end
--------DAY---------------------------------------------------------------------
	if show_days then
		draw_date(0, across-25, down+245, "Sans", 0, 0, days, 34, 0.5, 0.5, 0.5, 0.8)
	end
--------YEAR--------------------------------------------------------------------
	if show_year then
		draw_date(0, across-45, down+285, "Sans", 0, 0, year, 34, 0.6, 0.6, 0.6, 0.8)
	end
end

Offline

#6566 2013-11-05 14:30:18

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

Pendulum Clock
I made this few days ago. I had been working on getting the escape wheel arrangement correctly but I am impeded by the lack of pendulum images on the net and my poor gimp skills. Anyways, if you do not require the seconds hand or do not mind how it ticks w/o an apparent escapement (it might be hidden behind the layers or the clock body wink), then you can use this code to put the pendulum into action.

Steps
All the changes are to be done in the gearclock lua script. Set the imagepath accordingly.
You'll need a png image for the pendulum. I did this quick and dirty job, if you dont have one handy. Resize it accordingly.
image: http://i.imgur.com/ZdetPjw.png

  1. conky_interval=0.1 in conkyrc

  2. Add the following 2 lines to the lua script, outside all functions.

    local theta = 0.25
    local omega = 0
  3. Add the draw_pendulum function and call it

     draw_pendulum({x=<x>, y=<y>, file=<image>})

    .

    function draw_pendulum(t)
       --[[
         x, y -- coords of anchor point
         file -- image file to use (default 'pendulum.png')
         scale -- image scale factor (default 1)
         l = length of pendulum (default 100)
         dt = the time interval. (default 1)
         note that both 'l' and 'dt' do not contribute to image size. That is controlled by 'scale'
         they do have effect on the time period of the pendulum.
         Also see the 'theta' value at the top, which sets the amplitude.  
         ]]--
    
        local file = t.file or 'pendulum.png'
        local l = t.l or 100
        local dt = t.dt or 1
    
        local alpha = (-9.81/l)*math.sin(theta)
        omega = omega + alpha*dt
        theta = theta + omega*dt
        put_image({x=t.x, y=t.y, scale=t.scale, file=file, rotate=true, theta=theta})
    
    end
  4. Add

     tick=true

    in call to run_gear(), as gears need to tick.

That is all. If you have pendulum clipart/images, please do share. smile.
Try it out and tell me how it goes.

Last edited by easysid (2013-11-05 17:12:53)

Offline

#6567 2013-11-06 01:15:59

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

Re: Conky v1.9 Thread

This is still a work in progress..
2013_11_05_1383700241_1440x900_scrot.jpg

Offline

#6568 2013-11-06 13:08:57

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

Re: Conky v1.9 Thread

falldown wrote:

This is still a work in progress..

Waaaaaaaaaaaaaaaaaaaaaaaaa!!!!

8.(  I wanna do booful stuff like that!

You really are out doing yourself ... WOW!

makes mine look ... Hmmmmmmmm  big_smile


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

Offline

#6569 2013-11-06 13:27:54

Inodoro Pereyra
#! Die Hard
From: Back in Buenos Aires
Registered: 2013-07-01
Posts: 844

Re: Conky v1.9 Thread

easysid wrote:

If you have pendulum clipart/images, please do share. smile.

Here:

https://www.google.com/search?q=pendulo … 02&bih=481

big_smile

Offline

#6570 2013-11-06 13:32:09

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

Re: Conky v1.9 Thread

Monday cable TV and Internet went down, came back for maybe an hour yesterday and down again.  Sometime last night it came back.

On Monday I was cleaning up some of my 5 or 6 extra, a gross under exaggeration, conkys and found an interesting little conky by errorist so I started playing.  Changed the colour of the image, changed the font and added my info.  The 4 email accounts are fudged in there for looks.  Loved that "Home Town" so left that in.

Then I took a screen I had - GIMPED it to 5 - and made a different version just for something to do while waiting ... again the email accounts are fudged in --- they are working under the tint2 systray ...

2013_11_06_10_17_40_1920x1080_Sector11.jpg


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

Offline

#6571 2013-11-06 18:07:03

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

^Wow! this is really cool!


*kaum macht man es richtig, funktioniert es sofort*

Offline

#6572 2013-11-06 19:09:55

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

Re: Conky v1.9 Thread

Naik wrote:

^Wow! this is really cool!

Who?  What?  Where? When? Why? How?  ]:D  lol  lol  lol


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

Offline

#6573 2013-11-07 06:18:33

liquibyte
#! Member
From: N42°34'30.2664",W71°59'
Registered: 2013-11-04
Posts: 67
Website

Re: Conky v1.9 Thread

Ok, a quick update.  I was looking to get milliseconds woking and I stumbled upon the Swiss railway clock for conky.  To be honest, that one actually made my system start to crawl after a bit and I set to work on making the code better.  The following allows you to also turn on and off smooth seconds scrolling.  I think it worked out nicely without having to add too much to the code.  I've been keeping an eye on it in htop and it hasn't run away with the cpu or memory like the Swiss version does.

One of the problems I have, as you can see in the comments, is that os.date %H and %I will show a full ring for the moving rings for the hours from either noon to 1pm or midnight to 1am.  If anyone has any ideas how to work around this I'd appreciate a suggestion.

I forgot to mention that in order for the smooth scrolling bit to work, you need to set your .conkyrc updates to "update_interval 0.1".  Oddly 0.01 makes it work even smoother but I've not run it at that level for long so I don't know what effects it would have on the system if implemented with other scripts and such and I'm sure it's probably not a recommended practice.  If anybody's willing to do some testing, feedback is appreciated.  I'd like to do that bit programmatically but haven't gotten that far yet.  I'm not even sure if it's possible from the lua source.

--[[Some functions shamelessly lifted from 'abstract conky by mrpeachy 2010' @ this
thread: http://crunchbang.org/forums/viewtopic.php?pid=78796, clock_rings.lua
by londonali1010 @ http://mylittledesktop.blogspot.com and the Swiss railway clock
for conky @ https://github.com/jrk-/conky_clock. Updated, fixed and abused for our
purposes.  I think enough of the math and functions have changed that I could
actually call this fairly original though the ideas came from elsewhere.
	liquibyte - http://www.liquibyte.com & http://www.liquibyte.org]]--
require 'cairo'
secs	= os.date("%S") --these are needed to define the msecs starting position
msecs	= secs          --where the seconds actually are and not 12 o'clock
function draw_ring(co, across, down, circrad, rlw, rstart, rend, rr, rg, rb, ra)
	degrads	= math.pi/180
	start	= rstart*degrads-math.pi/2
	finish	= rend*degrads-math.pi/2
	xring	= 0+circrad*(math.sin(degrads*rstart))
	yring	= 0-circrad*(math.cos(degrads*rstart))
	cairo_move_to (cr, across+xring, down+yring)
	cairo_arc (cr, across, down, circrad, start, finish)
	cairo_set_line_width (cr, rlw)
	cairo_set_source_rgba (cr, rr, rg, rb, ra)
	cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT)
	cairo_stroke (cr)
end
function draw_hand(co, across, down, circrad, hlw, hx, hy, hr, hg, hb, ha)
	xhours	= 0+circrad*math.sin(hours_arc)
	yhours	= 0-circrad*math.cos(hours_arc)
	xmins	= 0+circrad*math.sin(mins_arc)
	ymins	= 0-circrad*math.cos(mins_arc)
	xsecs	= 0+circrad*math.sin(secs_arc)
	ysecs	= 0-circrad*math.cos(secs_arc)
	xmsecs	= 0+circrad*math.sin(msecs_arc)
	ymsecs	= 0-circrad*math.cos(msecs_arc)
	cairo_move_to (cr, across, down)
	cairo_line_to (cr, hx+across, hy+down)
	cairo_set_line_width (cr, hlw)
	cairo_set_source_rgba (cr, hr, hg, hb, ha)
	cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT)
	cairo_stroke (cr)
end
function draw_date(co, across, down, font, slant, weight, text, size, dr, dg, db, da)
	cairo_move_to (cr, across, down)
	cairo_set_font_size (cr, size)
	cairo_set_source_rgba (cr, dr, dg, db, da)
	cairo_select_font_face (cr, font, slant, weight);
	cairo_show_text (cr, text)
	cairo_stroke (cr)
end

function conky_draw_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)
--BASIC USER SETTINGS **********************************************************
--------SET HORIZONTAL AND VERTICAL POSITION RELATIVE TO CONKY WINDOW-----------
	across = 200
	down = 250
--------SET THE CLOCK RADIUS----------------------------------------------------
	circrad = 120
--------TURN ON AND OFF THE PARTS OF THE DATE-----------------------------------
	show_weekday	=	true
	show_month		=	true
	show_days		=	true
	show_year		=	true
--------TURN ON AND OFF THE SMOOTH SECOND HAND FUNCTIONALITY--------------------
	show_smooth		=	true
--------TURN ON AND OFF THE SECOND HAND FOR THE CLOCK---------------------------
	show_seconds	=	true
--------TURN ON AND OFF THE CLOCK HANDS-----------------------------------------
	show_hands		=	true
--------TURN ON AND OFF THE PIPS IN THE RINGS-----------------------------------
	show_pips		=	true
--------TURN ON AND OFF THE SOLID RINGS-----------------------------------------
	show_rings		=	true
--------TURN ON AND OFF THE MOVING RINGS----------------------------------------
	show_moving		=	true
--[[
********************************************************************************
My advice concerning changing anything other than the above is to stick to the
colors, line widths, rstart and rend for the pips.  Be particularly mindful of
adusting the clock hands and clock rings because things get hairy trying to keep
everything aligned.  The circle radius numbers for the hands are in the format
of 'circrad+num+num'The first number sets the radius and the second one is a
compensation to fix the length of the other hands.  If you adjust the radius to
have greater gaps, you'll probably have to adjust the second number to make up
for the other hands getting out of alignment.  I haven't worked it out yet but I
guess it's a bug of sorts.  Be that as it may, you can change and break the math
if you'd like, it's all up to you.  I have also not worked out how to make the
values of the hours %H and %I work right to not show a full ring for the moving
hours ring from noon to 1pm and midnight to 1am.  I may end up implementing the
AM - PM format if I can get that bit worked out.
********************************************************************************
]]--
--------GET TIME AND DATE FROM THE SYSTEM---------------------------------------
    secs	= os.date("%S")    
    mins	= os.date("%M")
    hours	= os.date("%I")
	days	= os.date("%e")
	weekday	= os.date("%A")
	month	= os.date("%B")
	year	= os.date("%Y")
--------DEFINE THE ARCS---------------------------------------------------------
	local update_interval = conky_info["update_interval"]
	msecs		= msecs + update_interval
	if msecs > 60 then msecs = 0 end
	msecs_arc	= (2*math.pi/60)*msecs
    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
--------START AND END DEGREES MILLISECONDS--------------------------------------
	msecsperc	= (msecs/60)*100
	msecsperc2	= msecsperc*(360/100)
--------START AND END DEGREES SECONDS-------------------------------------------
	secsperc	= (secs/60)*100
	secsperc2	= secsperc*(360/100)
--------START AND END DEGREES MINUTES-------------------------------------------
	minsperc	= (mins/60)*100
	minsperc2	= minsperc*(360/100)+secs_arc
--------START AND END DEGREES HOURS---------------------------------------------
	hoursperc	= (hours/12)*100
	hoursperc2	= hoursperc*(360/100)+mins_arc*4.75 --this seems to be a hack but it works
--------HOURS HAND--------------------------------------------------------------
	if show_hands then
		draw_hand(0, across, down, circrad+30+6, 6, xhours, yhours, 0.4, 0.4, 0.4, 0.5)
	end
--------HOURS RINGS-------------------------------------------------------------
	if show_rings then
		draw_ring(0, across, down, circrad+30, 8, 0, 360, 0.4, 0.4, 0.4, 0.5)
	end
	if show_moving then
		draw_ring(0, across, down, circrad+30, 8, hours_arc-math.pi/2-hoursperc2/60, hoursperc2, 0.4, 0.4, 0.4, 0.5)
	end
--------HOURS PIP---------------------------------------------------------------
	if show_pips then
		draw_ring(0, across, down, circrad+30, 8, hoursperc2-1.1, hoursperc2+1.1, 0.5, 0.5, 1.0, 1.0)
	end
--------MINUTES HAND------------------------------------------------------------
	if show_hands then
		draw_hand(0, across, down, circrad+40+6, 4, xmins, ymins, 0.5, 0.5, 0.5, 0.5)
	end
--------MINUTES RINGS-----------------------------------------------------------
	if show_rings then
		draw_ring(0, across, down, circrad+40, 8, 0, 360, 0.5, 0.5, 0.5, 0.5)
	end
	if show_moving then
		draw_ring(0, across, down, circrad+40, 8, mins_arc-math.pi/2-minsperc2/60, minsperc2, 0.5, 0.5, 0.5, 0.5)
	end
--------MINUTES PIP-------------------------------------------------------------
	if show_pips then
		draw_ring(0, across, down, circrad+40, 8, minsperc2-0.7, minsperc2+0.7, 0.5, 1.0, 0.5, 1.0)
	end
--------SECONDS HAND------------------------------------------------------------
	if show_seconds then
		if show_hands then
			if show_smooth then
				draw_hand(0, across, down, circrad+50-24, 2, xmsecs, ymsecs, 0.6, 0.6, 0.6, 0.5)
			end
			if not show_smooth then
				draw_hand(0, across, down, circrad+50-24, 2, xsecs, ysecs, 0.6, 0.6, 0.6, 0.5)
			end
		end
--------SECONDS RINGS-----------------------------------------------------------
		if show_rings then
			draw_ring(0, across, down, circrad+50, 8, 0, 360, 0.6, 0.6, 0.6, 0.5)
		end
		if show_moving then
			if show_smooth then
				draw_ring(0, across, down, circrad+50, 8, msecs_arc-math.pi/2-msecsperc2/60, msecsperc2, 0.6, 0.6, 0.6, 0.5)
			end
			if not show_smooth then
				draw_ring(0, across, down, circrad+50, 8, secs_arc-math.pi/2-secsperc2/60, secsperc2, 0.6, 0.6, 0.6, 0.5)
			end
		end
--------SECONDS PIP-------------------------------------------------------------
		if show_pips then
			if show_smooth then
				draw_ring(0, across, down, circrad+50, 8, msecsperc2-0.3, msecsperc2+0.3, 1.0, 0.5, 0.5, 1.0)
			end
			if not show_smooth then
				draw_ring(0, across, down, circrad+50, 8, secsperc2-0.3, secsperc2+0.3, 1.0, 0.5, 0.5, 1.0)
			end
		end
	end
--------DATE--------------------------------------------------------------------
--------DAY OF THE WEEK---------------------------------------------------------
	if show_weekday then
		draw_date(0, across-140, down-185, "Sans", 0, 0, weekday, 34, 0.4, 0.4, 0.4, 0.8)
	end
--------MONTH-------------------------------------------------------------------
	if show_month then
		draw_date(0, across-90, down+205, "Sans", 0, 0, month, 34, 0.5, 0.5, 0.5, 0.8)
	end
--------DAY---------------------------------------------------------------------
	if show_days then
		draw_date(0, across-25, down+245, "Sans", 0, 0, days, 34, 0.5, 0.5, 0.5, 0.8)
	end
--------YEAR--------------------------------------------------------------------
	if show_year then
		draw_date(0, across-45, down+285, "Sans", 0, 0, year, 34, 0.6, 0.6, 0.6, 0.8)
	end
end

Last edited by liquibyte (2013-11-07 06:54:42)

Offline

#6574 2013-11-07 09:46:31

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

@Sector11: i like the "out-of-the-way" bottom-conky... MassiveMultiConkyDesingSetups are cool and i woreship the once who can make them (greetings to fallout) but i don`t find them very usable. Yours is!


*kaum macht man es richtig, funktioniert es sofort*

Offline

Help fund CrunchBang, donate to the project!

#6575 2013-11-07 14:45:16

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

Re: Conky v1.9 Thread

Naik wrote:

@Sector11: i like the "out-of-the-way" bottom-conky... MassiveMultiConkyDesingSetups are cool and i woreship the once who can make them (greetings to fallout) but i don`t find them very usable. Yours is!


Ahhhhhhhh not mine - errorist - as pointed out in the post:

The conky (my version) if you want to play with it:

# killall conky && conky -c /media/5/Conky/errorist.conky &
## ===========================================================================
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title errorist

# 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 normal
# own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 0 #255

minimum_size 1020 34	### w|h
maximum_width 1020	### w
gap_x 0	### l|r
gap_y 0	### u|d

# Aligned position on screen: tl, tr, tm, bl, br, bm, ml, mr
alignment bm
##################################left#################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Liberation Sans:size=15
xftfont monofur:bold:size=10

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

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades yes #no # amplifies text if yes
default_shade_color 000000

draw_outline no # amplifies text if yes
default_outline_color 000000

#default_color DCDCDC #220 220 220	Gainsboro
#default_color C0C0C0 #192 192 192 Silver
default_color B0E0E6 #176 224 230 PowderBlue
color0 C4C4F8
color1 65A8E9
#color0 8FBC8F #143 188 143	DarkSeaGreen
color2 778899 #119 136 153	LightSlateGray
#color2 D8BFD8 #216 191 216	Thistle
color3 9ACD32 #154 205  50	YellowGreen
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 5F9EA0 # 95 158 160	CadetBlue
color8 BDB76B #189 183 107	DarkKhaki
color9 CD5C5C #205  92  92	IndianRed
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

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

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

# 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

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

## Imlib2 image cache size, in bytes. Defaults to 4MiB. Increase this value
## if you use $image lots.		Set to 0 to disable the image cache.
imlib_cache_size 0

#top_name_width 15
##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or it blinks.
##
# lua_load ~/wea_conky/draw_bg.lua
## TEXT
## ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
## ${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 /media/5/Conky/LUA/draw-bg.lua
# lua_draw_hook_pre draw_bg 50 0 0 0 0 0x000000 0.3
#
# TEXT
#
lua_load /media/5/Conky/LUA/draw-bg.lua

# Templates  ################################################# INTERESTING ###
## template0 ${font Monofur:bold:size=10}
## ${goto 264}${color5}${template0}1m    5m   15m ${color}\
## ${goto 419}${color5}${template0}Mem :${color}\

update_interval 1

TEXT
${image /media/5/Conky/images/bg_peptide_hard_2.png}${font}\
${voffset 2}${goto 58}${time %H:%M}\
${goto 150}${color5}0${if_match ${cpu cpu0}<10}${color2}00${color}${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100}${color2}0${color}${cpu cpu0}\
${else}${color9}${cpu cpu0}${endif}${endif}${color}\
${goto 190}${color5}1${if_match ${cpu cpu1}<10}${color2}00${color}${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100}${color2}0${color}${cpu cpu1}\
${else}${color9}${cpu cpu1}${endif}${endif}${color}\
${goto 270}${color5}1m   5m   15m ${color}\
${goto 425}${color5}Mem : ${color}${memmax}\
${goto 504}${color5}/${color}${goto 513}${mem}\
${goto 605}${color5}Home: ${color}${fs_size /home}${color5}\
${goto 686}/${goto 695}${color}${fs_free /home}\
${goto 785}${upspeed}\
${goto 871}${downspeed}\
${goto 960}${color5}C${color} 00:00
${goto 58}${uptime_short}\
${goto 150}${color5}2${if_match ${cpu cpu2}<10}${color2}00${color}${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100}${color2}0${color}${cpu cpu2}\
${else}${color9}${cpu cpu2}${endif}${endif}${color}\
${goto 190}${color5}3${if_match ${cpu cpu3}<10}${color2}00${color}${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100}${color2}0${color5}${cpu cpu3}\
${else}${color9}${cpu cpu3}${endif}${endif}${color}\
${goto 265}${loadavg} %${color5}\
${goto 425}Swap: ${color}${swapmax}${goto 504}${color5}/${color}${goto 513}${swapfree}${color5}\
${goto 605}Town: ${color}${fs_size /media/5}${color5}${goto 686}/${goto 695}${color}${fs_free /media/5}\
${goto 785}${totalup}${goto 871}${totaldown}\
${goto 960}${color5}S${color} 00:00

The email section would look like this (for 4 email accounts)

C ${if_match ${your email data 1} == 0}00${else}\
${if_match ${your email data 1} < 10}0\
${your email data 1}${else}\
${your email data 1}${endif}${endif}\
:${if_match ${your email data 2} == 0}00${else}\
${if_match ${your email data 2} < 10}0\
${your email data 2}${else}\
${your email data 2}${endif}${endif}

S ${if_match ${your email data 3} == 0}00${else}\
${if_match ${your email data 3} < 10}0\
${your email data 3}${else}\
${your email data 3}${endif}${endif}\
:${if_match ${your email data 4} == 0}00${else}\
${if_match ${your email data 4} < 10}0\
${your email data 4}${else}\
${your email data 4}${endif}${endif}

And the image: bg_peptide_hard, it contains the original image and my version.


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

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