You are not logged in.

#321 2016-12-17 19:48:50

rwyarbrough
Member
From: Mesquite, Texas
Registered: 2016-11-26
Posts: 56

Re: Show us your conky

Well I must be sleep coding or something... Everything today has been completely wrong.. Back to the drawing board after I partake of some caffeine...  Deleting all my gibberish so I don't look any more foolish than I already do......

This is post one I trashed...

Last edited by rwyarbrough (2016-12-17 21:43:38)

Offline

#322 2016-12-17 21:20:44

rwyarbrough
Member
From: Mesquite, Texas
Registered: 2016-11-26
Posts: 56

Re: Show us your conky

Followed by my second gibberish post that I'm deleting all of it also so I don't look any more foolish than I already do......

Last edited by rwyarbrough (2016-12-17 21:51:56)

Offline

#323 2016-12-17 22:03:28

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

Re: Show us your conky

Oh dear ... deleting post is not something to be done lightly.  It 'could' get you banned.  sad


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#324 2016-12-17 22:04:02

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

Re: Show us your conky

rwyarbrough wrote:
Sector11 wrote:

${alignc x} or ${alignr x} will work on 'text' elements in conky but images are different:

Thanks,  Next time I'll TEST IT first before giving bad advice... :8

But it's a learning experience therefore a good thing.  smile


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#325 2016-12-17 22:33:36

rwyarbrough
Member
From: Mesquite, Texas
Registered: 2016-11-26
Posts: 56

Re: Show us your conky

Sector11 wrote:

Oh dear ... deleting post is not something to be done lightly.  It 'could' get you banned.  sad

I apologize - I didn't know. The code wasn't working and I didn't want to confuse anyone.

I fixed the code...

Offline

#326 2016-12-17 22:35:55

rwyarbrough
Member
From: Mesquite, Texas
Registered: 2016-11-26
Posts: 56

Re: Show us your conky

loutch wrote:

How to modify the script so that the numbers begin to the right and moves towards the left

like this

[- - - 6] = 6mn
[- - 1 4] = 14 mn
[- 2 5 1] = 2h 51 mn  not like here [2 - 5 1]
[1 0 2 5] = 10h 25 mn

Try this with bash...  My version may be different, but this is tested and works even with single digits.
You will want to comment out my test echos...

#!/bin/bash
uptime=`uptime -p`
days=`uptime -p | awk '{print $2}'`
hours=`uptime -p | awk '{print $4}'`
mins=`uptime -p | awk '{print $6}'`
day1=${days:0:1}
day2=${days:1:1}
day3=${days:2:1}
hour1=${hours:0:1}
hour2=${hours:1:1}
min1=${mins:0:1}
min2=${mins:1:1}
#
if [ "$day3" = "" ] ;
then
	if [ "$day2" = "" ] ;
	then
		if [ "$day1" != " " ] ;
		then
			echo \${image ~/conky/rwy_test_conkys/uptime/1-$day1.png -p 111,20}	
		fi
	else
	echo \${image ~/conky/rwy_test_conkys/uptime/1-$day1.png -p 80,20}\${image ~/conky/rwy_test_conkys/uptime/1-$day2.png -p 111,20}	
	fi	
else
echo \${image ~/conky/rwy_test_conkys/uptime/1-$day1.png -p 49,20}\${image ~/conky/rwy_test_conkys/uptime/1-$day2.png -p 80,20}\${image ~/conky/rwy_test_conkys/uptime/1-$day3.png -p 111,20}	
fi			
if [ "$hour2" = "" ] ;
then
	echo \${image ~/conky/rwy_test_conkys/uptime/1-$hour1.png -p 184,20}	
else
	echo \${image ~/conky/rwy_test_conkys/uptime/1-$hour1.png -p 153,20}\${image ~/conky/rwy_test_conkys/uptime/1-$hour2.png -p 184,20}	
fi	
if [ "$min2" = "" ] ;
then
	echo \${image ~/conky/rwy_test_conkys/uptime/1-$min1.png -p 256,20}	
else
	echo \${image ~/conky/rwy_test_conkys/uptime/1-$min1.png -p 225,20}\${image ~/conky/rwy_test_conkys/uptime/1-$min2.png -p 256,20}	
fi	

uptime1.jpg


Edited Sat Dec 17, 8:59pm Central Time to correct bulky code with tighter code noted by Sector 11.

Last edited by rwyarbrough (2016-12-18 03:00:30)

Offline

#327 2016-12-17 23:02:20

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

Re: Show us your conky

Now that ROCKS!!!!  I was struggling all day with "uptime -p" but - - "scripts" are not my thing.

A thought:  at what point do days become, months, years etc etc ... nmmmmmmmmm never mind - it's all days:

16 and a half years worth of uptime ±6025 days so four columns should be good for uptime days.

Not for me though, I shut down nightly.

Still: AWESOME!


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#328 2016-12-17 23:31:54

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

Re: Show us your conky

OK, I have one of those "noobs" HUH!!!! things.

I copied the script to /media/5/Conky/SuperKaramba/scripts and made changes for the /path/to/the/images

It works as advertised with one "hmmmm ... that's not right."  No way I've been up 5 days 17 hours.  Especially as I did a couple of reboots today playing with uptime.
2016-12-17_201915_Scrot11.th.jpg

It's confusing to me as to why the "script" is reporting my uptime (see the top left of the conky) wrongly.  I'm assuming that the spacing for the images will have enough for 999d 23h 59m from the looks of it.

Script is reporting my hours as days and minutes as hours.  sad


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#329 2016-12-18 00:11:07

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

Re: Show us your conky

BTW you can shorten your commands to use AWK's "print" - much simpler....   I should have known that.

 17 Dec 16 @ 20:53:51 ~
  $ uptime -p | awk '{print $2}'
5
 
 17 Dec 16 @ 20:54:05 ~
  $ uptime -p | awk '{print $4}'
47
 
 17 Dec 16 @ 20:54:09 ~
  $ uptime -p | awk '{print $6}'

 
 17 Dec 16 @ 20:54:16 ~
  $ uptime -p
up 5 hours, 47 minutes
 
 17 Dec 16 @ 20:54:22 ~
  $ 

Can't build 'em, but I can tweak 'em  big_smile


The "print $2" will always be "minutes" for the first 59 minutes the machine is turned on then it becomes the "print $4" as hours kick in and take over the "print $2" slot and when days kick in and we see  "print $6" come into some data.

Should make things easier for us noobs.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#330 2016-12-18 02:54:46

rwyarbrough
Member
From: Mesquite, Texas
Registered: 2016-11-26
Posts: 56

Re: Show us your conky

Sector11 wrote:

BTW you can shorten your commands to use AWK's "print" - much simpler....   I should have known that.

 17 Dec 16 @ 20:53:51 ~
  $ uptime -p | awk '{print $2}'
5
 
 17 Dec 16 @ 20:54:05 ~
  $ uptime -p | awk '{print $4}'
47
 
 17 Dec 16 @ 20:54:09 ~
  $ uptime -p | awk '{print $6}'

 
 17 Dec 16 @ 20:54:16 ~
  $ uptime -p
up 5 hours, 47 minutes
 
 17 Dec 16 @ 20:54:22 ~
  $ 

You are 100% correct, I was in such a hurry to post that I got it to work, I didn't go back and tighten up the code. I simply copied and pasted the initial test line I got to work that gave me only the numbers from the -p flag and instead of making it tight, I just add the -f cut.

I should have caught that myself and spent the extra few minutes to tighten it up.

Last edited by rwyarbrough (2016-12-18 03:06:34)

Offline

#331 2016-12-18 03:17:50

rwyarbrough
Member
From: Mesquite, Texas
Registered: 2016-11-26
Posts: 56

Re: Show us your conky

Ut Oh....   an oddity in uptime -p

uptime -p
up 4 days, 3 hours

I suspect you could also see this as well

uptime -p
up 300 days

if it hits just right where hours are 0 and mins are 0

Means that there will be a minute of time (or possibly an hour) where you will receive an error like this if your watching debug messages with this code.

Conky: Unable to load image '/home/robert/conky/rwy_test_conkys/uptime/1-.png'

Don't think it messes up the display, but that can be tested easily enough by hard setting the values to force the different combinations - like so

