You are not logged in.
Hi, all.
I'm using a Conky which calls a Bash Script (modified from one on this site) to report Transmission Torrent data. It works fine both in the shell and in Conky BUT I need to 'relocate' the output to a specific column. Normally I'd add a ${goto 900} for each line of output or similair in the script but it's just pasting that literally without interpreting it.
It's probably a quote mark thing. Any ideas?
Simplified script is here:
START
for number in `transmission-remote -l | awk '{print $1}' | sed '1d;$d'`
do
torrentinfo=`transmission-remote "$host" -t $number -i`
name=`echo "$torrentinfo" | grep Name: | sed -e 's/\s\sName:\s//'`
percent=`echo "$torrentinfo" | grep Percent | sed -r 's/\ \ Percent\ Done:\ (\d+.\d+%)/\1/'`
percentbar=`echo $percent | sed -r 's/(\d+).\d+%/\1/'`
total=`echo "$torrentinfo" | grep Total | sed -r 's/\ \ Total\ size:\ (\d+.\d+\ \w{2}).*/\1/'`
download=`echo "$torrentinfo" | grep "Download Speed" | sed 's/\ \ Download\ Speed:\ //'`
eta=`echo "$torrentinfo" | grep ETA | sed 's/\ \ ETA:\ //'`
echo ${goto 900} "$name" "$percent of $total" "$download" "$eta"
done
END
Any thoughts?
------------
Mod Edit: Please use code tags.
Last edited by Sector11 (2017-04-10 23:27:10)
Offline
but it's just pasting that literally without interpreting it.
Of course it is, you are telling bash to 'echo' that line.
Try:
${goto 900}${exec /path/to/bash/script.sh}
or
${goto 900}${execi 30 /path/to/bash/script.sh}
to run it every 30 seconds or if you need to parse conky commands from the script:
${goto 900}${execpi 30 /path/to/bash/script.sh}
Saying that please, post the complete bash script AND the line in conky that calls it.
You MIGHT get away with:
${goto 900}"$name" "$percent of $total" "$download" "$eta"
if you use ${execpi xx /path/to/bash/script.sh}
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Thanks, but your key suggestion :
${goto 900}${exec /path/to/bash/script.sh}
... won't work.
It indents the first line of output but then as the script iterates through the loop, the ${goto 900} is not applied to subsequent lines.
Hence, the ${goto 900} needs to be outputted to the stream *for each line* which can only be done from within the bash script, not within the conky config.
Offline
You showed one line only. I asked you to show the complete script and the line conky is using to call it.
Obviously if you have a bash script with multiple output lines you will need a ${goto xx} for each line as seen in my "You MIGHT get away with:" comment.
As in a calendar ... it is possible to use the "${goto xx}" or "${alignc}" in a line with multiple outputs.
${alignc}${execpi 900 ncal -bh | sed ':a;N;$!ba;s/\n/\n${alignc}/g'}
Again:
Saying that please, post the complete bash script AND the line in conky that calls it.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
it looks like a complete script to me.
have encountered similar problems, iirc something like this should help:
echo "\${goto 900}$name $percent of $total $download $eta"
PS:
goto 900 sounds like an awfully large conky. maybe you should just indent the whole conky with gap_x?
Last edited by ohnonot (2017-04-11 05:59:13)
Offline
Sorted, I think.
echo "\${goto 900}$name $percent of $total $download $eta"
is what I was looking for :-)
As for 'a big conky' My screen res is 1300+ wide, I have two columns, left and right. This is for the right column. Tried running 2 conkys before but on Linux / XFCE ran into constant flicker and alignment problems, this seemed to be the solution.
Many thanks all who contributed, CLosing the thread. :-)
Offline
Tried running 2 conkys before but on Linux / XFCE ran into constant flicker and alignment problems
you must have done something wrong then. if you want you can paste the failing design.
personally i'd find 2 conkys more elegant, but i guess resource-wise it hardly matters.
Offline
I'm not saying anything ...
I'll just keep on running 14 conkys.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
^ so how's that going resource-wise?
have you, S11, ever tried to run one giant fullscreen conky?
Offline
With those conkys running, plus claws-mail open and responding here the results Between 12 and 18% idle.
Yup, I have made at least 3 or 4 full screen conkys. Will try to find the links to them.
OB_DeepSpace_9 comes to mind but that's a simple one.
I almost said Space Shuttle Statler as well, but that is six separate conkys.
There is one using either conkyForecast or one of Teos scripts that has everything going full screen, one conky with; conky info, weather, moon and such ... still looking.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline