SEARCH

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

You are not logged in.

#8151 2014-12-29 00:30:00

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

Re: Conky v1.9 Thread

Sector11 wrote:

but but you said:

The most important requisite, for me (besides that they work, of course), is for both the buttons and the conkys to be ABOVE any open window, so I don't have to close/minimize it, to see whatever data I need.

Sorry ....  ) sad (

]:D ]:D ]:D ]:D ]:D ]:D ]:D ]:D ]:D ]:D ]:D

What I meant is that I could NOT make sure to have the extra conkys behind the buttons by placing them below in the hints. Everything has to be above.
That's why I think it's ridiculous that they didn't think oof making a window type that'd be ALWAYS above everything else.  mad

Offline

Help fund CrunchBang, donate to the project!

#8152 2014-12-29 02:12:44

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

Re: Conky v1.9 Thread

So, that's the thing. I don't need to make the conky "look" round. I already know how to do that (some Canadian guy explained it to me, not long ago wink). What I need is to be able to adjust not only the size of the window to the conky itself, but also its SHAPE, so it won't interfere with other conkys.

That may actually be doable for you. One conky I use displays some Tao. Mr. Peachy wrote a lua script that changes the size of the semi-transparent background based on the amount of text displayed -

december14198185191600x900.jpg    december14198185591600x900.jpg

Not sure if it will work with what you're trying to do, but I'll post the scripts for you -

how_wide.lua

--background script that can match longest line in input by mrpeachy
--[[
use:
lua_load ~/lua/how_wide.lua

BELOW TEXT
${lua_parse tao {20,0,0,0,0,0x000000,1,"Sans",12,"normal","cat /home/mcdowall/Desktop/txt.txt",0}}

settings
${lua_parse tao {corner_rad,x,y,w,h,col,alpha,"font",font_size,"style","command",add_width}}
style can be: "normal", "bold", "italic", "bold:italic"
w=0 matches width to the length of longest line
h=0 matches height to conky window height
]]
start=1
require 'cairo'
function conky_tao(taotable)
taotable=loadstring("return" .. taotable)()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
local updates=tonumber(conky_parse("${updates}"))
local timer=(updates %tonumber(taotable[13]))
if timer==0 or start==1 then--###########################
--print ("activate")
start=0
taotext={}--hold output
taowidth={}--holds widths
--get values
local fn=taotable[8]            or "mono"
local fs=tonumber(taotable[9])        or 12
local st=taotable[10]            or "normal"
local wadd=tonumber(taotable[12])     or 50
--setup text
    if st=="normal" then
    cairo_select_font_face (cr, fn, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    elseif
    st=="bold" then
    cairo_select_font_face (cr, fn, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    elseif
    st=="italic" then
    cairo_select_font_face (cr, fn, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
    elseif
    st=="bold:italic" then
    cairo_select_font_face (cr, fn, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_BOLD);
    end
local fsl=fs*1.2
cairo_set_font_size (cr, fsl)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
--open file
local f = io.popen(taotable[11])
    for line in f:lines() do
    --measure text
    cairo_text_extents(cr,line,extents)
    local w=extents.x_advance
    table.insert(taowidth,w)
    --put lines in table
    table.insert(taotext,line)
    end
f:close()
f=nil
local line1=taotext[1]
taotext[1]="${font "..fn..":"..st..":size="..fs.."}"..line1
table.sort(taowidth)
max_width=tonumber(taowidth[#taowidth])+wadd
end--timed section
--#########################################################################################################
local function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255.,alpha
end
local r=tonumber(taotable[1])        or 0
local x=tonumber(taotable[2])        or 0
local y=tonumber(taotable[3])        or 0
local w=tonumber(taotable[4])        or 100
local h=tonumber(taotable[5])        or 100
local color=taotable[6]            or 0x000000
local alpha=tonumber(taotable[7])    or 0.3
--function conky_draw_bg(r,x,y,w,h,color,alpha)
if w==0 then w=max_width end--w=tonumber(conky_window.width) end
if h==0 then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
 local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
--#########################################################################################################
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return table.concat(taotext,"\n")
end--end main function

conkyrc  --> give you an example how to call it

<bunch of usual config stuff>

# Start the show
lua_load ~/conky/how_wide.lua

TEXT
${voffset 8}${lua_parse tao {6,0,0,0,0,0x14120E,.66,"Aller",10,"bold:italic","~/bin/taoread.sh",40,600}}

I'm just using it to parse text, not sure if it will work with actual data. But if you can use it with arclance's one window idea, you can have a window that will be rounded and change size based on the display.

Last edited by PackRat (2014-12-29 02:15:27)


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

Offline

#8153 2014-12-29 03:28:33

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: Conky v1.9 Thread

Inodoro Pereyra wrote:

That's why I think it's ridiculous that they didn't think oof making a window type that'd be ALWAYS above everything else.  mad

They did not do that because individual applications don't create window types.
Those are controlled by the window manager and applications tell the window manger what type they want to use.

Offline

#8154 2014-12-29 03:40:48

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

Re: Conky v1.9 Thread

Let's see if I can make myself understood with pictures. Stupid language barrier is frustrating the hell outta me.

THIS is (grossly) what I want to achieve:

2014_12_28_1419821458_1600x900_scrot.jpg

The round array of colored shapes is going to be (eventually) the button setup to activate each conky.
The six gray buttons on the perimeter are the ones for the conkys. Specifically, the one to the right of the word "System" will activate the  system conky you're seeing, half baked, in that scrot.
Now, looking at it, everything seems right, but, if I change the conky settings to:

own_window_transparent no
own_window_colour 000000
own_window_argb_visual no

the problem becomes immediately apparent:

2014_12_28_1419821205_1600x900_scrot.jpg

So it's clear, by looking at the scrot, that if I set up the conky that way, once I activate it, I won't be able to turn it off, because the conky background window is blocking the button.

So, what I need is not to change the with of the window. I can do that in conky.
What I need is to change the SHAPE of the window, like this:

2014_12_28_1419821321_1600x900_scrot.jpg

Please..., PLEASE, tell me you guys got it now... 8.(

Either way, I'm going with Arclance's suggestion. An all lua setup on a full screen conky should do the trick nicely.

Offline

#8155 2014-12-29 03:51:02

tknomanzr
#! Die Hard
From: Heavener, OK
Registered: 2014-12-09
Posts: 777

Re: Conky v1.9 Thread

I see what you are trying to achieve and it will look nice when done. However, I think I would utilize the empty right side of the screen for your fly-outs and not fight with trying to get conky to do something it is likely not able to do (at least from what I have seen.)
So when button is pressed your flyout (as I call them in my head) appears over to the right, utilizing all that nice empty space. Kinda like inotify does if I am understanding correctly.

Offline

#8156 2014-12-29 03:58:35

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

Re: Conky v1.9 Thread

Most of the empty space on the right will be taken by the weather+moonphase conky, the calendar conky and the birthdays conky. The Idea is for the conkys not to overlap, if at all possible.

Offline

#8157 2014-12-29 04:16:07

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: Conky v1.9 Thread

Inodoro Pereyra wrote:

Please..., PLEASE, tell me you guys got it now... 8.(

I understood a while ago and answered you before.

You can't actually make windows any shape other than a RECTANGLE.
There are no other options for any program not just conky.

You can make it so that some parts of your rectangular window are transparent and if you run a compositor you can see other windows underneath them through the transparent part.
However the transparent part of the window is still there and will be in the way preventing you from clicking on anything underneath it even though you can see it.

Offline

#8158 2014-12-29 04:24:00

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

Re: Conky v1.9 Thread

@Arclance: I know you understood me before. I already said I will go with your suggestion for an all lua conky setup. That post was meant for those who DIDN'T understand me before.

And I know what a rectangle is. Thank you.

Last edited by Inodoro Pereyra (2014-12-29 04:25:07)

Offline

#8159 2014-12-29 04:24:41

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: Conky v1.9 Thread

Ah. Ok. I could not tell that.

Offline

#8160 2014-12-29 15:04:00

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Conky v1.9 Thread

^ Every square is a rectangle, but not every rectangle is a square.  O:)

Offline

#8161 2014-12-29 16:32:35

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

Re: Conky v1.9 Thread

Most of the empty space on the right will be taken by the weather+moonphase conky, the calendar conky and the birthdays conky. The Idea is for the conkys not to overlap, if at all possible.

Then I think your best bet is to go with this -

tknomanzr wrote:

I see what you are trying to achieve and it will look nice when done. However, I think I would utilize the empty right side of the screen for your fly-outs and not fight with trying to get conky to do something it is likely not able to do (at least from what I have seen.)
So when button is pressed your flyout (as I call them in my head) appears over to the right, utilizing all that nice empty space. Kinda like inotify does if I am understanding correctly.

use the x,y offsets and font type/size for each conky - including the wheel - so that it all fits with your screen resolution. That will be tough on a laptop.

Do you actually need to see them all simultaneously? The other option would be to set up some virtual desktops and then activate the appropriate conky when you switch desktops - i.e. switching to Desktop 2 brings up the weather. I think S11 has been doing that for years now.


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

Offline

#8162 2014-12-29 17:18:16

chepioq
#! Member
Registered: 2013-01-09
Posts: 79

Re: Conky v1.9 Thread

Inodoro Pereyra wrote:

Most of the empty space on the right will be taken by the weather+moonphase conky, the calendar conky and the birthdays conky. The Idea is for the conkys not to overlap, if at all possible.

I have made a conky, with wlourf, with calendar, moon-phase and birthdays.

1419873220.jpg

I have send the code in this forum, but I don't remember the page.

EDIT
I find it : post #5431 page 218

Mod Edit.  I added a link to the post.  Thanks chepioq.
If you click on the "date" of a post you get a direct link to that post.

Also if you search for your name, chepioq, in your browsers find function in the Archives Thread you'll find it as well.

Last edited by Sector11 (2014-12-29 17:42:19)

Offline

#8163 2014-12-29 17:21:00

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

Re: Conky v1.9 Thread

PackRat wrote:

Do you actually need to see them all simultaneously? The other option would be to set up some virtual desktops and then activate the appropriate conky when you switch desktops - i.e. switching to Desktop 2 brings up the weather. I think S11 has been doing that for years now.

There is actually a few ways to do that - one is to use ${if_match} with ${desktop} and write one really large conky with sections that "appear" when you switch desktops -- IMHO this uses more CPU resources reading the if_match statements.  Also there is a slight "pause" as you switch and see what you are suppose to see on different desktops.

What I do is two fold:

  1. I use wmctrl to switch desktops and start conkys that have no

  2. I put a bunch of conkys in "windows" - remove "undecorated" from "own_window_hints" they fire up on boot, I read them and close them - I have OB Menu entries to start them again if need be.  I could use an ssc and make them borderless, but it's easier to hit the X to close them.  These all start on Desktop #1


Here's the bash script that starts them all:

#!/bin/bash
# click to start, click to stop

if pidof conky | grep [0-9] > /dev/null
	killall conky &
  then

# Start with low sleep on highest desktop
# Increase sleep as desktop lowers to insure the conky is running before changing desktops.

# on desktop 4 only | no sticky
	(sleep 1s && wmctrl -s 3 && conky -c /media/5/Conky/S12-time_L.conky) &
	(sleep 1s && wmctrl -s 3 && conky -c /media/5/Conky/S12-time_R.conky) &
	(sleep 1s && wmctrl -s 3 && conky -c /media/5/Conky/S12-time_tm.conky) &

# on desktop 3 only | no sticky
#	(sleep 4s && wmctrl -s 2 && conky -c /media/5/conky/7_months_h.conky) &

# on desktop 2 only | no sticky
	(sleep 5s && wmctrl -s 1 && conky -c /media/5/Conky/S11_Rem_Cal.conky) &
	(sleep 5s && wmctrl -s 1 && conky -c /media/5/Conky/S11_Dates.conky) &

# on desktop 1 only | no sticky - in windows
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_VRX.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_9_month_cal.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_VNSTAT_2.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_OJO.conky) &
# on desktop 1 only | no sticky
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_Debian_7.8.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_thin_r_side.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /home/sector11/1b1_accuweather_images/1b1_int.conky) &

# on all desktops | sticky
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_MD_Cal-br_2.conky) &
	(sleep 8s && conky -c /media/5/Conky/S11_Email_01.conky) &

########
else

# Start with low sleep on highest desktop
# Increase sleep as desktop lowers to insure the conky is running before changing desktops.

# on desktop 4 only | no sticky
	(sleep 1s && wmctrl -s 3 && conky -c /media/5/Conky/S12-time_L.conky) &
	(sleep 1s && wmctrl -s 3 && conky -c /media/5/Conky/S12-time_R.conky) &
	(sleep 1s && wmctrl -s 3 && conky -c /media/5/Conky/S12-time_tm.conky) &

# on desktop 3 only | no sticky
#	(sleep 4s && wmctrl -s 2 && conky -c /media/5/conky/7_months_h.conky) &

# on desktop 2 only | no sticky
	(sleep 5s && wmctrl -s 1 && conky -c /media/5/Conky/S11_Rem_Cal.conky) &
	(sleep 5s && wmctrl -s 1 && conky -c /media/5/Conky/S11_Dates.conky) &

# on desktop 1 only | no sticky - in windows
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_VRX.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_9_month_cal.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_VNSTAT_2.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_OJO.conky) &
# on desktop 1 only | no sticky
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_Debian_7.8.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_thin_r_side.conky) &
	(sleep 8s && wmctrl -s 0 && conky -c /home/sector11/1b1_accuweather_images/1b1_int.conky) &

# on all desktops | sticky
	(sleep 8s && wmctrl -s 0 && conky -c /media/5/Conky/S11_MD_Cal-br_2.conky) &
	(sleep 8s && conky -c /media/5/Conky/S11_Email_01.conky) &

  exit
fi

Gotta be nuts to run that many.


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

Offline

#8164 2014-12-30 00:02:47

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

Re: Conky v1.9 Thread

OOOOOk... let's see...:

@ Alad: wise words, grasshopper... lol

@PackRat: The button setup is round for a reason (I mean, other than because I like it and I like the challenge). I have conkys of different sizes that will fit in different places. What I don't want is to have a lot of empty real state between the button and its conky. Nothing really important, just an aesthetic call. Either way, that was already solved. I'm reading a lua programming manual as we speak, and when I'm ready I will write an all-lua interactive conky, that will take care of it.
Of course I could dedicate a desktop to conky (you know I have 12, so it's not like I'm gonna run outta space wink), and switch to it when I need to see something, but for that I wouldn't even need an interactive conky to start with (I'd just have to remove the "sticky" hint, and run all the conkys on a given desktop), but that would take all the fun out of it, wouldn't it?
And besides that, that does present a real inconvenience: There are some apps (it happened to me with VLC, but I don't discount there may be others) that automatically stop running (or pause) the moment you leave their desktop. Not long ago, I had a real problem with VLC sending my CPU usage and temperature straight to hell when I used it, especially on fullscreen mode. I went crazy trying to figure out a way to run it fullscreen, while at the same time being able to see my system conky, until I ended setting the conky "above"in the hints. I don't want to have to do all that again, ever.

@Chepioq: yeah, I've been looking at your conky. It gave me a lot of ideas... cool

@Sector11: Like I said, it's gonna be an all desktop, interactive, all-lua conky. However, I most likely will be PM'ing you in the future, regarding the single desktop stuff... cool

Sector11 wrote:

Gotta be nuts to run that many.

You don't say... lol  lol  lol

Offline

#8165 2014-12-30 00:11:15

akovia
New Member
Registered: 2013-07-01
Posts: 2

Re: Conky v1.9 Thread

Hi,
I am trying to combine a mounts bash script with a lua script and I can't seem to get myself pointed in the right direction.

The mounts.sh is as follows: (not mine)

#!/bin/bash

cat /proc/mounts |  awk '{ 
   if ( $1 ~ /\/dev/ ) 
   {
      num_elem = split($2,str_array,"/")
      if (str_array[num_elem] == "")
      {
         str_array[num_elem] = "/";
      }
      printf " ${color #98c2c7}%9.9s:$color  ${fs_used %s} ${goto 130} ${fs_free %s} ${goto 190} ${color #78af78}${fs_bar 6 %s}\n", str_array[num_elem], $2, $2, $2
   }
}'

