You are not logged in.
for cpu i modify this
#!/bin/bash ... cpu=${cpu cpu0}
are you trying to use conky syntax in a bash script???
in bash it isn't so simple.
maybe try this: https://stackoverflow.com/a/9229580
Offline
are you trying to use conky syntax in a bash script???
yes
in bash it isn't so simple.
not for me & i try to learn
I try this i have someting
#!/bin/bash
## ohnonot - Mon 05 Dec 2016
gap="$1" #the gap between hours and minutes
numpath="/home/loutch/.conky/karamba/images"
cpu="$(NUMCPUS=`grep ^proc /proc/cpuinfo | wc -l`; FIRST=`cat /proc/stat | awk '/^cpu / {print $5}'`; sleep 1; SECOND=`cat /proc/stat | awk '/^cpu / {print $5}'`; USED=`echo 2 k 100 $SECOND $FIRST - $NUMCPUS / - p | dc`; echo ${USED}% CPU Usage)"
echo "\${image ${numpath}/1-${cpu:0:1}.png -p 66,88}\
\${image ${numpath}/1-${cpu:1:1}.png -p 101,88}\
\${image ${numpath}/1-${cpu:2:1}.png -p 134,88}"
But that no work great
The number under the image is ${cpu} = 7 % from conky & not the same.
I try this with sarah & conky in 1.10 & lua not work because the script have any error .
& here with mageia & conky in 1.90 version
Last edited by loutch (2016-12-13 17:10:48)
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
cpu="$(NUMCPUS=`grep ^proc /proc/cpuinfo | wc -l`; FIRST=`cat /proc/stat | awk '/^cpu / {print $5}'`; sleep 1; SECOND=`cat /proc/stat | awk '/^cpu / {print $5}'`; USED=`echo 2 k 100 $SECOND $FIRST - $NUMCPUS / - p | dc`; echo ${USED}% CPU Usage)"
hmm, that's a little awkward, no?
i don't think it will work like this.
you need to get current cpu usage, and not since last boot.
i think you're better off installing something like mpstat.
or use conky & lua for this.
Offline
Also, two more general observations:
`grep ^proc /proc/cpuinfo | wc -l`
No need for `wc` at all:
`grep -c ^proc /proc/cpuinfo`
And:
`cat /proc/stat | awk '/^cpu / {print $5}'`
The `awk` command works on files, just like `grep`:
`awk '/^cpu / {print $5}' /proc/stat`
Offline
Hello
tank's for helping but this cpu grrrrrrrrrrrrrr don't work oder i'm to stupid to create the good code
Here what i've do with date and ram and other image In Sarah xfce
@+
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
Offline
@ loutch those are beautiful!
And 1000% better than I could ever do!
You are "Le Conkystador"!!!!
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
It's all looking really good. I apologize for not logging in more lately, but I've been having way too much stuff going on to "take my daily dose" of this forum like I want to.
The downside to a theme like this is that it has a rather large footprint due to the graphics - especially problematic if you have limited real estate already (like on a laptop).
Nixie tubes and old style meters is rather cool in my book no matter how much screen real estate you use!
Offline
Hello
Laptop HP screen is 1600x900 & background "alu" is 1280x850
.
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
Bonsoir
here fisrt ligne of conky's work .
i have a question about conky uptime (the 3')
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
my conkyrc
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=11
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color 38392a
default_outline_color white
alignment top_right
gap_x 580
gap_y 50
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
#minimum_size 128 70
minimum_size 240 118
lua_load ~/.conky/lua/image.lua
TEXT
${lua fDrawImage $HOME/.conky/karamba/images/uptime.png 15 8 222 110}\
${lua fDrawImage $HOME/.conky/karamba/images/Reflection.png 22 0 270 122}\
${lua fDrawImage $HOME/.conky/karamba/images/0-0.png 56 24 30 69}\
${lua fDrawImage $HOME/.conky/karamba/images/0-0.png 87 25 30 69}\
${lua fDrawImage $HOME/.conky/karamba/images/0-0.png 128 24 30 69}\
${lua fDrawImage $HOME/.conky/karamba/images/0-0.png 162 24 30 69}\
${execpi 10 ~/.conky/karamba/uptime.sh 10}
uptime.sh
#!/bin/bash
## ohnonot - Mon 05 Dec 2016
gap="$1" #the gap between hours and minutes
time="$(uptime | awk '{print $3,$4}' | cut -f1 -d,)"
numpath="/home/loutch/.conky/karamba/images"
echo "\${image ${numpath}/1-${time:0:1}.png -p 49,20}\
\${image ${numpath}/1-${time:1:1}.png -p 82,20}\
\${image ${numpath}/1-${time:2:1}.png -p 123,20}\
\${image ${numpath}/1-${time:3:1}.png -p 154,20}"
thank's
Last edited by loutch (2016-12-17 16:04:57)
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
How to modify the script so that the numbers begin to the right and moves towards the left
I'm a noob here on the forum and with conky and LUA, so I'm guessing and not tried this, so I hope I'm not wasting your time - but what about
echo "\${alignr}${image ${numpath}/1-${time:0:1}.png -p 49,20}\
\${alignr}${image ${numpath}/1-${time:1:1}.png -p 82,20}\
\${alignr}${image ${numpath}/1-${time:2:1}.png -p 123,20}\
\${alignr}${image ${numpath}/1-${time:3:1}.png -p 154,20}"
From http://conky.sourceforge.net/variables.html
Variable Arguments () = optional Explanation
alignr (num) Right-justify text, with space of N
Offline
Tank's for helping,
Sorry don't work that is for conky not for a bash script.
.
Last edited by loutch (2016-12-17 17:46:12)
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
Re
here second line with 7 conkys , the 4 cpu are working great with lua's script .
the cpu total work's with conky but not the script for lamps
Ram used work great
Ram not used not so well.Normaly when it is under 1000 that must give me
[0 5 9 5] & not like here [8 5 9 5]any idea .
here ram1.sh
#!/bin/bash
## ohnonot - Mon 05 Dec 2016
gap="$1" #the gap between hours and minutes
numpath="/home/loutch/.conky/karamba/images"
mem="$(free m|grep "Mem"|awk '{printf $4}')"
echo "\${image ${numpath}/1-${mem:0:1}.png -p 24,22}\
\${image ${numpath}/1-${mem:1:1}.png -p 59,22}\
\${image ${numpath}/1-${mem:2:1}.png -p 94,22}\
\${image ${numpath}/1-${mem:3:1}.png -p 131,22}"
.
Last edited by loutch (2016-12-17 17:44:39)
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
mem="$(free m|grep "Mem"|awk '{printf $4}')"
Is this in Mageia?
I think their `free` command is different, what is the full output of `free`?
This command works for me in BunsenLabs:
mem="$(free -m|awk '/-\/+/{print $3}')"
Offline
@ rwyarbrough
No not going to work. ${alignc x} or ${alignr x} will work on 'text' elements in conky but images are different:
image
<path to image> (-p x,y) (-s WxH) (-n) (-f interval)Renders an image from the path specified using Imlib2. Takes 4 optional arguments: a position, a size, a no-cache switch, and a cache flush interval. Changing the x,y position will move the position of the image, and changing the WxH will scale the image. If you specify the no-cache flag (-n), the image will not be cached. Alternately, you can specify the -f int switch to specify a cache flush interval for a particular image. Example: ${image /home/brenden/cheeseburger.jpg -p 20,20 -s 200x200} will render 'cheeseburger.jpg' at (20,20) scaled to 200x200 pixels. Conky does not make any attempt to adjust the position (or any other formatting) of images, they are just rendered as per the arguments passed. The only reason $image is part of the TEXT section, is to allow for runtime modifications, through $execp $lua_parse, or some other method.
bold italics mine
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
free -h give result in G by me
[loutch@localhost ~]$ free -h
total used free shared buffers cached
Mem: 3,8G 2,3G 1,5G 174M 115M 1,1G
-/+ buffers/cache: 1,1G 2,7G
Swap: 3,9G 0B 3,9G
[loutch@localhost ~]$ free -m
total used free shared buffers cached
Mem: 3901 2377 1524 174 115 1108
-/+ buffers/cache: 1153 2747
Swap: 3990 0 3990
Last edited by loutch (2016-12-17 18:04:22)
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
^ Sorry, I edited my post -- the "-h" has been replaced with "-m" and it should now work
Offline
Ram used work great
Ram not used not so well.
Ooops, sorry loutch, I completely misread your post :8
Please ignore my last few posts.
Offline
${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
Offline