SEARCH

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

You are not logged in.

#7176 2014-03-20 23:18:10

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

Re: Conky v1.9 Thread

boisei0 wrote:

Well, it's almost working now. Next step is to gather enough spam messages to train the filter. This will take quite a bit of time, as I need lots of messages for an automated system that can be trusted.

Awesome...  big_smile

I honestly never though of this as an actual working "SPAMCON" system just a fun thing along with the Tin Foil Hat idea.
But if you get the system working it will be a nice "working" conky.

Maybe corenominal could add it in the default conky  big_smile
EDIT: That's probably a long shot   lol

Last edited by Sector11 (2014-03-20 23:19:20)


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

Offline

Help fund CrunchBang, donate to the project!

#7177 2014-03-20 23:20:44

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

Re: Conky v1.9 Thread

@ Joe90

Looking at it now but dinner is coming up and then wife time.  So if not tonight I'll have something tomorrow.


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

Offline

#7178 2014-03-21 01:49:05

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

Re: Conky v1.9 Thread

@ Joe90

Using seconds would be a lot simpler!

update_interval 1
TEXT
${color5}Text 1 - 2 or 3${color}${alignr 5}${time %S}
${if_match ${time %S} < 10}${execi 120 head /media/5/Conky/t1.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 20}${execi 120 head /media/5/Conky/t2.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 30}${execi 120 head /media/5/Conky/t3.txt | fold -s -w 50}${else}\
${if_match ${time %S} <= 59}




${endif}${endif}${endif}${endif}

seconds.jpg
Obviously a cut and paste job.

Now by giving the ${execi} command with 120 seconds between updates, it insures that your text file will only be called once within the 10 seconds it is displayed.  Saves CPU cycles.

cat - head - tail - whatever.   wink


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

Offline

#7179 2014-03-21 03:45:22

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

Re: Conky v1.9 Thread

Sector11 wrote:

@ Joe90

Using seconds would be a lot simpler!

update_interval 1
TEXT
${color5}Text 1 - 2 or 3${color}${alignr 5}${time %S}
${if_match ${time %S} < 10}${execi 120 head /media/5/Conky/t1.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 20}${execi 120 head /media/5/Conky/t2.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 30}${execi 120 head /media/5/Conky/t3.txt | fold -s -w 50}${else}\
${if_match ${time %S} <= 59}




${endif}${endif}${endif}${endif}

http://s20.postimg.org/50dooqft5/seconds.jpg
Obviously a cut and paste job.

Now by giving the ${execi} command with 120 seconds between updates, it insures that your text file will only be called once within the 10 seconds it is displayed.  Saves CPU cycles.

cat - head - tail - whatever.   wink

It would be interesting to see if that does cut down on the program calls
from how i read it, i still see the programs head and fold being called ever second

eg, if seconds=1 then the first if is passed and the execi command is run for the first time BUT
when seconds=2 this also satisfies the first if, so execi will be run again

as i said, that might need some testing to see how it runs smile

having conky on a 1 second interval but having the text switching based on a particular command that is only called once in a period other than the conky update is probably going to take an external script to do it

Last edited by mrpeachy (2014-03-21 03:46:39)

Offline

#7180 2014-03-21 04:36:12

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

Re: Conky v1.9 Thread

mrpeachy wrote:

It would be interesting to see if that does cut down on the program calls

Turned off all other conkys ... added 4 cpu calls:
2014_03_21_01_26_03_1920x1080_Sector11.jpg

update_interval 1
TEXT
${color5}Text 1 - 2 or 3${color}${alignr 5}${time %S}
${if_match ${time %S} < 10}${execi 120 head /media/5/Conky/t1.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 20}${execi 120 head /media/5/Conky/t2.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 30}${execi 120 head /media/5/Conky/t3.txt | fold -s -w 50}${else}\
${if_match ${time %S} <= 59}



${endif}${endif}${endif}${endif}
CPU: ${cpu cpu1} | ${cpu cpu2} | ${cpu cpu3} | ${cpu cpu0} |