The lua script is from wlourf on Deviantart.
I asked there as well but the lua is old and he hasn't been active for a couple years.

Anyway, what I'm after is a small dedicated widget just for my mounts that only shows current mounts and expands and contracts as the bash script does, but with the lua bar graphs (with alarms) like so:
conky-mounts_lua.jpg

Is there any way to incorporate the 2, or does this need to be done from scratch in lua alone?
Any help is much appreciated.

Offline

#8166 2015-01-08 21:56:55

prototyp86
New Member
From: Germany
Registered: 2013-06-09
Posts: 6

Re: Conky v1.9 Thread

After my Laptop Crash and losing all my Conkyscripts....
It was an hard Work to rewrite the complete scripts, so i tought, it would be an good idea, to post them here,
as a "backup" big_smile

Screen with all Conkyscripts:
Bildschirmfoto_vom_2015_01_08_21_35_25.jpg
-I splitted them in several Pieces, so its easier to rearrange or modified them.
-The bottom bar is splitted in 3 pieces: Systeminformations / Weather / CPU because.. CPU has an updateintervall of 1sec, but thats too much for Weather big_smile
- Weather based on Teo`s wonderful Conky weather+moon scripts. i´ve used the 1b1 script to build the horizontal Weather bar.
-For Music i´ve used Deadbeef as Musikplayer an scripts from here to show Covers.
(i don´t know why, but i have to edit the db-cover.sh to Work, replace the line

ARTCACHE=~/.config/deadbeef/artcache

with

ARTCACHE=~/.cache/deadbeef/covers/

conkyrc_System:

########################
#   Made by Prototyp86   #
########################

#####################
# Create own window #
#####################
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

########################
# Use double buffering #
########################
double_buffer yes

######################
# fiddle with window #
######################
use_spacer none
use_xft yes

##############################
# Update interval in seconds #
##############################
update_interval 120

#####################
# Size of text area #
#####################
minimum_size 222 120
maximum_width 222 120

###############
# Draw shades #
###############
draw_shades no
default_shade_color black

##############
# Text stuff #
##############
draw_outline no
draw_borders no
xftfont Arial:size=8
uppercase no
override_utf8_locale yes

###########
# borders #
###########
stippled_borders 0
border_inner_margin 1
border_outer_margin 0
border_width 1

##########################
# Default (border)colors #
##########################
default_color cbcbcb

##################
# Text alignment #
##################
alignment bottom_left


##########################################
# Gap between borders of screen and text #
##########################################
gap_x 90
gap_y 60

###############
# Other Stuff #
###############
imlib_cache_size 0
text_buffer_size 2048

TEXT
${hr 2}
${image $HOME/m.png -p 0,10 -s 45x45}
${goto 65}${font Arial:size=12:}System Information
${voffset 12}${font}Kernel: ${kernel} 
Uptime: ${uptime}
Batterie: ${battery_percent}%
User: ${user_names}
Arch: ${conky_build_arch}
${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq}

conkyrc_Weather

# scripts by TeoBigusGeekus
# modified by Prototyp86

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager


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

# fiddle with window
use_spacer right
use_xft yes

# Update interval in seconds
update_interval 240

# Minimum size of text area
minimum_size 525 120
maximum_width 525 120

override_utf8_locale yes

# Draw shades?
draw_shades no
default_shade_color black

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
xftfont Arial:size=8
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 0

# border margins
border_inner_margin 0
border_outer_margin 0

# border width
border_width 0

# Default colors and also border colors, grey90 == #e5e5e5
default_color cbcbcb

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

# Gap between borders of screen and text
gap_x 310
gap_y 50

imlib_cache_size 0
text_buffer_size 2048

# stuff after 'TEXT' will be formatted on screen

TEXT
${hr 2}$color${texeci 500 bash $HOME/1b1_accuweather_images/1b1}
${goto 10}${font Arial:size=12}Zolling  ${voffset 10}${goto 65}${font Arial:size=7:Bold:underline}${execpi 600 sed -n '1p' $HOME/1b1_accuweather_images/messages}  ${voffset -13}${font Arial:size=7}${goto 100}min:${execpi 600 sed -n '29p' $HOME/1b1_accuweather_images/curr_cond}°C  ${goto 145}max: ${execpi 600 sed -n '30p' $HOME/1b1_accuweather_images/curr_cond}°C  ${voffset 3}${font Arial:size=7}${goto 220}${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/first_days}  ${goto 305}${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/first_days}  ${goto 390}${execpi 600 sed -n '15p' $HOME/1b1_accuweather_images/first_days}  ${goto 475}${execpi 600 sed -n '20p' $HOME/1b1_accuweather_images/first_days}
${image $HOME/1b1_accuweather_images/cc.png -p 0,45 -s 91x55}   ${image $HOME/1b1_accuweather_images/6.png -p 215,30 -s 50x31}  ${image $HOME/1b1_accuweather_images/11.png -p 303,30 -s 50x31}  ${image $HOME/1b1_accuweather_images/16.png -p 385,30 -s 50x31}  ${image $HOME/1b1_accuweather_images/21.png -p 472,30 -s 50x31}
${goto 75}${font Arial:size=7}WIND: $color${execpi 600 sed -n '31p' $HOME/1b1_accuweather_images/curr_cond} ${execpi 600 sed -n '32p' $HOME/1b1_accuweather_images/curr_cond}
${goto 95}${font Arial:size=7}HUM: $color${execpi 600 sed -n '33p' $HOME/1b1_accuweather_images/curr_cond}
${goto 105}${font Arial:size=7}DP: $color${execpi 600 sed -n '37p' $HOME/1b1_accuweather_images/curr_cond}°C  ${voffset 4}${font Arial:size=7}${goto 220}${execpi 600 sed -n '8p' $HOME/1b1_accuweather_images/first_days}°C/${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/first_days}°C  ${goto 310}${execpi 600 sed -n '13p' $HOME/1b1_accuweather_images/first_days}°C/${execpi 600 sed -n '14p' $HOME/1b1_accuweather_images/first_days}°C  ${goto 400}${execpi 600 sed -n '18p' $HOME/1b1_accuweather_images/first_days}°C/${execpi 600 sed -n '19p' $HOME/1b1_accuweather_images/first_days}  ${goto 480}${execpi 600 sed -n '23p' $HOME/1b1_accuweather_images/first_days}°C/${execpi 600 sed -n '24p' $HOME/1b1_accuweather_images/first_days}°C
${voffset -4}${goto 115}${font Arial:size=7}PR: $color${execpi 600 sed -n '34p' $HOME/1b1_accuweather_images/curr_cond}  ${voffset 7}${goto 220}${execpi 600 sed -n '1p' $HOME/1b1_accuweather_images/last_days}  ${goto 305}${execpi 600 sed -n '6p' $HOME/1b1_accuweather_images/last_days}  ${goto 390}${execpi 600 sed -n '11p' $HOME/1b1_accuweather_images/last_days}  ${goto 475}${execpi 600 sed -n '16p' $HOME/1b1_accuweather_images/last_days}
${voffset -7}${goto 105}${font Arial:size=7}VISIB: $color${execpi 600 sed -n '38p' $HOME/1b1_accuweather_images/curr_cond}  ${image $HOME/1b1_accuweather_images/last_2.png -p 215,87 -s 50x31}  ${image $HOME/1b1_accuweather_images/last_7.png -p 303,87 -s 50x31}  ${image $HOME/1b1_accuweather_images/last_12.png -p 385,87 -s 50x31}  ${image $HOME/1b1_accuweather_images/last_17.png -p 472,87 -s 50x31}
${goto 95}${font Arial:size=7}CLOUD COVER: $color${execpi 600 sed -n '35p' $HOME/1b1_accuweather_images/curr_cond}
${goto 10}${font Arial:size=7}UV INDEX: $color${execpi 600 sed -n '36p' $HOME/1b1_accuweather_images/curr_cond}
${goto 10}${font Arial:size=7}SUNRISE:$color${execpi 600 sed -n '39p' $HOME/1b1_accuweather_images/curr_cond} ${goto 110}SUNSET:$color${execpi 600 sed -n '40p' $HOME/1b1_accuweather_images/curr_cond} 
${goto 10}${font Arial:size=7}MOONRISE:$color${execpi 600 sed -n '41p' $HOME/1b1_accuweather_images/curr_cond} ${goto 110}MOONSET:${execpi 600 sed -n '42p' $HOME/1b1_accuweather_images/curr_cond}  ${font Arial:size=7}${goto 220}${execpi 600 sed -n '4p' $HOME/1b1_accuweather_images/last_days}°C/${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/last_days}°C  ${goto 310}${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/last_days}°C/${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/last_days}°C  ${goto 400}${execpi 600 sed -n '14p' $HOME/1b1_accuweather_images/last_days}°C/${execpi 600 sed -n '15p' $HOME/1b1_accuweather_images/last_days}  ${goto 480}${execpi 600 sed -n '19p' $HOME/1b1_accuweather_images/last_days}°C/${execpi 600 sed -n '20p' $HOME/1b1_accuweather_images/last_days}°C

conkyrc_CPU

########################
#  Made by Prototyp86  #
########################

#####################
# Create own window #
#####################
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

########################
# Use double buffering #
########################
double_buffer yes

######################
# fiddle with window #
######################
use_spacer none
use_xft yes

##############################
# Update interval in seconds #
##############################
update_interval 1.0

#####################
# Size of text area #
#####################
minimum_size 220 120
maximum_width 220 120

###############
# Draw shades #
###############
draw_shades no
default_shade_color black

##############
# Text stuff #
##############
draw_outline no
draw_borders no
draw_graph_borders no
xftfont Arial:size=8
uppercase no
override_utf8_locale yes

###########
# borders #
###########
stippled_borders 0
border_inner_margin 0
border_outer_margin 0
border_width 0

##########################
# Default (border)colors #
##########################
default_color cbcbcb

##################
# Text alignment #
##################
alignment bottom_right

##########################################
# Gap between borders of screen and text #
##########################################
gap_x 310
gap_y 58

###############
# Other Stuff #
###############
imlib_cache_size 0
text_buffer_size 2048

TEXT
${hr 2}
${goto 5}${voffset 7}CPU1: ${cpu cpu0}% ${goto 65}${voffset -7}${cpugraph cpu0 18,160 cbcbcb 2e2e2e 100} 
${goto 5}${voffset 7}CPU2: ${cpu cpu1}% ${goto 65}${voffset -7}${cpugraph cpu1 18,160 cbcbcb 2e2e2e 100}
${goto 5}${voffset 7}CPU3: ${cpu cpu2}% ${goto 65}${voffset -7}${cpugraph cpu2 18,160 cbcbcb 2e2e2e 100}
${goto 5}${voffset 7}CPU4: ${cpu cpu3}% ${goto 65}${voffset -7}${cpugraph cpu3 18,160 cbcbcb 2e2e2e 100}

conkyrc_Clock:

########################
#  Made by Prototyp86  #
########################

#####################
# Create own window #
#####################
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

########################
# Use double buffering #
########################
double_buffer yes

######################
# fiddle with window #
######################
use_spacer none
use_xft yes

##############################
# Update interval in seconds #
##############################
update_interval 30

#####################
# Size of text area #
#####################
minimum_size 240 120
maximum_width 240 120

################
# Draw shades? #
################
draw_shades no
default_shade_color black

##############
# Text stuff #
##############
draw_outline no 
draw_borders no
draw_graph_borders no
font
xftfont Arial:size=12
uppercase no 
override_utf8_locale yes

###########
# Borders #
###########
stippled_borders 0
border_inner_margin 0
border_outer_margin 0
border_width 0

##########################
# Default (border)colors #
##########################
default_color cbcbcb

##################
# Text alignment #
##################
alignment bottom_right

##########################################
# Gap between borders of screen and text #
##########################################
gap_x 40
gap_y 35

###############
# Other Stuff #
###############
imlib_cache_size 0
text_buffer_size 2048

# stuff after 'TEXT' will be formatted on screen

imlib_cache_size 0
TEXT
${time %d.%b} ${goto 75} ${time %A} ${alignr} ${time %G}
${hr 2}
${voffset -10}${font akuru-bodo:size=55:bold}${alignc}${time %k:%M}
${voffset -60}${hr 2}

conkyrc_Panel

########################
#  Made by Prototyp86  #
########################

#####################
# Create own window #
#####################
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

########################
# Use double buffering #
########################
double_buffer yes

######################
# fiddle with window #
######################
use_spacer none
use_xft yes

##############################
# Update interval in seconds #
##############################
update_interval 1.0

#####################
# Size of text area #
#####################
minimum_size 310 120
maximum_width 310 120

################
# Draw shades? #
################
draw_shades no
default_shade_color black

##############
# Text stuff #
##############
draw_outline no
draw_borders no
draw_graph_borders no
xftfont Arial:size=9
uppercase no
override_utf8_locale yes

###########
# Borders #
###########
stippled_borders 0
border_inner_margin 0
border_outer_margin 2
border_width 0

##########################
# Default (border)colors #
##########################
default_color cbcbcb

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

##########################################
# Gap between borders of screen and text #
##########################################
gap_x 5
gap_y 60

###############
# Other Stuff #
###############
imlib_cache_size 0
text_buffer_size 2048

TEXT
${goto 50}WLAN${hr 2}
${goto 50}Essid: ${wireless_essid wlp3s0}
${goto 50}Connection Quality: ${wireless_link_qual wlp3s0}%
${goto 50}${downspeedgraph wlp3s0 30,260 cbcbcb 2e2e2e 50}
${goto 50}DLS:${downspeedf wlp3s0}KBs${alignr}total:${totaldown wlp3s0}
${goto 50}${upspeedgraph wlp3s0 30,260 cbcbcb 2e2e2e 50}
${goto 50}ULS:${upspeedf wlp3s0}KBs${alignr}total:${totalup wlp3s0}
${goto 50}${voffset 5}MUSIK${hr 2}
${font Arial:size=8:bold}${voffset 13}${goto 123}${execi 2 deadbeef --nowplaying "%t"}
${font Arial:size=7}${goto 130}${voffset 5}${execi 2 deadbeef --nowplaying "%a"}
${font Arial:size=7}${goto 132}${voffset 5}${execi 2 deadbeef --nowplaying "%b"}
${font Arial:size=7}${goto 130}${voffset 5}${execi 2 deadbeef --nowplaying "%y"}
${font Arial:size=7}${goto 125}${voffset 5}${execi 1 deadbeef --nowplaying "%e"}/${execi 1 deadbeef --nowplaying "%l"}
${font}${goto 50}${texeci 20 ~/.config/conky/db-cover.sh}${image ~/.config/conky/conkyCover.png -p 0,180}
${goto 50}${voffset 22}SYSTEM RAM${hr 2}
${goto 50}${voffset 6}RAM USAGE:  ${mem}${goto 180}/${goto 188}${memmax}${alignr}${memperc}%
${goto 50}${voffset 2}SWAP USAGE:  ${swap}${goto 180}/${goto 188}${swapmax}${alignr}${swapperc}%
${goto 50}${voffset 5}HDD${hr 2}
${goto 50}${voffset 6}Home: ${fs_used} / ${fs_size}${alignr}${fs_used_perc}%
${goto 50}${voffset 2}${fs_bar 10,260 /}
${goto 50}${voffset 5}PROCESSES${hr 2}
${goto 50}${voffset 6}${top name 1}${alignr}${top cpu 1}%
${goto 50}${top name 2}${alignr}${top cpu 2}%
${goto 50}${top name 3}${alignr}${top cpu 3}%
${goto 50}${top name 4}${alignr}${top cpu 4}%
${goto 50}total${alignr} ${cpu}%

conkyrc_Pictures:

########################
#  Made by Prototyp86  #
########################

#####################
# Create own window #
#####################
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_argb_visual yes

########################
# Use double buffering #
########################
double_buffer yes

######################
# fiddle with window #
######################
use_spacer none
use_xft yes

##############################
# Update interval in seconds #
##############################
update_interval 9000

#####################
# Size of text area #
#####################
minimum_size 1250 550
maximum_width 1250 550

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

##############
# Text stuff #
##############
draw_outline no
draw_borders no
draw_graph_borders no
xftfont Arial:size=9
uppercase no

###########
# Borders #
###########
stippled_borders 0
border_inner_margin 0
border_outer_margin 0
border_width 0

##################
# Text alignment #
##################
alignment top_left

##########################################
# Gap between borders of screen and text #
##########################################
gap_x 10
gap_y 110

###############
# Other Stuff #
###############
imlib_cache_size 4096
text_buffer_size 2048

TEXT
${image $HOME/1.jpg -p 130,170 -s 320x200}
${image $HOME/2.jpg -p 480,170 -s 173x200}
${image $HOME/3.jpg -p 683,170 -s 301x200}

Offline

#8167 2015-01-10 22:44:38

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

Re: Conky v1.9 Thread

^ awesome!  Nice stuff.


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

Offline

#8168 2015-01-12 20:18:46

ikeeki
Member
Registered: 2015-01-03
Posts: 10

Re: Conky v1.9 Thread

My config (not blinking one)
Lua:

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

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    clock DATA
-- HOURS
clock_h = {
    {
    name='time',                   arg='%H',                    max_value=12,
    x=85,                         y=80,
    graph_radius=53,
    graph_thickness=3,
    graph_unit_angle=30,           graph_unit_thickness=30,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xffffff,      graph_fg_alpha=0.5,
    txt_radius=34,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x4AD500,        txt_fg_alpha=1,
    graduation_radius=53,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1,
    },
}
-- MINUTES
clock_m = {
    {
    name='time',                   arg='%M',                    max_value=60,
    x=85,                         y=80,
    graph_radius=57,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=6,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x4AD500,      graph_fg_alpha=1,
    txt_radius=70,
    txt_weight=0,                  txt_size=12.0,
    txt_fg_colour=0x4AD500,        txt_fg_alpha=1,
    graduation_radius=57,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0x4AD500, graduation_fg_alpha=1
  ,
    },
}
-- SECONDS
clock_s = {
    {
    name='time',                   arg='%S',                    max_value=60,
    x=85,                         y=80,
    graph_radius=50,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=2,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.0,
    graph_fg_colour=0x4AD500,      graph_fg_alpha=0.2,
    txt_radius=40,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0x4AD500,        txt_fg_alpha=1,
    graduation_radius=0,
    graduation_thickness=0,        graduation_mark_thickness=0,
    graduation_unit_angle=0,
    graduation_fg_colour=0x4AD500, graduation_fg_alpha=0.0,
    },
}

--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {
{
    name='cpu',                    arg='cpu0',                  max_value=100,
    x=85,                          y=205,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.2,
    graph_fg_colour=0x4AD500,      graph_fg_alpha=1,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=0.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0x4AD500,        txt_fg_alpha=0.3,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0x4AD500, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu1',                  max_value=100,
    x=85,                          y=205,
    graph_radius=18,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.2,
    graph_fg_colour=0x4AD500,      graph_fg_alpha=1,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=0.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.3,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='memperc',                arg='',                      max_value=100,
    x=85,                          y=295,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.2,
    graph_fg_colour=0x4AD500,      graph_fg_alpha=1,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=0.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.3,
    graduation_radius=23,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='fs_used_perc',           arg='/',                max_value=100,
    x=85,                          y=380,
    graph_radius=18,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.2,
    graph_fg_colour=0x4AD500,      graph_fg_alpha=1,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=0.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},

}

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

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

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

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

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

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

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

-------------------------------------------------------------------------------
--                                                              draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_start_angle = data['graph_start_angle']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
    local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
    local graph_end_angle = (max_value * graph_unit_angle) % 360

    -- background ring
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)

    -- arc of value
    local val = value % (max_value + 1)
    local start_arc = 0
    local stop_arc = 0
    local i = 1
    while i <= val do
        start_arc = (graph_unit_angle * i) - graph_unit_thickness
        stop_arc = (graph_unit_angle * i)
        cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
        cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = start_arc

    -- hand
    start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
    stop_arc = (graph_unit_angle * val)
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
    cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
    cairo_stroke(display)

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

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

    -- caption
    local caption = data['caption']
    local caption_weight, caption_size = data['caption_weight'], data['caption_size']
    local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
    local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
    cairo_set_font_size (display, caption_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
    cairo_move_to (display, x + tox + 5, y + toy + 1)
    -- bad hack but not enough time !
    if graph_start_angle < 105 then
        cairo_move_to (display, x + tox - 30, y + toy + 1)
    end
    cairo_show_text (display, caption)
    cairo_stroke (display)
end

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

-------------------------------------------------------------------------------
--                                                               go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
    local function load_gauge_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_gauge_ring(display, data, value)
    end
    
    for i in pairs(gauge) do
        load_gauge_rings(display, gauge[i])
    end
end

-------------------------------------------------------------------------------
--                                                                         MAIN
function conky_main()
    if conky_window == nil then 
        return
    end

    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)
    
    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)
    
    if update_num > 5 then
        go_clock_rings(display)
        go_gauge_rings(display)
    end
    
    cairo_surface_destroy(cs)
    cairo_destroy(display)
end

Config:

 #==============================================================================
#                                 conkyrc_grey
#
#  author  : SLK
#  version : v2011011601
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#==============================================================================

background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius

double_buffer yes
no_buffers yes
text_buffer_size 2048

gap_x 10
gap_y 70
minimum_size 190 450
maximum_width 170
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tr

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

override_utf8_locale yes
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5
uppercase no

#default_color FFFFFF
#color1 DDDDDD
#color2 AAAAAA
#color3 888888
#color4 666666


default_color 4AD500
color1 4AD500
color2 4AD500
color3 4AD500
color4 4AD500
color5 DDDDDD


lua_load /etc/conky/conky_grey.lua
lua_draw_hook_post main
TEXT
${voffset 35}
${goto 75}${color4}${font neuropol:size=22}${time %e}
${goto 75}${color4}${voffset -20}${color4}${font neuropol:size=9}${time %b}${voffset -20}
${voffset 80}




${goto 90}${font neuropol:size=7,weight:bold}${color}CPU

#${goto 90}${font neuropol:size=7,weight:normal}${color1}${top name 1}${alignr}${top cpu 1}%
#${goto 90}${font neuropol:size=7,weight:normal}${color2}${top name 2}${alignr}${top cpu 2}%
#${goto 90}${font neuropol:size=7,weight:normal}${color3}${top name 3}${alignr}${top cpu 3}%
#${goto 90}${cpugraph 10,100 4AD500 4AD500}
${goto 90}${voffset -10}${font neuropol:size=7,weight:normal}${color}${threads} process 






${voffset 20}
${goto 90}${font neuropol:size=7,weight:bold}${color}MEM
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${top_mem name 1}${alignr}${top_mem mem 1}%
#${goto 90}${font Ubuntu:size=7,weight:normal}${color2}${top_mem name 2}${alignr}${top_mem mem 2}%
#${goto 90}${font Ubuntu:size=7,weight:normal}${color3}${top_mem name 3}${alignr}${top_mem mem 3}%





${voffset 15}
${goto 90}${font neuropol:size=7,weight:bold}${color}FREE SPACE
#${goto 90}${diskiograph 30,100 4AD500 4AD500}${voffset -30}
${goto 90}${font neuropol:size=13,weight:normal}${color4}${fs_free /home}



${font neuropol:size=13,weight:normal}${kernel} 
${font neuropol:size=13,weight:normal}${exec sensors | grep ^temp1}




#${goto 90}${font Ubuntu:size=7,weight:normal}${color4}used: ${fs_used /} /
#${voffset 10}
#${goto 70}${font Ubuntu:size=18,weight:bold}${color3}NET${alignr}${color2}${font Ubuntu:size=7,weight:bold}${color1}${if_up eth0}eth ${addr eth0}
${endif}${if_up wlan0}wifi ${addr wlan0}${endif}
#${goto 90}${font Ubuntu:size=7,weight:bold}${color}open ports: ${alignr}${color2}${tcp_portmon 1 65535 count}
#${goto 90}${font Ubuntu:size=7,weight:bold}${color}${offset 10}IP${alignr}DPORT
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  0}${alignr 1}${tcp_portmon 1 65535 rport  0}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  1}${alignr 1}${tcp_portmon 1 65535 rport  1}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  2}${alignr 1}${tcp_portmon 1 65535 rport  2}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  3}${alignr 1}${tcp_portmon 1 65535 rport  3}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  4}${alignr 1}${tcp_portmon 1 65535 rport  4}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  5}${alignr 1}${tcp_portmon 1 65535 rport  5}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  6}${alignr 1}${tcp_portmon 1 65535 rport  6}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  7}${alignr 1}${tcp_portmon 1 65535 rport  7}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  8}${alignr 1}${tcp_portmon 1 65535 rport  8}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  9}${alignr 1}${tcp_portmon 1 65535 rport  9}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 10}${alignr 1}${tcp_portmon 1 65535 rport 10}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 11}${alignr 1}${tcp_portmon 1 65535 rport 11}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 12}${alignr 1}${tcp_portmon 1 65535 rport 12}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 13}${alignr 1}${tcp_portmon 1 65535 rport 13}
#${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 14}${alignr 1}${tcp_portmon 1 65535 rport 14}

Offline

#8169 2015-01-12 22:01:35

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

Re: Conky v1.9 Thread

ikeeki wrote:

My config (not blinking one)

That's the one I wanted to see though.

OK first off - IF you have a dual core CPU the a change here is needed: conky_grey.lua
The first two entries for CPU should read:

    name='cpu',                    arg='cpu1',                  max_value=100,
{snip}
    name='cpu',                    arg='cpu2',                  max_value=100,
{snip}

cpu0 is the average of the cpu cores.
If you have a single core then cpu0 = cpu1
With a dual core you can actually use:

    name='cpu',                    arg='cpu1',                  max_value=100,
{snip}
    name='cpu',                    arg='cpu2',                  max_value=100,
{snip}
    name='cpu',                    arg='cpu0',                  max_value=100,
{snip}

making the ring a different size so cpu0 could show the 'average' cpu usage.

Next in the conky itself:
I got this error when I started it:

Conky: got an endif without matching if
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  61 (X_ClearArea)
  Resource id in failed request:  0x0
  Serial number of failed request:  33
  Current serial number in output stream:  35

That error is the call for wifi that is not commented out:
Line ±112 --> ${endif}${if_up wlan0}wifi ${addr wlan0}${endif}

Next you your maximum width is less than your minimum width:

minimum_size 190 450
maximum_width 170

I commented those out and OOPS! the error comes from this line:

${font Neuropol:size=13}${exec sensors | grep ^temp1}

This shows in the redrawn conky.
2015_01_12_18_43_20_1920x1080_Sector11.jpg
Check Using Sensors, I recommend Method 3

EDIT:
With my sensors included:
2015_01_12_19_29_50_1920x1080_Sector11.jpg

Last edited by Sector11 (2015-01-12 22:31:14)


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

Offline

#8170 2015-01-12 22:47:53

ikeeki
Member
Registered: 2015-01-03
Posts: 10

Re: Conky v1.9 Thread

Sector11 wrote:
ikeeki wrote:

My config (not blinking one)

That's the one I wanted to see though.

OK first off - IF you have a dual core CPU the a change here is needed: conky_grey.lua
The first two entries for CPU should read:

    name='cpu',                    arg='cpu1',                  max_value=100,
{snip}
    name='cpu',                    arg='cpu2',                  max_value=100,
{snip}

cpu0 is the average of the cpu cores.
If you have a single core then cpu0 = cpu1
With a dual core you can actually use:

    name='cpu',                    arg='cpu1',                  max_value=100,
{snip}
    name='cpu',                    arg='cpu2',                  max_value=100,
{snip}
    name='cpu',                    arg='cpu0',                  max_value=100,
{snip}

making the ring a different size so cpu0 could show the 'average' cpu usage.

Next in the conky itself:
I got this error when I started it:

Conky: got an endif without matching if
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  61 (X_ClearArea)
  Resource id in failed request:  0x0
  Serial number of failed request:  33
  Current serial number in output stream:  35

That error is the call for wifi that is not commented out:
Line ±112 --> ${endif}${if_up wlan0}wifi ${addr wlan0}${endif}

Next you your maximum width is less than your minimum width:

minimum_size 190 450
maximum_width 170

I commented those out and OOPS! the error comes from this line:

${font Neuropol:size=13}${exec sensors | grep ^temp1}

This shows in the redrawn conky.
http://s20.postimg.org/6tf253o3t/2015_01_12_18_43_20_1920x1080_Sector11.jpg
Check Using Sensors, I recommend Method 3

EDIT:
With my sensors included:
http://s20.postimg.org/rrl836nyh/2015_01_12_19_29_50_1920x1080_Sector11.jpg


Thank you very much for your analysis, I have learnt from it and It'll be useful for me to improve "my" code.
Cheers

EDIT: comenting the lines you told me  and letting the full size of conky area causes a glitch on my desktop, so it was not alignr the culprit, thanks again.

The comented lines:

#minimum_size 190 450
#maximum_width 170

causes the glitch, it happens with and without composite enabled

Last edited by ikeeki (2015-01-12 23:02:24)

Offline

#8171 2015-02-01 17:51:53

hyuecn
New Member
From: London, UK
Registered: 2015-01-25
Posts: 7

Re: Conky v1.9 Thread

Dear All,

I'm newish linux and conky, and so my first effort is not particularly exciting but I'd thought I'd share it nevertheless.

2zomah5.png

I've tweaked code from DeviantArt. I run Crunchbang on my EEE 901 so I went quite minimalist as I don't have the screen space.

##~~ lovelybacon.deviantart.com~~

## inspired by http://arpinux.deviantart.com/art/conky-leds-338017834      use of and/is in conkys
## tweaked by hyuecn

update_interval 1
total_run_times 0
net_avg_samples 2
cpu_avg_samples 2
imlib_cache_size 0
double_buffer yes
no_buffers yes
override_utf8_locale yes
use_xft yes
xftalpha 0
xftfont Monospace:size=8
text_buffer_size 1024
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_pager,skip_taskbar
alignment tl
gap_x 670
gap_y 450
border_inner_margin 0
border_outer_margin 0
minimum_size 0 0
maximum_width 330 120
default_color 01001b #dark grey
color1 75D1C7
color2 6DD5B1
color3 64D99B
color4 5CDD85
color5 54E16F
color6 4BE558
color7 43E942
color8 3BED2C
color9 32F116


draw_shades no
draw_outline no
default_shade_color 222222
if_up_strictness address

TEXT

${if_match ${fs_used_perc /} == 100}${color9}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} == 100}${color9}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} == 100}${color9}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} == 100}${color9}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} == 100}${color9}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} == 100}${color9}${else}${color}${endif}▪▪▪▪                                                                                                                                                                                                                                                     
${if_match ${fs_used_perc /} > 95}${color9}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪			${if_match ${cpu} > 95}${color9}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 95}${color9}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 95}${color9}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 95}${color9}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 95}${color9}${else}${color}${endif}▪▪▪▪    
${if_match ${fs_used_perc /} > 90}${color9}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 90}${color9}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 90}${color9}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 90}${color9}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 90}${color9}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 90}${color9}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 85}${color8}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 85}${color8}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 85}${color8}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 85}${color8}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 85}${color8}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 85}${color8}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 80}${color8}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 80}${color8}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 80}${color8}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 80}${color8}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 80}${color8}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 80}${color8}${else}${color}${endif}▪▪▪▪		
${if_match ${fs_used_perc /} > 75}${color7}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 75}${color7}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 75}${color7}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 75}${color7}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 75}${color7}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 75}${color7}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 70}${color7}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 70}${color7}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 70}${color7}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 70}${color7}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 70}${color7}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 70}${color7}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 65}${color6}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 65}${color6}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 65}${color6}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 65}${color6}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 65}${color6}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 65}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 60}${color6}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 60}${color6}${else}${color}${endif}▪▪▪▪			${if_match ${memperc} > 60}${color6}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 60}${color6}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 60}${color6}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 60}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 55}${color5}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 55}${color5}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 55}${color5}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 55}${color5}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 55}${color5}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 55}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 50}${color5}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 50}${color5}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 50}${color5}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 50}${color5}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 50}${color5}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 50}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 45}${color4}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 45}${color4}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 45}${color4}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 45}${color4}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 45}${color4}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 45}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 40}${color4}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 40}${color4}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 40}${color4}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 40}${color4}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 40}${color4}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 40}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 35}${color3}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 35}${color3}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 35}${color3}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 35}${color3}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 35}${color3}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 35}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 30}${color3}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 30}${color3}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 30}${color3}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 30}${color3}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 30}${color3}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 30}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 25}${color2}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 25}${color2}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 25}${color2}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 25}${color2}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 25}${color2}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 25}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 20}${color2}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 20}${color2}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 20}${color2}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 20}${color2}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 20}${color2}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 20}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 15}${color1}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 15}${color1}${else}${color}${endif}▪▪▪▪			${if_match ${memperc} > 15}${color1}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 15}${color1}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 15}${color1}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 15}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${fs_used_perc /} > 10}${color1}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 10}${color1}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 10}${color1}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 10}${color1}${else}${color}${endif}▪▪▪▪		 ${if_match ${battery_percent} > 10}${color1}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 10}${color6}${else}${color}${endif}▪▪▪▪
${if_match ${cpu} > 0}${color1}${else}${color}${endif}${voffset -8}${offset 49}▪▪▪▪ 		${if_match ${cpu} > 0}${color1}${else}${color}${endif}▪▪▪▪ 		${if_match ${memperc} > 0}${color1}${else}${color}${endif}▪▪▪▪ 		${if_match ${wireless_link_qual_perc wlan0} > 0}${color1}${else}${color}${endif}▪▪▪▪ 		${if_match ${battery_percent} > 0}${color1}${else}${color}${endif}▪▪▪▪		 ${if_match ${acpitemp} > 0}${color1}${else}${color}${endif}▪▪▪▪
${color #666666}${font Computerfont}${offset 45}HDD${offset 15}CPU${offset 13}MEM${offset 13}WFS${offset 13}PWR${offset 14}TMP

The one problem I had, that maybe someone can help with, is how to monitor if the laptop is charging or discharging. Ideally, where the script says PWR, I would like this to change to BAT when it is discharging. I tried doing this with an if_match command but quickly ran out of knowledge!


Insert something witty here

Offline

#8172 2015-02-01 21:11:33

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: Conky v1.9 Thread

^ "{battery_short}" will give you a single letter (D for discharging, and I think C for charging) and the remaining percent charge.

Offline

#8173 2015-02-01 23:35:06

hyuecn
New Member
From: London, UK
Registered: 2015-01-25
Posts: 7

Re: Conky v1.9 Thread

arclance wrote:

^ "{battery_short}" will give you a single letter (D for discharging, and I think C for charging) and the remaining percent charge.

Hi,

Yes thanks.

What I had been trying to do was use if_match and battery_short. I was hoping that I could have a command so that if battery_short=="D" the text beneath the power monitor bar would say "BAT" and if battery_short=="C" it would say "PWR".

I could get it show the battery_short output instead of PWR but to me, aesthetically it didn't really look right.

${if_match ${battery_short}<"D"}${PWR}$else${BAT}${endif}

I tried something like the above, but as a newbie I doubt I've got it right

Last edited by hyuecn (2015-02-01 23:51:24)


Insert something witty here

Offline

#8174 2015-02-03 18:03:32

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

Re: Conky v1.9 Thread

Saw these clocks for Android on the playstore, seemed a good thing to do. (Yet again, just a copying job, not a creative one. )

Tell me what you think.
abmRdzt.png

Took me longer than it should have, but I'd forgotten all the lua that I'd learned 8o . It came back after a while though.

min_clock.lua

--[[
minimal clock for conky
based upon similar android clock widget

written by easysid
Tuesday, 03 February 2015 16:20 IST
]]--


require 'cairo'


clock_table = {
        -- clock style options
        use12hourformat = true,  -- 12 hr format. Set to false for 24 hrs
        showday = true,      -- show the day of the week
        draw_background = true, -- set to false if you do not want a bg fill
        draw_seconds = true, -- draw the seconds ring
            -- options if above is true
            seconds_ring_width = 4, -- seconds ring width
            seconds_ring_base_color = {0x909090, 0.8}, -- base color
            seconds_ring_fill_color = {0xFFFFFF, 0.8},-- fill color
        --
        -- main settings
        --
        xc = 170, -- centre of the clock
        yc = 170,
        R  = 120, -- outer radius
        r  = 25, -- minute ring radius
        border_width = 2,
        -- color settings. {color, alpha}
        background_color = {0xFFFFFF, 0.5}, -- bgcolor id draw_background is true.
        fill_color   = {0xb5145c, 1},       -- fill color for minutes ring
        border_color = {0xFFFFFF, 1},       -- border color
        text_color   = {0xFFFFFF, 1},       -- color of numbers
        -- font settings
        -- specify the font as font:face, where face is bold, italic, bolditalic
        hour_font = "lato",  -- font face for hours
        min_font  = "lato",  -- font face for minutes
        day_font  = "lato",  -- font face for day and time period
        hour_font_size = 100,  -- font size for hours
        min_font_size  = 18,   -- font size for minutes
        day_font_size  = 24,   -- font size for day and period
}


function conky_main()
    if conky_window == nil then return end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    cr = cairo_create(cs)
    draw_clock(cr, clock_table)
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
end -- end main function

function draw_clock(cr, t)
    -- The primary function to draw the clock
    local divs = 60
    local hour = tonumber(os.date("%H"))
    local minutes = tonumber(os.date("%M"))
    local m_theta = minutes*2*math.pi/divs - math.pi/2 -- calculate the angle
    local xm = t.xc + t.R*math.cos(m_theta)
    local ym = t.yc + t.R*math.sin(m_theta)
    -- get font and font face
    local dfont, dface = splitfont(t.day_font)
    local mfont, mface = splitfont(t.min_font)
    --print(mfont,mface)
    -- calculate text extents
    if t.use12hourformat or t.showday then
         hy = getheight(hour,t.hour_font, 'normal', t.hour_font_size)
    end
    -- draw the outer ring
    if t.draw_background then
        cairo_set_source_rgba(cr, rgba_to_r_g_b_a(t.background_color))
        cairo_arc(cr, t.xc, t.yc, t.R, 0, 2*math.pi)
        cairo_fill(cr)
    end
    if t.draw_seconds then
        local seconds = tonumber(os.date("%S"))
        local s_theta = seconds*2*math.pi/divs - math.pi/2 -- calculate the angle
        cairo_set_line_width(cr, t.seconds_ring_width)
        cairo_set_source_rgba(cr, rgba_to_r_g_b_a(t.seconds_ring_base_color))
        -- draw the base ring
        cairo_arc(cr, t.xc, t.yc, t.R, 0, 2*math.pi)
        cairo_stroke(cr)
        -- draw the seconds indicator circle
        cairo_set_source_rgba(cr, rgba_to_r_g_b_a(t.seconds_ring_fill_color))
        cairo_arc(cr, t.xc, t.yc, t.R, -math.pi/2, s_theta)
        cairo_stroke(cr)
    else
        cairo_set_line_width(cr, t.border_width)
        cairo_set_source_rgba(cr, rgba_to_r_g_b_a(t.border_color))
        cairo_arc(cr, t.xc, t.yc, t.R, 0, 2*math.pi)
        cairo_stroke(cr)
    end
    -- draw the minutes ring
    cairo_set_line_width(cr, t.border_width)
    cairo_set_source_rgba(cr, rgba_to_r_g_b_a(t.fill_color))
    cairo_arc(cr, xm, ym, t.r, 0, 2*math.pi)
    cairo_fill(cr)
    cairo_set_source_rgba(cr, rgba_to_r_g_b_a(t.border_color))
    cairo_arc(cr, xm, ym, t.r, 0, 2*math.pi)
    cairo_stroke(cr)
    --
    -- text drawing
    --
    -- check the time format
    if t.use12hourformat then
        hour = tonumber(os.date("%l"))
        local ampm = os.date("%p")
        out({x=t.xc,y=t.yc+hy,f=dfont,face=dface,fs=t.day_font_size,txt=ampm,hj='c',vj='n'})
    end
    if t.showday then
        local day = os.date("%a")
        out({x=t.xc,y=t.yc-hy,f=dfont,face=dface,fs=t.day_font_size,txt=day,hj='c',vj='t'})
    end
    out({x=t.xc,y=t.yc,f=t.hour_font,fs=t.hour_font_size,txt=hour,hj='c',vj='m'})
    out({x=xm,y=ym,f=mfont,face=mface,fs=t.min_font_size,txt=minutes,hj='c',vj='m'})
end -- end draw_clock

function out(txj)--c,a,f,fs,face,x,y,txt,hj,vj,ro,sxo,syo,sfs,sface,sc,sa #
   -- Taken from mrpeachy's wun.lua
    local extents=cairo_text_extents_t:create()
    tolua.takeownership(extents)
    local function justify(jtxt,x,hj,y,vj,f,face,fs)
        if face=="normal" then
            face={f,CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL}
        elseif face=="bold" then
            face={f,CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_BOLD}
        elseif face=="italic" then
            face={f,CAIRO_FONT_SLANT_ITALIC,CAIRO_FONT_WEIGHT_NORMAL}
        elseif face=="bolditalic" then
            face={f,CAIRO_FONT_SLANT_ITALIC,CAIRO_FONT_WEIGHT_BOLD}
        else
            print ('face not set correctly - "normal","bold","italic","bolditalic"')
        end
        cairo_select_font_face (cr,face[1],face[2],face[3])
        cairo_set_font_size(cr,fs)
        cairo_text_extents(cr,jtxt,extents)
        local wx=extents.x_advance
        local wd=extents.width
        local hy=extents.height
        local bx=extents.x_bearing
        local by=extents.y_bearing+hy
        local tx=x
        local ty=y
        --set horizontal alignment - l, c, r
        if hj=="l" then
            x=x-bx
        elseif hj=="c" then
            x=x-((wx-bx)/2)-bx
        elseif hj=="r" then
            x=x-wx
        else
            print ("hj not set correctly - l, c, r")
        end
        --vj. n=normal, nb=normal-ybearing, m=middle, mb=middle-ybearing, t=top
        if vj=="n" then
            y=y
        elseif vj=="nb" then
            y=y-by
        elseif vj=="m" then
            y=y+((hy-by)/2)
        elseif vj=="mb" then
            y=y+(hy/2)-by
        elseif vj=="t" then
            y=y+hy-by
        else
            print ("vj not set correctly - n, nb, m, mb, t")
        end
        return face,fs,x,y,rad,rad2,tx,ty
    end--justify local function #########################################################
    --set variables
    local c=txj.c 			or {0xffffff, 1}
    local a=txj.a 			or 1
    local f=txj.f 			or "monospace"
    local fs=txj.fs 	    or 12
    local x=txj.x 		    or 100
    local y=txj.y 			or 100
    local txt=txj.txt 		or "text"
    local hj=txj.hj 		or "l"
    local vj=txj.vj 		or "n"
    local face=txj.face		or "normal"
    --print text ##################################################################
    local face,fs,x,y=justify(txt,x,hj,y,vj,f,face,fs)
    cairo_select_font_face (cr,face[1],face[2],face[3])
    cairo_set_font_size(cr,fs)
    cairo_move_to (cr,x,y)
    cairo_set_source_rgba (cr,rgba_to_r_g_b_a(c))
    cairo_show_text (cr,txt)
    cairo_stroke (cr)
    return nx
end--function ou

function rgba_to_r_g_b_a(tcolor)
	local color,alpha=tcolor[1],tcolor[2]
	return ((color / 0x10000) % 0x100) / 255.,
		((color / 0x100) % 0x100) / 255., (color % 0x100) / 255., alpha
end --end rgba

function getheight(txt,f,face,fs)
    -- Return the height of text. Needed for proper placement
    local extents=cairo_text_extents_t:create()
    tolua.takeownership(extents)
    if face=="normal" then
        face={f,CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL}
    elseif face=="bold" then
        face={f,CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_BOLD}
    elseif face=="italic" then
        face={f,CAIRO_FONT_SLANT_ITALIC,CAIRO_FONT_WEIGHT_NORMAL}
    elseif face=="bolditalic" then
        face={f,CAIRO_FONT_SLANT_ITALIC,CAIRO_FONT_WEIGHT_BOLD}
    else
        print ('face not set correctly - "normal","bold","italic","bolditalic"')
    end
    cairo_select_font_face (cr,face[1],face[2],face[3])
    cairo_set_font_size(cr,fs)
    cairo_text_extents(cr,txt,extents)
    return extents.height
end -- end getheight

function splitfont(s)
    -- Return font and face
    if s:find(':') then
       return s:match("([^:]+):([^:]+)")
    else
        return s, nil
    end
end -- end splitfont

conkyrc is trivial

# -- Conky settings -- #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes
short_units yes

text_buffer_size 2048
imlib_cache_size 0

use_xft yes
xftfont calibri:pixelsize=25
xftalpha .8

own_window_type desktop
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window yes
own_window_transparent yes
#own_window_argb_visual yes
own_window_colour 505050
default_color 000000
border_inner_margin 0
border_outer_margin 0

minimum_size 350 350
alignment tr

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


# -- Lua load -- #
lua_load min_clock.lua
lua_draw_hook_pre main

#at least one line (empty or not) after TEXT
TEXT

EDIT 04-Feb-2015 Updated the script. Now the font can be specified as font:fontface, where face can be bold,italic or bolditalic.

Last edited by easysid (2015-02-04 11:22:43)

Offline

Help fund CrunchBang, donate to the project!

#8175 2015-02-03 18:51:48

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Hi, i'd like to share my last collection, customized efforts.

* Wallpaper 広島の田舎2
Hiroshima countryside 2 by ど〜ら

16853713666_2247f52fc7_o.jpg

Conky Weather,
* Based on Conky-Harmattan
* Weather icons Sticker

\# Conky settings #
background yes
update_interval 1
double_buffer yes
no_buffers yes
imlib_cache_size 10

# Window specifications #
gap_x 1135
gap_y 510
minimum_size 131
maximum_width 173
own_window yes
own_window_type desktop # other options are: override/normal/desktop/panel
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
#alignment middle_middle
#own_window_argb_visual yes
#own_window_argb_value 0

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

# Text settings #
use_xft yes
xftalpha 0.8
xftfont cure:size=7
text_buffer_size 256
override_utf8_locale yes
imlib_cache_size 0

# Color scheme #
default_color E6E6E6
color1 6A3940
color2 6E5D4E
color3 4F586D
#color3 684B4C
color4 333333
color6 705751
#color6 684B4C
color5 C2C2C2
color7 E6E6E6
color8 684B4C
color9 8C95AB

TEXT
# Various images #
${if_existing /proc/net/route eth0}${execi 900 curl -s "http://weather.yahooapis.com/forecastrss?w=44418&u=c" -o ~/.cache/weather.xml}
\
# The name of the days #
\
${color3}${voffset -9}${execi 900 grep "yweather:astronomy" ~/.cache/weather.xml | grep -o "sunrise=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
${color3}${voffset -9}${goto 58}WIND${color}
${color3}${voffset -9}${goto 112}HUM${color}
\
# The temperatures #
\
${color3}${voffset 40}${execi 900 grep "yweather:astronomy" ~/.cache/weather.xml | grep -o "sunset=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
${voffset -9}${color3}${alignc -3}${execi 900 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
${voffset -9}${color3}${goto 113}${execi 900 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}%${color}
\
# The icons of the forecast and condition #
\
${image ~/.conky/conky-weather/icons/32.png -p 1,12 -s 32x32}\
${image ~/.conky/conky-weather/icons/23.png -p 52,12 -s 32x32}\
${image ~/.conky/conky-weather/icons/3200.png -p 100,12 -s 32x32}\
${color9}${hr 0}${color}
${color6}${voffset 5}${goto 23}${alignc}Last fetch${execi 900 grep "lastBuildDate" ~/.cache/weather.xml | cut -c 32-40}${color}
${color9}${hr 0}${color}
# Various images #
${execi 900 curl -s "http://weather.yahooapis.com/forecastrss?w=44418&u=c" -o ~/.cache/weather.xml}
\
# The name of the days #
\
${color3}${voffset -5}${goto 6}Now
${color3}${voffset -9}${goto 52}Later${color}
${color3}${voffset -9}${goto 98}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +1days +%d}${color}
\
# The temperatures #
\
${color2}${voffset 40}${alignc 50}${font Droid Sans:bold:size=7}${execi 900 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} °C${color}${font}
${voffset -9}${color4}${goto 51}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color2}/ ${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${voffset -9}${color4}${goto 101}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color2}/ ${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
\
# The icons of the forecast and condition #
\
${execi 900 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather.png}${image ~/.cache/weather.png -p 1,106 -s 32x32}\
${execi 900 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 51,106 -s 32x32}\
${execi 900 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 100,106 -s 32x32}\
${color5}${hr 0}${color}
# Various images #
${execi 900 curl -s "http://weather.yahooapis.com/forecastrss?w=44418&u=c" -o ~/.cache/weather.xml}
\
# The name of the days #
\
${color3}${voffset -5}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +2days +%d}${color}
${color3}${voffset -9}${goto 51}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +3days +%d}${color}
${color3}${voffset -9}${goto 96}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +4days +%d}${color}
\
# The temperatures #
\
${color4}${voffset 40}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color2}/ ${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
${voffset -9}${color4}${goto 51}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${color2}/ ${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${color}
${voffset -9}${color4}${goto 101}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°${color2}/ ${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°${color}
\
# The icons of the forecast and condition #
\
${execi 900 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 1,178 -s 32x32}\
${execi 900 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/weather-4.png}${image ~/.cache/weather-4.png -p 51,178 -s 32x32}\
${execi 900 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/weather-5.png}${image ~/.cache/weather-5.png -p 100,178 -s 32x32}\
${color5}${hr 0}${color}
# Various images #
${execi 900 curl -s "http://weather.yahooapis.com/forecastrss?w=44418&u=c" -o ~/.cache/weather.xml}
\
# The name of the days #
\
${color3}${voffset -5}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +5days +%d}${color}
${color3}${voffset -9}${goto 51}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +6days +%d}${color}
${color3}${voffset -9}${goto 96}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +7days +%d}${color}
\
# The temperatures #
\
${color4}${voffset 40}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}°${color2}/ ${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}°${color}
${voffset -9}${color4}${goto 51}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}°${color2}/ ${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}°${color}
${voffset -9}${color4}${goto 101}${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}°${color2}/ ${execi 900 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}°${color}
\
# The icons of the forecast and condition #
\
${execi 900 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6').png ~/.cache/weather-6.png}${image ~/.cache/weather-6.png -p 1,249 -s 32x32}\
${execi 900 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7').png ~/.cache/weather-7.png}${image ~/.cache/weather-7.png -p 51,249 -s 32x32}\
${execi 900 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8').png ~/.cache/weather-8.png}${image ~/.cache/weather-8.png -p 100,249 -s 32x32}${else}${endif}\

${color3}Top 8 Proc Usage $running_processes/$processes${hr 0}
${color8}NAME ${goto 83}CPU ${goto 112}MEM
${font DejaVu Sans Mono:bold:size=5}${color1}1. ${top name 1}${top cpu 1} ${top mem 1}${font}
${font DejaVu Sans Mono:size=5}${color4}2. ${top name 2}${top cpu 2} ${top mem 2}${font}
${font DejaVu Sans Mono:size=5}${color4}3. ${top name 3}${top cpu 3} ${top mem 3}${font}
${font DejaVu Sans Mono:size=5}${color4}4. ${top name 4}${top cpu 4} ${top mem 4}${font}
${font DejaVu Sans Mono:size=5}${color4}5. ${top name 5}${top cpu 5} ${top mem 5}${font}
${font DejaVu Sans Mono:size=5}${color4}6. ${top name 6}${top cpu 6} ${top mem 6}${font}
${font DejaVu Sans Mono:size=5}${color4}7. ${top name 7}${top cpu 7} ${top mem 7}${font}
${font DejaVu Sans Mono:size=5}${color4}8. ${top name 8}${top cpu 8} ${top mem 8}${font}
${font cure:size=7}${color3}Top 8 Mem Usage ${hr 0}
${color8}NAME ${goto 83}CPU ${goto 112}MEM${font}
${font DejaVu Sans Mono:bold:size=5}${color1}1. ${top_mem name 1}${top_mem cpu 1} ${top_mem mem 1}${font}
${font DejaVu Sans Mono:size=5}${color4}2. ${top_mem name 2}${top_mem cpu 2} ${top_mem mem 2}${font}
${font DejaVu Sans Mono:size=5}${color4}3. ${top_mem name 3}${top_mem cpu 3} ${top_mem mem 3}${font}
${font DejaVu Sans Mono:size=5}${color4}4. ${top_mem name 4}${top_mem cpu 4} ${top_mem mem 4}${font}
${font DejaVu Sans Mono:size=5}${color4}5. ${top_mem name 5}${top_mem cpu 5} ${top_mem mem 5}${font}
${font DejaVu Sans Mono:size=5}${color4}6. ${top_mem name 6}${top_mem cpu 6} ${top_mem mem 6}${font}
${font DejaVu Sans Mono:size=5}${color4}7. ${top_mem name 7}${top_mem cpu 7} ${top_mem mem 7}${font}
${font DejaVu Sans Mono:size=5}${color4}8. ${top_mem name 8}${top_mem cpu 8} ${top_mem mem 8}${font}
\
# end of code #
\

* Cheese scrot (put on your "/usr/bin/") make it executable and rename whatever you want. I call it just "shot".
P.S. i use Feh for image viewer, you can rename according to your img application.

#!/bin/bash

echo -e '\e[1;31m' 
echo "        ┌───────────────────────────────────┐"
echo "        │   Taking Screenshot. Say Cheese!  │ "
echo "        └───────────────────────────────────┘"
echo "       ╱"
echo "   ▀▄   ▄▀"
echo -e "  ▄█▀███▀█▄ "
echo -e " █▀███████▀█"
echo -e " ▀ ▀▄▄ ▄▄▀ ▀"
echo -e '\e[1;37m'

scrot -cd 5 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/scrot/ & feh -F ~/images/scrot/$f'

.Xdefaults / rxvt-unicode color outputs taken from one of dotshare (can't remember now) sorry.

! Xft settings ---------------------------------------------------------------

Xft.dpi:        96
Xft.antialias:  false
Xft.rgba:       rgb
Xft.hinting:    true
Xft.hintstyle:  full

!-------------------------------------------------------------------------------
!
!	U R X V T - Settings
!
!-------------------------------------------------------------------------------

URxvt*geometry:					170x40
URxvt*borderLess:				false
URxvt*scrollBar_right:		    true
URxvt*cursorBlink:				true
URxvt*cursorUnderline:			true
URxvt*scrollColor:				#111111
URxvt.perl-ext-common:  default,matcher,tabbed
URxvt.scrollBar:				off
URxvt*iconFile:                 /home/nili/.icons/term.png
URxvt.tabbed.tabbar-fg:			2
URxvt.tabbed.tabbar-bg: 		-1
URxvt.tabbed.tab-fg:    		10
URxvt.tabbed.tab-bg:    		-1
URxvt.urlLauncher:      /usr/bin/firefox
URxvt.matcher.button:   1
URxvt*saveLines:    1000
URxvt*internalBorder:   0
URxvt*externalBorder:   0 
Rxvt*boldMode: false
URxvt.font:xft:lime:size=7
URxvt.boldFont:xft:lime:size=7

urxvt*transparent: true
urxvt*shading: 15

!---------------------------------------------------------------------------------
!
!	U R X V T - Colors
!
!---------------------------------------------------------------------------------

*.cursorColor:#c0b18b
*.colorBD:    #c0b18b
*.colorUL:    #c0b18b
*.colorIT:    #c0b18b

*background:        #191716
*foreground:        #A8A48C

!black
*color0:    #0f0e0d
*color8:    #383332

!red
*color1:    #845336
*color9:    #8c4f4a

!green
*color2:    #57553c
*color10:   #898471

!yellow
*color3:    #a17e3e
*color11:   #c8b491

!blue
*color4:    #43454f
*color12:   #65788f

!magenta
*color5:    #604848
*color13:   #755e4a

!cyan
*color6:    #5c6652
*color14:   #718062

!white
*color7:    #a18b62
*color15:   #bc9d66

Last edited by Nili (2015-03-21 06:43:21)


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

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