SEARCH

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

You are not logged in.

#5801 2013-07-22 18:30:42

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

Re: Conky v1.9 Thread

Crinos512 wrote:
Sector11 wrote:
Crinos512 wrote:

OK, July spans 5 weeks, does he want it in 2 columns, or 14 rows?

And yes, you are dead on with the coloring for the current date.  big_smile

14 rows ...   big_smile

dead on!  heheheheh that came from someone else ... but the "idea" is the same.

Will be interesting implementing that color command in a multi-line bash script.
I'll play til I break it.  big_smile

OK, The following gives you 14 columns regardless.

ncal | sed -e 's/     /  --  /g' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' &&  ncal | sed -e 's/     /  --  /g' | awk  '{if (length($3)==1) { $3 = "0"  $3 ; }print $1, $3, $5, $7}' |tail -n7

OHHHHHHHHHHHH that's GREAT!!!!!!!!!!!!!!

You just won a big bag of cookies and a large coffee!

Thank you!

Off to play ...  ]:D


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

Offline

Help fund CrunchBang, donate to the project!

#5802 2013-07-22 19:11:55

hebangs
#! CrunchBanger
Registered: 2013-06-05
Posts: 107

Re: Conky v1.9 Thread

Sector11 wrote:
hebangs wrote:

i've removed the ${voffset -1} or added ${voffset -1} to the beginning and at the end, still didnt work.

I retested your code after installing your "bauhaus" font, and adding the "cal.C512.sh" I'm looking at under it and added a ${voffset -160} to cover the calendar.

PackRat's right make sure you don't have an extra line at the end.

Debian SID - OpenBox & compton

With ${voffset -160}
http://s20.postimg.org/wpwamdyfd/2013_07_22_15_16_04_1920x1080_Sector11.jpg

Without ${voffset -160}
http://s20.postimg.org/5gkx7vxc9/2013_07_22_15_16_40_1920x1080_Sector11.jpg

how stupid was i.. it did infact have extra empty lines at the bottom..meh.. im sorry for wasting you guys time.
thanks guys. appreciate it smile

Offline

#5803 2013-07-22 19:23:51

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

Re: Conky v1.9 Thread

hebangs wrote:

how stupid was i.. it did infact have extra empty lines at the bottom..meh.. im sorry for wasting you guys time.
thanks guys. appreciate it smile

Not a waste of time at all ...
Did you still use a small ${voffset -xx} at the beginning and end of the line?


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

Offline

#5804 2013-07-22 19:36:40

Crinos512
Member
Registered: 2013-07-22
Posts: 14

Re: Conky v1.9 Thread

ok, one more drop...  O:)

ncal | sed -e 's/     /  --  /g' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; } print $1, $2, $4, $6}' | tail -n7 && ncal | sed -e 's/     /  --  /g' | awk  '{{if (length($3)==1) { $3 = "0"  $3 ; }{if (length($7)<1) { $7 = "--"  $7 ; }}} print $1, $3, $5, $7}' | tail -n7
 

Produces

Su -- 14 28
Mo 01 15 29
Tu 02 16 30
We 03 17 31
Th 04 18 --
Fr 05 19 --
Sa 06 20 --
Su 07 21 --
Mo 08 22 --
Tu 09 23 --
We 10 24 --
Th 11 25 --
Fr 12 26 --
Sa 13 27 --

Remember you have 2 SED commands to do the coloration on.... each controls 7 rows.

Offline

#5805 2013-07-22 19:56:26

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

Re: Conky v1.9 Thread

@ Crinos512 ...

OK here comes the Debian DOH! Boy (pun intended - sorry Pillsbury) - maybe I should change my name.   lol

I tried the new stuff ... AWESOME ... now the colour ... and I hit a brick wall.

ncal -h turns off ncal's marking today so I tried what I have in the other calendar. ... and I missed:
2013_07_22_16_36_05_1920x1080_Sector11.jpg

three lines in the conky file (xftfont monofur:bold:size=11)

TEXT
    ${time %b}
${execi 1 /media/5/Conky/scripts/cal.C512.sh}
    ${time %Y}

cal.C512.sh

#!/bin/bash
# Crinos512 - 22 July 2013
# /media/5/Conky/scripts/cal.C512.sh

#ncal -h | sed -e 's/     /  ··  /g' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' |tail -n7
#ncal -h | sed -e 's/     /  ··  /g' | awk  '{if (length($3)==1) { $3 = "0"  $3 ; }print $1, $3, $5, $7}' |tail -n7

LAR=`date +%-d`; ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' |tail -n7
LAR=`date +%-d`; ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($3)==1) { $3 = "0"  $3 ; }print $1, $3, $5, $7}' |tail -n7

I'm on the doorstep, but I just can't open the door!  sad

DOH!!!!!!!!!!!  I see it ... I see it ... I see it ...