and then a bit busy:
2014_03_21_01_33_28_1920x1080_Sector11.jpg
Works for me.  big_smile


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

Offline

#7181 2014-03-21 05:11:07

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

Re: Conky v1.9 Thread

Sector11 wrote:

Works for me.  big_smile

interesting... do you get different numbers when replacing the "execi 120 head" with plain "exec head"?

Edit - I wonder if execi has a built in mechanism to prevent the same command being run more than once per execi cycle...

Last edited by mrpeachy (2014-03-21 05:33:50)

Offline

#7182 2014-03-21 09:28:39

k0s
Member
From: AlexVa
Registered: 2013-08-31
Posts: 40

Re: Conky v1.9 Thread

Edit

Last edited by k0s (2014-03-21 09:48:38)

Offline

#7183 2014-03-21 09:32:38

k0s
Member
From: AlexVa
Registered: 2013-08-31
Posts: 40

Re: Conky v1.9 Thread

Question - or maybe just thinking outloud - could you port in results/updates/binaries from some of the Spam Blacklists being compiled by some of the larger email clients. I haven't looked too far down the spam rabbit-hole lately - but I'm sure those lists are repo'd somewhere. Maybe an 'add source' function for said repos with some form of scraper for new data. I was just thinking this could harden the results by churning more confirmed white and black data through the filter. I run a little pico ITX inside my rig to execute security script and perform little pentests against my system from time to time - a conky for that data report & 'now with SPAMCON' would be a good idea...

Offline

#7184 2014-03-21 11:12:30

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

Re: Conky v1.9 Thread

mrpeachy wrote:
Sector11 wrote:

Works for me.  big_smile

interesting... do you get different numbers when replacing the "execi 120 head" with plain "exec head"?

Edit - I wonder if execi has a built in mechanism to prevent the same command being run more than once per execi cycle...

I ran 3 more tests, I left medit open for them all ... captured them and made a composite.
Puss_NBoots.jpg
claws mail was open - and idle on desktop 1

And I changed the timing to 15, 30 and 45 seconds.

Results aren't bad at all


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

Offline

#7185 2014-03-21 11:56:29

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

Re: Conky v1.9 Thread

mrpeachy wrote:

Edit - I wonder if execi has a built in mechanism to prevent the same command being run more than once per execi cycle...

Exactly

That's the whole purpose of the 'interval' part of execi

exec     command
     Executes a shell command and displays the output in conky. warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C and posting a patch.

execi     interval command
     Same as exec but with specific interval. Interval can't be less than update_interval in configuration. See also $texeci

execpi     interval command
     Same as execp but with specific interval. Interval can't be less than update_interval in configuration. Note that the output from the $execpi command is still parsed and evaluated at every interval.

texeci     interval command
     Runs a command at an interval inside a thread and displays the output. Same as $execi, except the command is run inside a thread. Use this if you have a slow script to keep Conky updating. You should make the interval slightly longer then the time it takes your script to execute. For example, if you have a script that take 5 seconds to execute, you should make the interval at least 6 seconds. See also $execi. This object will clean up the thread when it is destroyed, so it can safely be used in a nested fashion, though it may not produce the desired behaviour if used this way.

pre_exec     shell command
     Executes a shell command one time before conky displays anything and puts output as text.

It updates once in the 'interval' cycle, not the conky update time.  That's why it is required to be a longer interval than the 'update_interval'.

So "execi 120" will run and then not update for another two minutes, however in the case of this conky, it never reaches that update interval.  The exception is the "execpi" command since it 'parsing' withing what is being called it updates with the conky interval.

================

Putting everything back to "execi 120" and during the time the conky was running the t2.txt file I saved a change to that file:

Text 222 - Text 222 - Text 222
Text 222 - Text 222 - Text 222
${color7}Text 222 - Text 222 - Text 222${color}
Text 222 - Text 222 - Text 222
Text 222 - Text 222 - Text 222

I did not see the change a second later or during the rest of the 15 second run.

However on the next 15 second run:
2014_03_21_08_38_25_272x134_Sector11.jpg