days=`uptime -p | awk '{print $2}'`
days=1234
hours=`uptime -p | awk '{print $4}'`
hours=12
mins=`uptime -p | awk '{print $6}'`
mins=""

or

days=`uptime -p | awk '{print $2}'`
days=1234
hours=`uptime -p | awk '{print $4}'`
hours=""
mins=`uptime -p | awk '{print $6}'`
mins=""

I'll have to work on this later as I now have to buckle down and work on things that "bring the bacon home" that I've been putting off cause I'm having more fun with conky.

gut tells me this should work fine to cover all combinations of uptime -p output.

#!/bin/bash
days=`uptime -p | awk '{print $2}'`
hours=`uptime -p | awk '{print $4}'`
mins=`uptime -p | awk '{print $6}'`
day1=${days:0:1}
day2=${days:1:1}
day3=${days:2:1}
hour1=${hours:0:1}
hour2=${hours:1:1}
min1=${mins:0:1}
min2=${mins:1:1}
if [ "$day3" = "" ] ;
then
	if [ "$day2" = "" ] ;
	then
		if [ "$day1" != "" ] ;
		then
			echo \${image ~/conky/rwy_test_conkys/uptime/1-$day1.png -p 111,20}	
		fi
	else
	echo \${image ~/conky/rwy_test_conkys/uptime/1-$day1.png -p 80,20}\${image ~/conky/rwy_test_conkys/uptime/1-$day2.png -p 111,20}	
	fi	
else
echo \${image ~/conky/rwy_test_conkys/uptime/1-$day1.png -p 49,20}\${image ~/conky/rwy_test_conkys/uptime/1-$day2.png -p 80,20}\${image ~/conky/rwy_test_conkys/uptime/1-$day3.png -p 111,20}	
fi		
if [ "$hour2" = "" ] ;
then
	if [ "$hour1" != "" ] ;
	then
		echo \${image ~/conky/rwy_test_conkys/uptime/1-$hour1.png -p 184,20}
	fi
else
	echo \${image ~/conky/rwy_test_conkys/uptime/1-$hour1.png -p 153,20}\${image ~/conky/rwy_test_conkys/uptime/1-$hour2.png -p 184,20}	
fi	
if [ "$min2" = "" ] ;
then
	if [ "$min1" != "" ] ;
	then
		echo \${image ~/conky/rwy_test_conkys/uptime/1-$min1.png -p 256,20}	
	fi	
else
	echo \${image ~/conky/rwy_test_conkys/uptime/1-$min1.png -p 225,20}\${image ~/conky/rwy_test_conkys/uptime/1-$min2.png -p 256,20}	
fi	

I'll test it later when I finish up some boring - pay the bills - work.


BTW, you could easily substitute the blank values from the uptime -p output (min = "" for example) for "0" if you are looking for 0 padded output.

Last edited by rwyarbrough (2016-12-18 03:33:28)

Offline

#332 2016-12-18 03:40:11

rwyarbrough
Member
From: Mesquite, Texas
Registered: 2016-11-26
Posts: 56

Re: Show us your conky

Sector11 wrote:

Now that ROCKS!!!!

Well thank you - been bash scripting for a while, so I'm probably most comfortable with bash scripts than any other language. I dabble in PHP, PERL, MySQL (not sure if there are any conky uses for MySQL - but could be!) and maybe a smidgen of Python, but usually try bash first.

Sector11 wrote:

16 and a half years worth of uptime  ±6025 days so four columns should be good for uptime days.

so three digits will get you to 2.736986301 years. Plenty for me!

Offline

#333 2016-12-18 14:36:04

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

Re: Show us your conky

I should have caught that myself and spent the extra few minutes to tighten it up.

... but it gave me something to do.  smile

Gotta play with your new script.  Something you might want to look at: faketime  although it does nothing with "uptime":

 18 Dec 16 @ 11:31:18 ~
  $ faketime '2525-07-31 13:45:00' uptime -p
up 2 hours, 23 minutes

Very handy when testing conky though:

faketime '2525-07-31 13:45:00' conky -c /media/5/Conky/test.conky &