${execi 1 /media/5/Conky/scripts/cal.C512.sh}
${execPi 1 /media/5/Conky/scripts/cal.C512.sh}

2013_07_22_16_51_56_1920x1080_Sector11.jpg

Change that execpi to a bigger number and we're cookin'

THANK YOU! Crinos512


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

Offline

#5806 2013-07-22 20:08:41

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

Re: Conky v1.9 Thread

Crinos512 wrote:

ok, one more drop...  O:)

ncal | sed -e 's/     /  --  /g' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; } print $1, $2, $4, $6}' | tail -n7 && ncal | sed -e 's/     /  --  /g' | awk  '{{if (length($3)==1) { $3 = "0"  $3 ; }{if (length($7)<1) { $7 = "--"  $7 ; }}} print $1, $3, $5, $7}' | tail -n7
 

Produces

Su -- 14 28
Mo 01 15 29
Tu 02 16 30
We 03 17 31
Th 04 18 --
Fr 05 19 --
Sa 06 20 --
Su 07 21 --
Mo 08 22 --
Tu 09 23 --
We 10 24 --
Th 11 25 --
Fr 12 26 --
Sa 13 27 --

Remember you have 2 SED commands to do the coloration on.... each controls 7 rows.

Caught the two SED commands ... and was going to ask about the  extra "--"  I changed them to "··" because I can.  big_smile

the new cal.C512.sh:

#!/bin/bash
# Crinos512 - 22 July 2013
# /media/5/Conky/scripts/cal.C512.sh

#ncal -h | sed -e 's/     /  ··  /g' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' |tail -n7
#ncal -h | sed -e 's/     /  ··  /g' | awk  '{if (length($3)==1) { $3 = "0"  $3 ; }print $1, $3, $5, $7}' |tail -n7

#LAR=`date +%-d`; ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' |tail -n7
#LAR=`date +%-d`; ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($3)==1) { $3 = "0"  $3 ; }print $1, $3, $5, $7}' |tail -n7


LAR=`date +%-d`; ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; } print $1, $2, $4, $6}' | tail -n7
LAR=`date +%-d`; ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{{if (length($3)==1) { $3 = "0"  $3 ; }{if (length($7)<1) { $7 = "··"  $7 ; }}} print $1, $3, $5, $7}' | tail -n7

The new conky lines:

TEXT
    ${color6}${time %b}${color}
${execpi 7200 /media/5/Conky/scripts/cal.C512.sh}
    ${color6}${time %Y}${color}

The new image:
2013_07_22_17_04_03_260x325_Sector11.jpg

I'm sure when Inodoro Pereyra gets home from work and sees this he'll be here to thank you as well.

Awesome ... just awesome work, Thank you again!
One more bash script to put with my Crinos512 collection.

Last edited by Sector11 (2013-07-22 20:09:33)


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

Offline

#5807 2013-07-22 20:10:08

Crinos512
Member
Registered: 2013-07-22
Posts: 14

Re: Conky v1.9 Thread

You only need LAR defined once.

#!/bin/bash
# Crinos512 - 22 July 2013
# /media/5/Conky/scripts/cal.C512.sh
LAR=`date +%d`

ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' | tail -n7
ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{{if (length($3)==1) { $3 = "0"  $3 ; }{if (length($7)<1) { $7 = "--"  $7 ; }}} print $1, $3, $5, $7}' | tail -n7

Last edited by Crinos512 (2013-07-22 20:10:33)

Offline

#5808 2013-07-22 20:14:01

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

Re: Conky v1.9 Thread

Crinos512 wrote:

You only need LAR defined once.

#!/bin/bash
# Crinos512 - 22 July 2013
# /media/5/Conky/scripts/cal.C512.sh
LAR=`date +%d`

ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' | tail -n7
ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{{if (length($3)==1) { $3 = "0"  $3 ; }{if (length($7)<1) { $7 = "--"  $7 ; }}} print $1, $3, $5, $7}' | tail -n7

Ohhhhh!  Great!  another edit ... learned a lot today!  Been a good day!


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

Offline

#5809 2013-07-22 20:34:41

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

Re: Conky v1.9 Thread

New addition:

TEXT
${alignc}${time %T}
    ${color6}${time %b}${color}
${execpi 7200 /media/5/Conky/scripts/cal.C512.sh}
    ${color6}${time %Y}${color}
${alignc}${uptime_short}

Matches his eyes!
2013_07_22_17_32_06_1920x1080_Sector11.jpg


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

Offline

#5810 2013-07-22 22:57:23

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

Re: Conky v1.9 Thread

Thank you Crinos512, a million times thank you! I can't tell you how much I appreciate you taking the time to register to the forum, to help me out with this! big_smile

Your 2 week calendar is working beautifully. It was the last part of a project I've been working on for the past 2 weeks, that I think could be useful for those that, like me, are absolutely NOT conky addicts. Now I'm about to start a thread about it.