at which time I saved an edit in the conky itself - ${execpi 120 ... :

update_interval 1
TEXT
${color5}Text 1 - 2 or 3${color}${alignr 5}${time %S}
${if_match ${time %S} < 15}${execi 120 head /media/5/Conky/t1.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 30}${execpi 120 head /media/5/Conky/t2.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 45}${execi 120 head /media/5/Conky/t3.txt | fold -s -w 50}${else}\
${if_match ${time %S} <= 59}



${endif}${endif}${endif}${endif}
CPU: ${cpu cpu1} | ${cpu cpu2} | ${cpu cpu3} | ${cpu cpu0} |

and on the next cycle I got one powder-blue line:
2014_03_21_08_40_17_272x134_Sector11.jpg

Conclusion:

  1. pre_exec and execi xxx where xxx is an interval longer than it will be available are basically the same

  2. execi does not update with conky but on the scheduled interval time, and

  3. execpi updates with conky but allows for some neat stuff.  big_smile

Last edited by Sector11 (2014-03-21 12:01:12)


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

Offline

#7186 2014-03-21 17:45:32

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

Re: Conky v1.9 Thread

yes, the regular use of execi makes sense to me
call a script with, execi 120 and the script is run ever 120 conky cycles

but when using execi within an IF, there most be some mechanism in the conky code

i tested with this script

#!/bin/bash
echo $[RANDOM%100+1]

which generates a random number between 1 and 100

when run like this using exec, interval of 1 second

${if_match ${time %S} < 30}${exec /home/mcdowall/test.sh}${else}\
${if_match ${time %S} < 59}${exec /home/mcdowall/test.sh}${else}\
${endif}${endif}

i get a different  random number being generated every second
so the code past the if is being read and executed every seconds

BUT when run with execi

${if_match ${time %S} < 30}${execi 120 /home/mcdowall/test.sh}${else}\
${if_match ${time %S} < 59}${execi 120 /home/mcdowall/test.sh}${else}\
${endif}${endif}

i get the same number for the first 30 seconds and then a different number that remains for the next 30 seconds

so the bottom line... it works!  ]:D

EDIT - thinking about it , it is making sense  smile

Last edited by mrpeachy (2014-03-21 17:53:30)

Offline

#7187 2014-03-21 18:39:53

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

Excellent work Sector 11 and MrPeachy - here is my conky now (much shorter and more manageable) ]:D :

update_interval 1
TEXT
${font Mono:pixelsize=40}${color orange}DAILY NEWS: ${hr 2}$color${font}
${color white}
${font Mono:pixelsize=35}\
${if_match ${time %S} < 10}${execi 120 cat t1.txt}${else}\
${if_match ${time %S} < 20}${execi 120 cat t2.txt}${else}\
${if_match ${time %S} < 30}${execi 120 cat t3.txt}\
${endif}\
${endif}\
${endif}\
$color${font}

I get the expected behaviour you describe, each txt file displayed for 10 seconds  smile  However, when I start the conky I get a 30 second blank conky (apart from the heading; Daily News:) and then after the 3rd txt file displays I get a 30 second delay again before the first txt file shows up.

Oh @ 25 of my 32% CPU was taken up by /usr/bin/X and htop, so the conkies were not causing heavy cpu problems at all!

[EDIT] Ah time is actually time! I changed my numbers after < to 20,40, and 59, now I get behaviour as expected with a nice 1 second break after txt file 3. If I understand correctly it all adds up to 60 seconds ?

Last edited by Joe90 (2014-03-21 18:55:27)

Offline

#7188 2014-03-21 20:23:49

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

Re: Conky v1.9 Thread

mrpeachy wrote:

so the bottom line... it works!  ]:D

EDIT - thinking about it , it is making sense  smile

I went through something like this a long time ago.  big_smile

  1. by using ${time $S} we're using the seconds from the computer's internal clock

  2. conky "update_interval" is not dependant on the 'clock'

    • it is simply an interval in seconds that conky updates

An example (to use Joe90's setup):

update_interval 30
TEXT
${color5}Text 1 - 2 or 3${color}${alignr 5}${time %S}
${if_match ${time %S} < 15}${execi 120 head /media/5/Conky/t1.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 30}${execpi 120 head /media/5/Conky/t2.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 45}${execi 120 head /media/5/Conky/t3.txt | fold -s -w 50}${else}\
${if_match ${time %S} <= 59}Hello there.
${endif}${endif}${endif}${endif}

If that conky started at 14:24:52 you'd see "Hello there" on the screen until 14:25:22 when conky updates.
At that time 14:25:22, with seconds >14 and <30, you would see the results of t2.txt because the 'seconds between 0 and 14 have come and gone while conky was waiting to update - in fact you'd never see t1.txt while that instance of the conky is running.

Tomorrow you may fire up the conky and see t1.txt and miss t2.txt

mud = now+clear   yikes  wink  cool


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

Offline

#7189 2014-03-21 20:25:27

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

Re: Conky v1.9 Thread

Joe90 wrote:

[EDIT] Ah time is actually time! I changed my numbers after < to 20,40, and 59, now I get behaviour as expected with a nice 1 second break after txt file 3. If I understand correctly it all adds up to 60 seconds ?


Yes, %S is seconds.  A lot of people use: ${time %H:$M:$S} for HH:MM:SS you can use them separately, hence: ${time $S}.  It will depend on what the times is when you start your conky as to which file you see first.  big_smile

The time command comes in handy for more than just time.  You could use the same thing for $M and have displays for XX minutes then change as well.  Imagine ... changing something 60 times an hour, or every 5 minutes blah blah ...

A handy little text file Time.txt I refer to it a lot:

${time %?}

Time
====
%H 	Two digit representation of the hour in 24-hour format 	00 through 23
%I 	Two digit representation of the hour in 12-hour format 	01 through 12
%l   (lower-case 'L') Hour in 12-hour format, with a space preceeding single digits 1 through 12
%M 	Two digit representation of the minute 	00 through 59
%p 	UPPER-CASE 'AM' or 'PM' based on the given time 	Example: AM for 00:31, PM for 22:23
%P 	lower-case 'am' or 'pm' based on the given time 	Example: am for 00:31, pm for 22:23
%r 	Same as "%I:%M:%S %p" 	Example: 09:34:17 PM for 21:34:17
%R 	Same as "%H:%M" 	Example: 00:35 for 12:35 AM, 16:44 for 4:44 PM
%S 	Two digit representation of the second 	00 through 59
%T 	Same as "%H:%M:%S" 	Example: 21:34:17 for 09:34:17 PM
%X 	Preferred time representation based on locale, without the date 	Example: 03:59:16 or 15:59:16
%z 	Either the time zone offset from UTC or the abbreviation (depends on operating system) 	Example: -0500 or EST for Eastern Time
%Z 	The time zone offset/abbreviation option NOT given by %z (depends on operating system) 	Example: -0500 or EST for Eastern Time

Day
===
%a 	An abbreviated textual representation of the day 	Sun through Sat
%A 	A full textual representation of the day 	Sunday through Saturday
%d 	Two-digit day of the month (with leading zeros) 	01 to 31
%e 	Day of the month, with a space preceding single digits 	1 to 31
%j 	Day of the year, 3 digits with leading zeros 	001 to 366
%u 	ISO-8601 numeric representation of the day of the week 	1 (for Monday) though 7 (for Sunday)
%w 	Numeric representation of the day of the week 	0 (for Sunday) through 6 (for Saturday)

Month
=====
%b 	Abbreviated month name, based on the locale 	Jan through Dec
%B 	Full month name, based on the locale 	January through December
%h 	Abbreviated month name, based on the locale (an alias of %b) 	Jan through Dec
%m 	Two digit representation of the month (with leading zeros) 	01 to 12

Year
====
%g 	Two digit representation of the year going by ISO-8601:1988 standards (see Week: %V) 	Example: 09 for the week of January 6, 2009
%G 	The full four-digit version of %g 	Example: 2008 for the week of January 3, 2009
%y 	Two digit representation of the year 	Example: 09 for 2009, 79 for 1979
%Y 	Four digit representation for the year 	Example: 2038

Century
=======
%C 	Two digit representation of the century (year divided by 100, truncated to an integer) 	19 for the 20th

Week
====
%U 	Week number of the given year, starting with the first Sunday as the first week
 	13 (for the 13th full week of the year)

%V 	ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week 	01 through 53 (where 53 accounts for an overlapping week)

%W 	A numeric representation of the week of the year, starting with the first Monday as the first week 	46 (for the 46th week of the year beginning with a Monday)

Time and Date Stamps
====================
%c 	Preferred date and time stamp based on local 	Example: Tue Feb 5 00:45:10 2009 for February 4, 2009 at 12:45:10 AM
%D 	Same as "%m/%d/%y" 	Example: 02/05/09 for February 5, 2009
%F 	Same as "%Y-%m-%d" (commonly used in database datestamps) 	Example: 2009-02-05 for February 5, 2009
%s 	Unix Epoch Time timestamp (same as the time() function) 	Example: 305815200 for September 10, 1979 08:40:00 AM
%x 	Preferred date representation based on locale, without the time 	Example: 02/05/09 for February 5, 2009

Miscellaneous
=============
%n 	A newline character ("\n") 	---
%t 	A Tab character ("\t") 	---
%% 	A literal percentage character ("%") 	---

Maximum length of this parameter is 1023 characters.

C-4 in Action!


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

Offline

#7190 2014-03-21 20:40:22

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

smile

Offline

#7191 2014-03-21 20:40:50

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

Re: Conky v1.9 Thread

k0s wrote:

Question - or maybe just thinking outloud - could you port in results/updates/binaries from some of the Spam Blacklists being compiled by some of the larger email clients. I haven't looked too far down the spam rabbit-hole lately - but I'm sure those lists are repo'd somewhere. Maybe an 'add source' function for said repos with some form of scraper for new data. I was just thinking this could harden the results by churning more confirmed white and black data through the filter. I run a little pico ITX inside my rig to execute security script and perform little pentests against my system from time to time - a conky for that data report & 'now with SPAMCON' would be a good idea...

Interesting ... that would be a Q for boisei0 maybe you could help him  big_smile


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

Offline

#7192 2014-03-21 23:49:55

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

Getting a bit closer to what I am after for a digital information screen now. Images are wallpapers reduced in size to @ 1/4 on a black background, then two conkies, one for the time and on for information. Everything in the screenshot is just for testing purposes. Might put the weather on here too with some nice icons wink

closer.jpg

Last edited by Joe90 (2014-03-21 23:50:48)

Offline

#7193 2014-03-22 00:42:08

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

Re: Conky v1.9 Thread

Joe90 wrote:

Getting a bit closer

Looks good Joe ... Looking forwatd to seeing a finished product.  big_smile


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

Offline

#7194 2014-03-22 01:57:18

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

Re: Conky v1.9 Thread

OK, I had to do this ... just because.  Thanks Joe90 and mrpeachy.
2014_03_21_22_42_20_1920x1080_Sector11.jpg

update_interval 1
TEXT
${color5}Text 1 - 2 or 3${color}${alignr 5}${time %S}
${if_match ${time %S} < 15}${execi 120 head /media/5/Conky/t1.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 30}${execpi 120 head /media/5/Conky/t2.txt | fold -s -w 50}${else}\
${if_match ${time %S} < 45}${execi 120 head /media/5/Conky/t3.txt | fold -s -w 50}${else}\
${if_match ${time %S} <= 59}



${endif}${endif}${endif}${endif}
CPU: ${cpu cpu1} | ${cpu cpu2} | ${cpu cpu3} | ${cpu cpu0} |

${alignc}${membar 0,25} ${color5}${time %A}${color} ${membar 0,25}
${if_match ${time %w} == 0}${execi 86400 head /media/5/Conky/wkdy/sun.txt | fold -s -w 30}${else}\
${if_match ${time %w} == 1}${execi 86400 head /media/5/Conky/wkdy/mon.txt | fold -s -w 30}${else}\
${if_match ${time %w} == 2}${execi 86400 head /media/5/Conky/wkdy/tue.txt | fold -s -w 30}${else}\
${if_match ${time %w} == 3}${execi 86400 head /media/5/Conky/wkdy/wed.txt | fold -s -w 30}${else}\
${if_match ${time %w} == 4}${execi 86400 head /media/5/Conky/wkdy/thu.txt | fold -s -w 30}${else}\
${if_match ${time %w} == 5}${execi 86400 head /media/5/Conky/wkdy/fri.txt | fold -s -w 30}${else}\
${if_match ${time %w} == 6}${execi 86400 head /media/5/Conky/wkdy/sat.txt | fold -s -w 30}${else}\
${endif}${endif}${endif}${endif}${endif}${endif}${endif}

${alignc}${membar 0,25} ${color5}${time %B}${color} ${membar 0,25}
${if_match ${time %m} == 01}${execi 86400 head /media/5/Conky/wkdy/JAN.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 02}${execi 86400 head /media/5/Conky/wkdy/FEB.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 03}${execi 86400 head /media/5/Conky/wkdy/MAR.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 04}${execi 86400 head /media/5/Conky/wkdy/APR.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 05}${execi 86400 head /media/5/Conky/wkdy/MAY.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 06}${execi 86400 head /media/5/Conky/wkdy/JUN.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 07}${execi 86400 head /media/5/Conky/wkdy/JUL.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 08}${execi 86400 head /media/5/Conky/wkdy/AUG.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 09}${execi 86400 head /media/5/Conky/wkdy/SEP.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 10}${execi 86400 head /media/5/Conky/wkdy/OCT.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 11}${execi 86400 head /media/5/Conky/wkdy/NOV.txt | fold -s -w 30}${else}\
${if_match ${time %m} == 12}${execi 86400 head /media/5/Conky/wkdy/DEC.txt | fold -s -w 30}${else}\
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}