2016-12-18_112839_Scrot11.th.jpg


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#334 2016-12-18 16:27:39

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

Hello

tank's for all the job you're maked
Sorry new script don' work by me

uptime  3 minutes

1482078160.png

10 mn

1482078392.png
1h49 just

1482078304.png



the script (just modify image way)

Last edited by loutch (2016-12-19 10:37:56)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#335 2016-12-19 09:57:19

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

good Morning

here 15 conky's 2 or 3 do not work well but i'm searching to correct this .

1482141282.png

I think that I would need your help to solve these problems.

@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#336 2016-12-19 13:45:21

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

good afternoon

Here another one in Sarah XFCE & conky 1.10

1482155067.png

Last edited by loutch (2016-12-19 13:51:47)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#337 2016-12-19 15:41:18

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

Re: Show us your conky

loutch wrote:

good Morning

here 15 conky's 2 or 3 do not work well but i'm searching to correct this .

http://pix.tdct.org/upload/thumb/1482141282.png

I think that I would need your help to solve these problems.

@+

I think you need to post the code if you want help.

They look awesome!


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#338 2016-12-19 20:24:43

rwyarbrough
Member
From: Mesquite, Texas
Registered: 2016-11-26
Posts: 56

Re: Show us your conky

loutch wrote:

Sorry new script don' work by me

The script works for me, however I could be using a different shell. If you define the position for the minutes to always be in the same place and use IF statements to control what gets displayed and what doesn't, this should work.

The image will always be static. The first hour position will always be static. The second hour position will always be static. The first minute position will always be static. The second minute always static. Only display those of the four positions which have a value.

This sure looks like a positional problem to me.

Can you copy paste the output of your uptime -p command and your code please?

Last edited by rwyarbrough (2016-12-19 20:27:22)

Offline

#339 2016-12-19 20:33:53

rwyarbrough
Member
From: Mesquite, Texas
Registered: 2016-11-26
Posts: 56

Re: Show us your conky

@loutch

Looking good!

Would love to know what scripting language your using to position the pointers in the dials. <whisper> and would love to see the code! </whisper>

Last edited by rwyarbrough (2016-12-19 20:34:28)

Offline

#340 2016-12-19 20:40:00

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Show us your conky

Hello

konsole :

[loutch@localhost ~]$ uptime -p
up 3 minutes

code i use

#!/bin/bash
days=`uptime -p | awk '{print $2}'`
hours=`uptime -p | awk '{print $4}'`
mins=`uptime -p | awk '{print $6}'`
day1=${days:0:1}
day2=${days:1:1}
day3=${days:2:1}
hour1=${hours:0:1}
hour2=${hours:1:1}
min1=${mins:0:1}
min2=${mins:1:1}
if [ "$day3" = "" ] ;
then
	if [ "$day2" = "" ] ;
	then
		if [ "$day1" != "" ] ;
		then
			echo \${image ~/.conky/karamba/images/1-$day1.png -p 111,20}	
		fi
	else
	echo \${image ~/.conky/karamba/images/1-$day1.png -p 80,20}\${image ~/.conky/karamba/images/1-$day2.png -p 111,20}	
	fi	
else
echo \${.conky/karamba/images/1-$day1.png -p 49,20}\${image ~/.conky/karamba/images/1-$day2.png -p 80,20}\${image ~/.conky/karamba/images/1-$day3.png -p 111,20}	
fi		
if [ "$hour2" = "" ] ;
then
	if [ "$hour1" != "" ] ;
	then
		echo \${image ~/.conky/karamba/images/1-$hour1.png -p 184,20}
	fi
else
	echo \${image ~/.conky/karamba/images/1-$hour1.png -p 153,20}\${image ~/.conky/karamba/images/1-$hour2.png -p 184,20}	
fi	
if [ "$min2" = "" ] ;
then
	if [ "$min1" != "" ] ;
	then
		echo \${.conky/karamba/images/1-$min1.png -p 256,20}	
	fi	
else
	echo \${image ~/.conky/karamba/images/1-$min1.png -p 225,20}\${image ~/.conky/karamba/images/uptime/1-$min2.png -p 256,20}	
fi	

Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

Board footer

Powered by FluxBB