And, Sector11, there's no way I could possibly thank you enough for all your help, and for sharing all the knowledge you DON'T HAVE with me. No wonder they know you as "The Conkystador"...
Oops... Did I just say that? 8)  O:)

Offline

#5811 2013-07-22 23:25:30

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

Re: Conky v1.9 Thread

Inodoro Pereyra wrote:

And, Sector11, there's no way I could possibly thank you enough for all your help, and for sharing all the knowledge you DON'T HAVE with me. No wonder they know you as "The Conkystador"...
Oops... Did I just say that? 8)  O:)

LIES!  All lies ... malicious rumours!

A scrot here or is didn't happen  big_smile

EDIT:  Excuse me, what's this:

those that, like me, are absolutely NOT conky addicts

... who are you trying to kid?

Last edited by Sector11 (2013-07-22 23:29:03)


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

Offline

#5812 2013-07-23 00:08:40

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

Re: Conky v1.9 Thread

Ok, first, a disclaimer: as far as *I* know, this system has never been tried before. But remember that 2 months ago I barely had a clue what conky was for. So, if somebody has thought of it before, feel free to let me know here, and accept my apologies. smile

Now, credits. First and foremost, I still wouldn't have a clue about conky if it wasn't because, a couple of months ago, I came across the ultimate conky encyclopedia. For those that would like to have access to an enormous amount of conky knowledge, explained in such a simple way that even I understood it, you can find that encyclopedia online. It's name is Sector11.
But, since I happen to be a very lucky guy, not only I came across Sector11 online, but he also happens to live, of all places, in MY city, less than an hour bus trip from me. I can't wait to get to know him personally. cool
Then, Crinos512. Not many people register to a forum just to help a guy they don't even know. All my respect to him.
And finally, to all those who have helped me out over the last 2 months. I've been a member of dozens of forums, on several different topics. You guys are the best.

I'm not  a conky expert by any means, but if at some point I look like one, it's only because of all your help. Thank you all.  big_smile

Now, here's the sh......tuff.

About 2 weeks ago, after a lot of work, (and getting a whole lot of help), I finally got this conky:

Screenshot_07072013_12_12_56_PM.jpg

And I was (and still am) very proud of it.
However, something was bugging me: among those 5 conkys, I was running almost 40 copies of Londonali's draw_bg.lua, and that could be felt in terms of cpu usage (check the avg. cpu graph on the screenshot)
So I set up to lower my cpu usage. I would've been happy to get it down to 9 to 10%, instead of the 11-13% I was at.

So this is what I came up with: Instead of using individual .lua scripts for each conky, and using .lua copies for the graphics (or for some of them), why not make a full screen "background conky", containing the bg.lua(s), and everything else that may be needed in the background (like .png's, for example), and then lay all the other conkys on top of it?

The way I saw it, that'd have several advantages:

1. It would cut down on the repetition, and save resources.
2. It'd be easier at the time of laying everything out, since you could lay out the background graphics directly on the conky, and move them around freely with the whole screen available to you.
3. For the same reason, it'd be much easier to modify your conky setup.
4. There wouldn't be any issues with shadows, overlapping backgrounds, etc, that normally tend to appear with individual conkys.

And I'm sure there are other advantages that you guys, being much more knowledgeable than I am, may have already figured out.

So I ended up with this:

Screenshot_07222013_07_36_43_PM.jpg

It is very graphic heavy, because I wanted to make a point. All the graphics you see are lay down on a full screen "background.conky". That background conky MUST comply with 2 NON NEGOTIABLE requisites:

1. Window_type MUST be "desktop". Otherwise, you run the risk of it laying on top of the other conkys, covering them up.
2. Argb visuals MUST be disabled, or else your graphics will look washed out.

Then you can lay your conkys on top of it (they, of course, must be transparent (argb enabled, argb value "0"), and window_type "normal". And NO draw_bg.lua scripts. And, to finish it, cover it all with a full screen, "normal" type, transparent "foreground.conky", to make sure the whole screen is right-click enabled.

So I tried it. Everything worked out perfectly. Editing it is a breeze, and take a look at the cpu usage (in the space shuttle databus, bottom left, about half screen)...  (And, for the record, now I'm running 8 conkys, while on the screenshot at the top I was running 5) cool

So... here's MY background.conky:

# killall conky && conky -c /home/bernardo/.new_conky/background.conky &
# Full screen background for all conkys to lay on.
			##  Begin Window Settings  ##
own_window yes
own_window_type desktop  ## Window type MUST be "desktop".
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 000000
own_window_class Conky
own_window_title Background
## own_window_argb_visual yes
## own_window_argb_value 0

double_buffer yes

minimum_size 1366 768 ## width, height
maximum_width 1366  ## width

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

alignment top_left

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

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

uppercase no

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

draw_outline yes # amplifies text if yes
default_outline_color black

default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 0000CD #  0 191 255	Medium blue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 FF0000 #255   0   0	RED

			##  End Color Settings  ##
			##  Borders Section  ##
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
			##  End Borders Secton  ##
			##  Miscellaneous Section  ##

background yes

use_spacer none

text_buffer_size 1024

imlib_cache_size 0

no_buffers yes

short_units no

pad_percents 2

			##  End Miscellaneous Section  ##
			##  LUA Settings  ##
lua_load ~/.conky/System_conky/draw_bg.lua

			##  End LUA Settings  ##
# The all important - How often conky refreshes.
update_interval 10

TEXT
${lua conky_draw_bg 0 0 0 0 0 0x000000 0.2}

${image $HOME/images/Bomber_gauges/weather_comp.png -p 5,0 -s 492x320} ## BsAs weather
${image $HOME/images/Bomber_gauges/weather_comp.png -p 505,0 -s 492x320} ## Miami weather
${image $HOME/images/Bomber_gauges/cpu_gauge.png -p 1010,0 -s 150x150} ## gauge tl
${image $HOME/images/Bomber_gauges/cpu_gauge.png -p 1180,0 -s 150x150} ## gauge tr
${image $HOME/images/Bomber_gauges/led_display.png -p 1022,155 -s 122x60} ## led l
${image $HOME/images/Bomber_gauges/led_display.png -p 1192,155 -s 122x60} ## led r
${image $HOME/images/Bomber_gauges/cpu_gauge.png -p 1010,220 -s 150x150} ## gauge bl
${image $HOME/images/Bomber_gauges/cpu_gauge.png -p 1180,220 -s 150x150} ## gauge br
${image $HOME/images/Bomber_gauges/databusscreenshot2.png -p 5,325 -s 305x428} ## shuttle databus
${image $HOME/images/Bomber_gauges/Radar_clock.png -p 840,395 -s 492x360} ## radar
${image $HOME/images/Bomber_gauges/air_computer_2.png -p 330,325 -s 500x423} ## mfd center bottom

...and my foreground.conky (a.k.a "a whole lot of nothin'):

# killall conky && conky -c /home/bernardo/.new_conky/foreground.conky &
# Full screen background for all conkys to lay on.
			##  Begin Window Settings  ##
own_window yes
own_window_type normal  ## Window type MUST be "normal" to get right click capacity.
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 000000
own_window_class Conky
own_window_title Background
own_window_argb_visual yes
own_window_argb_value 0

double_buffer yes

minimum_size 1366 768 ## width, height
maximum_width 1366  ## width

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

alignment top_left

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

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

uppercase no

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

draw_outline yes # amplifies text if yes
default_outline_color black

default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 0000CD #  0 191 255	Medium blue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 FF0000 #255   0   0	RED

			##  End Color Settings  ##
			##  Borders Section  ##
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
			##  End Borders Secton  ##
			##  Miscellaneous Section  ##

background yes

use_spacer none

text_buffer_size 1024

imlib_cache_size 0

no_buffers yes

short_units no

pad_percents 2

			##  End Miscellaneous Section  ##
		
# The all important - How often conky refreshes.
update_interval 10

TEXT

So... what do you guys think?  smile

Last edited by Inodoro Pereyra (2013-07-23 00:40:56)

Offline

#5813 2013-07-23 02:07:29

Crinos512
Member
Registered: 2013-07-22
Posts: 14

Re: Conky v1.9 Thread

Very Nice!
riker-slow-clap.gif

Now... just because I am that way, PLEASE update the calender script to this:

#!/bin/bash
# Crinos512 - 22 July 2013
# /media/5/Conky/scripts/cal.C512.sh
LAR=`date +%d`

ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' | tail -n7
ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{{if (length($3)==1) { $3 = "0"  $3 ; }{if (length($7)<1) { $7 = "--"  $7 ; }}} print $1, $3, $5, $7}' | tail -n7

...

Inodoro Pereyra wrote:

Then, Crinos512. Not many people register to a forum just to help a guy they don't even know. All my respect to him.

:8  You are very welcome, I'm glad I could help.

Offline

#5814 2013-07-23 02:48:56

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

Re: Conky v1.9 Thread

Inodoro Pereyra wrote:

So... what do you guys think?  smile

So that was the big secret you were up to.

Pretty rough trying to help a guy what won't tell you what he's doing, but in the end you did do it!

That is awesome!  And only 5% CPU usage ... very very impressive!

I agree with Crinos512 and Riker!

Honest folks ... other than the calendar that I enlisted the aid of Crinos512 - I had no idea ... well, that's not true ... I "guessed" the full screen conky background thing, but what surprise!

KUDOS Inodoro Pereyra

PS: use the latest calendar script.  Even up those dots!  big_smile

EDIT: Now we need to have a coffee!  big_smile

Last edited by Sector11 (2013-07-23 02:50:48)


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

Offline

#5815 2013-07-23 14:35:03

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

Crinos512 wrote:

Now... just because I am that way, PLEASE update the calender script to this:

#!/bin/bash
# Crinos512 - 22 July 2013
# /media/5/Conky/scripts/cal.C512.sh
LAR=`date +%d`

ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' | tail -n7
ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{{if (length($3)==1) { $3 = "0"  $3 ; }{if (length($7)<1) { $7 = "--"  $7 ; }}} print $1, $3, $5, $7}' | tail -n7

Interesting problem was there yesterday... but 2 ncal's, 2 awk's, 4 sed's and tail?
One GAWK to rule them all:

#!/usr/bin/gawk -f

#####################################################################
#                                                                   #
# ncal.awk script by dk75                                           #
#                                                                   #
# usage:                                                            #
# ncal -h | ncal.awk             - if Sunday is a first day of      #
#                                  the week                         #
# ncal -h | ncal.awk monday=TRUE - if Monday is a first day of      #
#                                  the week                         #
#                                                                   #
#####################################################################

BEGIN	\
{
	weekend[1]=7
	weekend[2]=1
	
	if ( ARGV[1]=="monday=TRUE" )
	{
		weekend[1]=6
		weekend[2]=7
	}
	
	today=strftime("%02d")
}

NR==1	\
{
	month=$1
	year=$2
}

NR>1	\
{
	gsub(/ {4}/," 0 ", $0)
	days[NR-1,1]=$1
	days[NR-1,2]=$2
	days[NR-1,3]=$3
	days[NR-1,4]=$4
	days[NR-1,5]=$5
	days[NR-1,6]=$6
	days[NR-1,7]=$7
}

END	\
{
	#############################################################
	# preparing and formatting data                              #
	#############################################################
	for ( i=1; i<=7; i++ )
	{
		for ( j=2; j<=7; j++ )
		{
			days[i,j]=sprintf("%02d", days[i,j])
			
			if ( days[i,j]=="00" )
				days[i,j]=".."
				
			if ( days[i,j]==today )
				days[i,j]="${color0}"days[i,j]"${color}"
			else
				days[i,j]="${color2}"days[i,j]"${color}"
		}
		
		if ( i==weekend[1] )
			days[i,1]="${color6}"days[i,1]"${color}"
		else if ( i==weekend[2] )
			days[i,1]="${color7}"days[i,1]"${color}"
		else
			days[i,1]="${color1}"days[i,1]"${color}"
	}
	# ###########################################################
	
	#############################################################
	# displaying data                                           #
	#############################################################
	print "${goto 25}${color3}"month"${color}"
	
	for ( j=0; j<=1; j++ )
	{
		for ( i=1; i<=7; i++ )
		{
			printf "%s %s %s %s\n", days[i,1], days[i,2+j], days[i,4+j], days[i,6+j]
		}
	}
	
	print "${goto 32}${color4}"year"${color}"
}

usage:

TEXT
${execpi 3600 ncal -h | $HOME/.conky/conkyparts/ncal.awk monday=TRUE}

result:
abnAjQea.png

Last edited by dk75 (2013-07-23 14:57:06)


Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

#5816 2013-07-23 16:45:02

Crinos512
Member
Registered: 2013-07-22
Posts: 14

Re: Conky v1.9 Thread

dk75 wrote:

Interesting problem was there yesterday... but 2 ncal's, 2 awk's, 4 sed's and tail?
One GAWK to rule them all

Hmmm, interesting... I've never coded in AWK like that before... but trading a 3 line bash script (excluding comments and whitespace), for that huge awk script? Let's look at performance, shall we?

crinos@Fortress:~$ time ./cal.C512.sh 
Su ·· 14 28
Mo 01 15 29
Tu 02 16 30
We 03 17 31
Th 04 18 ··
Fr 05 19 ··
Sa 06 20 ··
Su 07 21 ··
Mo 08 22 ··
Tu 09 ${color6}23${color} ··
We 10 24 ··
Th 11 25 ··
Fr 12 26 ··
Sa 13 27 ··


real    0m0.013s
user    0m0.004s
sys     0m0.000s
crinos@Fortress:~$ time ncal -h | ./ncal.awk 
${goto 25}${color3}July${color}
${color7}Su${color} ${color2}..${color} ${color2}14${color} ${color2}28${color}
${color1}Mo${color} ${color2}01${color} ${color2}15${color} ${color2}29${color}
${color1}Tu${color} ${color2}02${color} ${color2}16${color} ${color2}30${color}
${color1}We${color} ${color2}03${color} ${color2}17${color} ${color2}31${color}
${color1}Th${color} ${color2}04${color} ${color2}18${color} ${color2}..${color}
${color1}Fr${color} ${color2}05${color} ${color2}19${color} ${color2}..${color}
${color6}Sa${color} ${color2}06${color} ${color2}20${color} ${color2}..${color}
${color7}Su${color} ${color2}07${color} ${color2}21${color} ${color2}..${color}
${color1}Mo${color} ${color2}08${color} ${color2}22${color} ${color2}..${color}
${color1}Tu${color} ${color2}09${color} ${color0}23${color} ${color2}..${color}
${color1}We${color} ${color2}10${color} ${color2}24${color} ${color2}..${color}
${color1}Th${color} ${color2}11${color} ${color2}25${color} ${color2}..${color}
${color1}Fr${color} ${color2}12${color} ${color2}26${color} ${color2}..${color}
${color6}Sa${color} ${color2}13${color} ${color2}27${color} ${color2}..${color}
${goto 32}${color4}2013${color}

real    0m0.003s
user    0m0.000s
sys     0m0.004s

Holy smokes! I realized I had run the wrong script for the GAWK one when I saw all the coloration dk75 does... That's Tons of stuff, done Blazing fast!

I tip my hat to you sirah.

Last edited by Crinos512 (2013-07-23 17:10:37)

Offline

#5817 2013-07-23 17:03:59

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

Re: Conky v1.9 Thread

dk75 wrote:

Interesting problem was there yesterday... but 2 ncal's, 2 awk's, 4 sed's and tail?
One GAWK to rule them all:

NICE!  A bit more complicated ... but very nice indeed.

EDIT! 8) did you see it?  Look again! 8)

My times:

 23 Jul 13 | 14:14:33 /media/5/Conky/scripts
    $ time ./cal.C512.sh 
Su ·· 14 28
Mo 01 15 29
Tu 02 16 30
We 03 17 31
Th 04 18 ··
Fr 05 19 ··
Sa 06 20 ··
Su 07 21 ··
Mo 08 22 ··
Tu 09 ${color6}23${color} ··
We 10 24 ··
Th 11 25 ··
Fr 12 26 ··
Sa 13 27 ··

real	0m0.010s
user	0m0.000s
sys	0m0.000s
 
 23 Jul 13 | 14:15:05 /media/5/Conky/scripts
    $ 
 23 Jul 13 | 14:14:46 /media/5/Conky/scripts
    $ time ncal -h | ./ncal.awk 
${goto 25}${color3}July${color}
${color7}Su${color} ${color2}..${color} ${color2}14${color} ${color2}28${color}
${color1}Mo${color} ${color2}01${color} ${color2}15${color} ${color2}29${color}
${color1}Tu${color} ${color2}02${color} ${color2}16${color} ${color2}30${color}
${color1}We${color} ${color2}03${color} ${color2}17${color} ${color2}31${color}
${color1}Th${color} ${color2}04${color} ${color2}18${color} ${color2}..${color}
${color1}Fr${color} ${color2}05${color} ${color2}19${color} ${color2}..${color}
${color6}Sa${color} ${color2}06${color} ${color2}20${color} ${color2}..${color}
${color7}Su${color} ${color2}07${color} ${color2}21${color} ${color2}..${color}
${color1}Mo${color} ${color2}08${color} ${color2}22${color} ${color2}..${color}
${color1}Tu${color} ${color2}09${color} ${color0}23${color} ${color2}..${color}
${color1}We${color} ${color2}10${color} ${color2}24${color} ${color2}..${color}
${color1}Th${color} ${color2}11${color} ${color2}25${color} ${color2}..${color}
${color1}Fr${color} ${color2}12${color} ${color2}26${color} ${color2}..${color}
${color6}Sa${color} ${color2}13${color} ${color2}27${color} ${color2}..${color}
${goto 32}${color4}2013${color}

real	0m0.003s
user	0m0.000s
sys	0m0.000s
 
 23 Jul 13 | 14:15:23 /media/5/Conky/scripts
    $ 

How can so much code be so fast?

Last edited by Sector11 (2013-07-23 17:25:47)


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

Offline

#5818 2013-07-23 17:50:34

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

Re: Conky v1.9 Thread

OK here's one for you dk75 ... can you GAWK, AWK, MAWK this:

${goto 20}SU MO ${color6}${time %b %Y}${color} FR SA
${goto 20}${color}${execpi 7200 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | sed ':a;N;$!ba;s/\n/\n${goto 20}/g'}${color}

2013_07_23_14_37_21_199x131_Sector11.jpg

The leading and ending ${color} commands on the second line look useless but in fact in combination with the colour commands "in" the script control the start days, today and end days of the calendar.

${goto 20}SU MO ${color6}${time %b %Y}${color} FR SA
${goto 20}${color3}${execpi 7200 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 20}/g'}${color}

2013_07_23_14_47_30_198x139_Sector11.jpg
The last one can be eliminated and added to the next line in the conky but I happen to use it there.


EDIT:
Where does ncal.awk control the month names?
It's using long names and September is longer than July so:

print "${goto 25}${color3}"month"${color}"

will need to be changed month to month.

${alignc} works if the conky is only as wide as the calendar, however I would like the short form ... always 3 characters.

coloured day names is a nice bonus as well.
2013_07_23_15_18_27_1920x1080_Sector11.jpg

Last edited by Sector11 (2013-07-23 18:21:01)


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

Offline

#5819 2013-07-23 18:20:36

Crinos512
Member
Registered: 2013-07-22
Posts: 14

Re: Conky v1.9 Thread

Sector11 wrote:

Where does ncal.awk control the month names?
It's using long names and September is longer than July so:

print "${goto 25}${color3}"month"${color}"

will need to be changed month to month.

${alignc} works if the conky is only as wide as the calendar, however I would like the short form ... always 3 characters.

dk75's Script needs to be piped the month information from the ncal command.

 $ ncal -h | ./ncal.awk 

It gets the Month information from there.

Offline

#5820 2013-07-23 18:37:04

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

Re: Conky v1.9 Thread

Crinos512 wrote:
Sector11 wrote:

Where does ncal.awk control the month names?
It's using long names and September is longer than July so:

print "${goto 25}${color3}"month"${color}"

will need to be changed month to month.

${alignc} works if the conky is only as wide as the calendar, however I would like the short form ... always 3 characters.

dk75's Script needs to be piped the month information from the ncal command.

 $ ncal -h | ./ncal.awk 

It gets the Month information from there.

Yup, just "dawned" on me ... Debian DOH! Boy hits it again!   lol  lol

Commented out the two lines in the script and added the commands to the conky:

${alignc}${time %T}
    ${color6}${time %b}${color}
${execpi 7200 ncal -h | /media/5/Conky/scripts/ncal.awk}
    ${color6}${time %Y}${color}
${alignc}${uptime_short}

Really nice  ...  now to get goto's to work on all lines not just the top line.


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

Offline

#5821 2013-07-23 19:29:25

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

Re: Conky v1.9 Thread

Got the ${goto xx} or ${alignc} or ${alignr} or ${alignr xx} working:

Near the end of dk75's ncal.awk file:

	#############################################################
	# displaying data                                           #
	#############################################################
	print "${alignc}${color6}"month"${color}"

	for ( j=0; j<=1; j++ )
	{
		for ( i=1; i<=7; i++ )
		{
			printf "${alignc}%s %s %s %s\n", days[i,1], days[i,2+j], days[i,4+j], days[i,6+j]
		}
	}

	print "${alignc}${color6}"year"${color}"
}

it was missing here ...

			printf "${alignc}%s %s %s %s\n", days[i,1], days[i,2+j], days[i,4+j], days[i,6+j]

Of course dk75 left a REALLY BIG hint right there!

print "${alignc}${color6}"month"${color}"

Nicely done dk75!  I like it!

Last edited by Sector11 (2013-07-23 19:36:44)


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

Offline

#5822 2013-07-23 19:48:29

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

Re: Conky v1.9 Thread

Thank you both. The undeniable truth is I couldn't have done it without your help. big_smile

Crinos512 wrote:

Very Nice!
http://brandynbold.com/gifs/i%20like/ri … w-clap.gif

Now... just because I am that way, PLEASE update the calender script to this:

#!/bin/bash
# Crinos512 - 22 July 2013
# /media/5/Conky/scripts/cal.C512.sh
LAR=`date +%d`

ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{if (length($2)==1) { $2 = "0"  $2 ; }print $1, $2, $4, $6}' | tail -n7
ncal -h | sed -e 's/     /  ··  /g' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | awk  '{{if (length($3)==1) { $3 = "0"  $3 ; }{if (length($7)<1) { $7 = "--"  $7 ; }}} print $1, $3, $5, $7}' | tail -n7

Thank you Crinos. Actually, I did update it to that script. But I don't want those dots showing, so I took the ones from the second ncal off, and I've been trying to get rid of those from the first ncal, which have proven to be much more difficult...

Sector11 wrote:

So that was the big secret you were up to.

Pretty rough trying to help a guy what won't tell you what he's doing, but in the end you did do it!

That is awesome!  And only 5% CPU usage ... very very impressive!

I agree with Crinos512 and Riker!

Honest folks ... other than the calendar that I enlisted the aid of Crinos512 - I had no idea ... well, that's not true ... I "guessed" the full screen conky background thing, but what surprise!

KUDOS Inodoro Pereyra

Yep, that was it.  tongue
I know it was difficult for you. My apologies for that. Yet, difficulties and all, you still managed to help quite a bit. Thank you.
I'm really happy with that 5%, especially when Xorg is taking 4%. In reality, cpu usage keeps jumping from 5 to 8-9%, but even those numbers are much better than my old ones.

Now... I have a little quiz for ya... tongue
Have you noticed how tight the blue lines in the dates.conky (bottom, center) are to the text? Care to guess how I did it?
One tip: There's no voffset involved. cool

Offline

#5823 2013-07-23 20:34:33

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

Re: Conky v1.9 Thread

Inodoro Pereyra wrote:
Sector11 wrote:

So that was the big secret you were up to.

Pretty rough trying to help a guy what won't tell you what he's doing, but in the end you did do it!

Yep, that was it.  tongue
I know it was difficult for you. My apologies for that. Yet, difficulties and all, you still managed to help quite a bit. Thank you.
I'm really happy with that 5%, especially when Xorg is taking 4%. In reality, cpu usage keeps jumping from 5 to 8-9%, but even those numbers are much better than my old ones.

Now... I have a little quiz for ya... tongue
Have you noticed how tight the blue lines in the dates.conky (bottom, center) are to the text? Care to guess how I did it?
One tip: There's no voffset involved. cool

No apologies necessary ... it was a fun interesting trip ... a learning experience for both of us.

I can think of a at least two ways of doing that right off the top of my head:

TEXT
Normal method with HR:
default font is monofur
bold size = 11
test text
test text
${hr 1}
test text
test text

Option 1 with HR:
test text
test text${font monofur:pixelsize=5}
${hr 1}
${font}test text
test text


Option 2 with image:
test text
test text${font monofur:size=13}\
${image /media/5/Conky/images/cyan_1.png -p 0,292 -s 70x1}
${font}test text
test text

2013_07_23_17_31_39_1920x1080_Sector11.jpg

Both of those methods I started playing with a while back to avoid using the ${voffset} command.

Last edited by Sector11 (2013-07-23 20:37:18)


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

Offline

#5824 2013-07-23 23:34:32

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

Re: Conky v1.9 Thread

Sector11 wrote:

I can think of a at least two ways of doing that right off the top of my head:

TEXT
Normal method with HR:
default font is monofur
bold size = 11
test text
test text
${hr 1}
test text
test text

Option 1 with HR:
test text
test text${font monofur:pixelsize=5}
${hr 1}
${font}test text
test text


Option 2 with image:
test text
test text${font monofur:size=13}\
${image /media/5/Conky/images/cyan_1.png -p 0,292 -s 70x1}
${font}test text
test text

http://s20.postimg.org/689t1uxe1/2013_07_23_17_31_39_1920x1080_Sector11.jpg

Both of those methods I started playing with a while back to avoid using the ${voffset} command.

Well, my way wasn't that advanced, but it was kinda close to the Option 1...

${color1}FREDERICK${color}${goto 80}01/12/98${goto 142}${color5}${execi 1800 conkyDateDiff 19981201}${alignr}${color}${color3}${execi 1800 conkyDaysDiff 19981201}${color}${font :size=3}
${color6} ${hr 1}${color}${font :size=4}
${color1}${font}EDGAR${color}${goto 80}01/02/64${goto 142}${color5}${execi 1800 conkyDateDiff 19640201}${alignr}${color}${color3}${execi 1800 conkyDaysDiff 19640201}${color}

Not as elegant... but it works. hmm

Offline

Help fund CrunchBang, donate to the project!

#5825 2013-07-24 00:32:52

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

Re: Conky v1.9 Thread

Inodoro Pereyra wrote:

Well, my way wasn't that advanced, but it was kinda close to the Option 1...

${color1}FREDERICK${color}${goto 80}01/12/98${goto 142}${color5}${execi 1800 conkyDateDiff 19981201}${alignr}${color}${color3}${execi 1800 conkyDaysDiff 19981201}${color}${font :size=3}
${color6} ${hr 1}${color}${font :size=4}
${color1}${font}EDGAR${color}${goto 80}01/02/64${goto 142}${color5}${execi 1800 conkyDateDiff 19640201}${alignr}${color}${color3}${execi 1800 conkyDaysDiff 19640201}${color}

Not as elegant... but it works. hmm

If it works ... it works.

I'm not a big fan of ${font:size=xx}  I've seen other use it ... it works  ... just that "some" fonts are larger than others so I call the default font so I know what size I'm dealing with ...

Also you do know that:

${font monfur:size=12}
${font monfur:pixelsize=12}

are not the same.  "pixelsize" is smaller

Here's a good one:

a conky command here${font monofur:pizelsize=0}
${image /path to image/image.png -p a,a -s aaaxbbb}
${font}the next conky command

and the image "line" isn't really there.
kinda like:

a conky command here\
${image /path to image/image.png -p a,a -s aaaxbbb}
the next conky command

image is on the same line as: a conky command here


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

Offline

Board footer

Powered by FluxBB

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

Debian Logo