Since I shut down every night .... 86400 (24 Hours) is a safe bet.  Although if one sets something like 1800 I doubt it would tax the CPU at all. wink

Check out the CPU usage ... my 12 other conkys are running, plus medit and Iceweasel.  Not so bad!  cool


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

Offline

#7195 2014-03-22 11:26:58

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

Not strictly conky, but thought I would post up my little imagemagick script that created the wallpapers in my screenshot above. The script takes the base image, a wallpaper, and adds a mask (I created this in inkscape to make rounded corners) and resizes it. Then it creates a back background and positions the new reduced image (much reduced file size to work with as well, original wallpaper @ 500k new one @150K). Doesn't take too long to reprogramme if you want the image somewhere else on screen. I am guessing that there is a way to do this all "on the fly" using lua, but this works for me wink

#!/bin/bash

for i in "$@"
do

#put mask on image
convert "/path/to/mask.png"  "$i" -gravity center -compose\
 DstOver -resize 870x536\! -composite ol"$i".jpg


#put image on background
convert -size 1920x1080 xc:black ol"$i".jpg -geometry +1016+30\
 -composite conv"$i"

#delete intermediate file
rm ol"$i".jpg

done

I have it set as a custom action in Thunar for ease of use, it needs the "%N" option as opposed to the "%F" option to work as a custom action.

Last edited by Joe90 (2014-03-22 11:28:27)

Offline

#7196 2014-03-22 14:32:19

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

Re: Conky v1.9 Thread

Joe90 wrote:

Not strictly conky, but thought I would post up my little imagemagick script that created the wallpapers in my screenshot above.

That's pretty slick.

What is: mask.png ??

And another question.  Why do you reduce a wall to that size and display it? Is there a hidden purpose you're not telling us?

I mean I can see it as a background for a semi-transparent clock or something like that.

Just curious no other motive ... feel free to tell me it's above my pay grade.  big_smile

Last edited by Sector11 (2014-03-22 14:32:45)


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

Offline

#7197 2014-03-22 16:05:07

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

@ Sector 11

mask.png is the mask file for the wallpaper to give it rounded corners, I drew it in inkscape, it is simply a transparent rectangle with inner rounded corners, which imagemagick then places over the wallpaper and combines them.

Usage for my final solution will be in my place of work. I an working up "Greeter" panels for staff and visitors on arrival to our offices, and info screens for staff in other locations. The images will be of interest: "things that happen at work" and the buildings, so not really wallpapers. If I am honest creating 1920x1080 black backgrounds with a 1024x576 image in one corner to be displayed as backgrounds was just laziness on my part, I could have used conky and lua to achieve the same with a black background (I still might do this!) Just didn't want to ask for too many good things in a row from you guys!

