Runedog48
June 24th, 2016, 09:29 PM
Greetings, I'm attempting to use Conky to overlay information about my hardware. I've managed to modify the default Conky config to my liking, however there's one line that's giving me an error ( bad substitution ). The command works perfectly in terminal but not with Conky.
This is the line of code. I'm attempting to make a bar which is filled based on GPU load. The error is produced when I attempt to pipe the 'grep' output to 'awk' which is supposed to remove the percent sign from the string ( execbar does not seem to like percent signs ).
${execbar ${exec aticonfig --adapter=0 --od-getclocks | grep -i -o [0-9]% | awk 'sub(/%/, "")' } }
Output when using commands in terminal:
runedog48@ThomasTheTrain /etc/conky $ aticonfig --adapter=0 --od-getclocks | grep -i -o [0-9]%
0%
runedog48@ThomasTheTrain /etc/conky $ aticonfig --adapter=0 --od-getclocks | grep -i -o [0-9]% | awk 'sub(/%/, "")'
0
runedog48@ThomasTheTrain ~ $ conky
Conky: desktop window (140002c) is subwindow of root window (9c)
Conky: window type - desktop
Conky: drawing to created window (0x3200001)
Conky: drawing to double buffer
sh: 1: Bad substitution
Side note: I've only started using Linux as my daily driver about 2 weeks ago ( used Windows my whole life ), but I've been programming for a while. I'm still getting used to the switch and there's a lot I don't know yet.
Any help would be greatly appreciated.
This is the line of code. I'm attempting to make a bar which is filled based on GPU load. The error is produced when I attempt to pipe the 'grep' output to 'awk' which is supposed to remove the percent sign from the string ( execbar does not seem to like percent signs ).
${execbar ${exec aticonfig --adapter=0 --od-getclocks | grep -i -o [0-9]% | awk 'sub(/%/, "")' } }
Output when using commands in terminal:
runedog48@ThomasTheTrain /etc/conky $ aticonfig --adapter=0 --od-getclocks | grep -i -o [0-9]%
0%
runedog48@ThomasTheTrain /etc/conky $ aticonfig --adapter=0 --od-getclocks | grep -i -o [0-9]% | awk 'sub(/%/, "")'
0
runedog48@ThomasTheTrain ~ $ conky
Conky: desktop window (140002c) is subwindow of root window (9c)
Conky: window type - desktop
Conky: drawing to created window (0x3200001)
Conky: drawing to double buffer
sh: 1: Bad substitution
Side note: I've only started using Linux as my daily driver about 2 weeks ago ( used Windows my whole life ), but I've been programming for a while. I'm still getting used to the switch and there's a lot I don't know yet.
Any help would be greatly appreciated.