So, display rotating image collection using conky and lua, with rounded corners, anyone?

ps I am way below your pay grade on all this lol

Last edited by Joe90 (2014-03-22 16:06:33)

Offline

#7198 2014-03-22 16:30:07

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

Re: Conky v1.9 Thread

lua has several ways of working with images
see here for example
http://cairographics.org/samples/clip_image/

you draw the shape, a rounded corner rectangle is pretty easy (the code is in the background lua script)

then you paint your image over it

are you wanting an image in a particular conky, or a screen size conky displaying a large wallpaper image?

Offline

#7199 2014-03-22 16:47:40

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Conky v1.9 Thread

It would be in a particular conky as per my last screenshot, the rounded corners are simply echoing the rounded corners for the lua background. Still trying to decide if this is too old school now and if i should go for a Windows8 mad tiled look & feel?

Offline

Help fund CrunchBang, donate to the project!

#7200 2014-03-22 16:49:09

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2012-03-22
Posts: 1,026
Website

Re: Conky v1.9 Thread

Sector invited me to show the calendar conky I use on my desktop. So, here it is:

alignment                 top_left
background                no
border_width              0
#cpu_avg_samples           5
#default_color             white
#default_color             F38536
default_color             707070
default_outline_color     white
draw_borders              no
draw_graph_borders        no
draw_outline              no
draw_shades               no
use_xft                   yes
#xftfont                   Terminus:size=10
xftfont                   DejaVu Sans Mono:size=10
xftalpha                  1
#gap_x                     640   # this is half of 1280 (= width of second/right monitor)
gap_y                     20
#minimum_size              20 0
minimum_size              10 0
maximum_width             1680
net_avg_samples           2
no_buffers                yes
out_to_console            no
own_window                yes
own_window_class          Conky
own_window_type           override
own_window_transparent    yes
#own_window_hints          undecorated,below,sticky,skip_taskbar,skip_pager
update_interval           30
uppercase                 no
use_spacer                left
use_spacer                right
double_buffer             yes
short_units               yes
pad_percents              0
#text_buffer_size          512   # default 256

TEXT
${color}${exec cal -m `date +%m` -A-2 -B2}
${exec cal -m `date +%m` -A-1 -B1}
${color #93470F}${execp cal | sed s/`echo "\x5f\x08\(.\)\x5f\x08\(.\)"`/'${color #FFA500}\1\2${color #93470F}'/}
${color}${exec cal -m `date +%m` -A1 -B-1}
${exec cal -m `date +%m` -A2 -B-2}
${exec cal -m `date +%m` -A3 -B-3}
${exec cal -m `date +%m` -A4 -B-4}
${exec cal -m `date +%m` -A5 -B-5}

and screenshot of entire desktop (too lazy to crop) ... calendar is on the left side smile
scrot.jpg
It is a static noninteractive calendar. (I don't need more advanced one ...) Uses only 'cal' command from shell, and a bit of 'sed'.

Current month is always shown as a third month from the top, and it is dark orange. Current day is light orange. Other months are gray. (It should not be difficult to change colors. I tried to follow default pekwm and #! colors ...)

To remove excess months, remove the most bottom lines until it suits you.

(TBH, the calendar is so 'dull' I didn't think it would interest anyone ...)


Postpone all your duties; if you die, you won't have to do them ..
--> The very new BL forum! <--

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