MEPIS Community Forum

A Linux operating system based on Debian Stable
View unanswered posts | View unsolved topics | View active topics |



Reply to topic  [ 6 posts ] 
conky question about cut command 
Author Message
Forum Veteran
Forum Veteran
User avatar

Joined: Wed Jul 19, 2006 6:13 am
Posts: 10076
Location: Geneva NY
Has thanked: 2877 times
Have thanks: 1863 times
Post # 348003
Post conky question about cut command
To track my fan, I have found a conkyrc that I am modifying.

I have a line
Code:
${exec sensors |grep 'CPU Temperature'}
That works, but it gives the whole output instead of just the temperature reading:
Code:
CPU Temperature:    +36.0°C  (high = +60.0°C, crit = +95.0°C)
I tried adding the cut command (after searching around) like this:
Code:
 | cut -f 1-2
but that left things unaltered. Same thing with Fan speed, where I have:
Code:
${color white}${exec sensors | grep 'RPM' | grep 'CPU'}


What is the correct way to do this? Thanks.

_________________
Production: 32 bit, 3.14-0.bpo.1-686-pae. MX-14.2, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB DDR3, / and /home on Kingston SSD 120 GB, data on WesternDigital 1TB, Dell SP2309W monitor.


Thu Sep 18, 2014 11:21 am
Profile
Forum Veteran
Forum Veteran
User avatar

Joined: Wed Jul 12, 2006 2:10 am
Posts: 3394
Location: The Netherlands
Has thanked: 290 times
Have thanks: 329 times
Post # 348005
Post Re: conky question about cut command
Here is my conky line on things like this:
Code:
${color Tan1}Uptime              ${color}${uptime} ${color Tan1}${alignr}TOP               PID    CPU    MEM
${color Tan1}CPU temperature     ${color}${exec sensors | grep 'CPU Temperature' | cut -c22-25}C ${color}${alignr}${top name 1}${alignr}${color}${top pid 1} ${top cpu 1} ${top mem 1}
${color Tan1}CPU fan speed       ${color}${exec sensors | grep 'CPU FAN'| cut -b 20-27}  ${color}${alignr}${top name 2}${alignr}${color}${top pid 2} ${top cpu 2} ${top mem 2}
${color Tan1}Core 1              ${color}${cpu cpu1}% ${color}${alignr}${top name 3}${alignr}${color}${top pid 3} ${top cpu 3} ${top mem 3}
${color Tan1}Core 2              ${color}${cpu cpu2}% ${color}${alignr}${top name 4}${alignr}${color}${top pid 4} ${top cpu 4} ${top mem 4}
${color Tan1}Core 3              ${color}${cpu cpu1}% ${color}${alignr}${top name 5}${alignr}${color}${top pid 5} ${top cpu 5} ${top mem 5}
${color Tan1}Core 4              ${color}${cpu cpu2}% ${color}${alignr}${top name 6}${alignr}${color}${top pid 6} ${top cpu 6} ${top mem 6}
${color Tan1}MB temperature      ${color}${exec sensors | grep 'MB Temperature' | cut -c22-25}C ${color}${alignr}${top name 7}${alignr}${color}${top pid 7} ${top cpu 7} ${top mem 7}
${color Tan1}Chassis fan speed  ${color}${exec sensors | grep 'CHASSIS FAN'| cut -b 20-27} ${color}${alignr}${top name 8}${alignr}${color}${top pid 8} ${top cpu 8} ${top mem 8}
${color Tan1}Ram in use          ${color}${mem} ${color}${alignr}${top name 9}${alignr}${color}${top pid 9} ${top cpu 9} ${top mem 9}
${color Tan1}PCI adapter temp    ${color}${exec sensors | grep 'temp1' | cut -c16-19}C
${color Tan1}HDD temperature     ${color}${hddtemp /dev/sda}C
${color Tan1}GeForce GT640-1GD5  ${color}${nvidia temp}C
${color Tan1}GeForce ram in use  ${color}${exec nvidia-smi -q -d MEMORY | grep Used | cut -c39-44}
# calculate down and up speed scale (40*10^6)/8/1024 where 40 is the amount of mbits the connection has
${color Tan1}Eth0 down           ${color}${downspeedgraph eth0 10,70 00ff00 00ff00 4883KiB} ${downspeed eth0}
${color Tan1}Eth0 up             ${color}${upspeedgraph eth0 10,70 ff0000 ff0000 488KiB} ${color}${upspeed eth0}


Hopefully that helps a bit. I have two columns, if you think this looks weird with the top things in there *giggles*

_________________
MX-14.2 (upgraded from 14.1.1) ext4 Xfce4.10 * AMD Asus M4A785TD-V EVO AM3 * ASUS GeForce GT640-1GD5-L * AMD Processor Athlon II X4 635, sAM3 * HDA ATI SB (VT1708S Analog) * 2x4Gb DDR3 1600 Kingston * 22" Samsung SyncMaster P2250 * HP DeskJet F2280


Thu Sep 18, 2014 11:24 am

Eadwine Rose thanked by: Jerry3904
Profile
Forum Veteran
Forum Veteran
User avatar

Joined: Wed Jul 19, 2006 6:13 am
Posts: 10076
Location: Geneva NY
Has thanked: 2877 times
Have thanks: 1863 times
Post # 348007
Post Re: conky question about cut command
Good. I modified my lines like this to make it work for me:
Code:
${exec sensors |grep 'CPU Temperature' | cut -c1-29} 
${exec sensors | grep 'RPM' | grep 'CPU' | cut -c1-27}

_________________
Production: 32 bit, 3.14-0.bpo.1-686-pae. MX-14.2, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB DDR3, / and /home on Kingston SSD 120 GB, data on WesternDigital 1TB, Dell SP2309W monitor.


Thu Sep 18, 2014 11:38 am
Profile
Forum Veteran
Forum Veteran
User avatar

Joined: Wed Jul 12, 2006 2:10 am
Posts: 3394
Location: The Netherlands
Has thanked: 290 times
Have thanks: 329 times
Post # 348010
Post Re: conky question about cut command
Great!! I found it was all trial and error.. and lots of googling sometimes, ugh :smile:

_________________
MX-14.2 (upgraded from 14.1.1) ext4 Xfce4.10 * AMD Asus M4A785TD-V EVO AM3 * ASUS GeForce GT640-1GD5-L * AMD Processor Athlon II X4 635, sAM3 * HDA ATI SB (VT1708S Analog) * 2x4Gb DDR3 1600 Kingston * 22" Samsung SyncMaster P2250 * HP DeskJet F2280


Thu Sep 18, 2014 11:45 am
Profile
Forum Veteran
Forum Veteran
User avatar

Joined: Wed Jul 19, 2006 6:13 am
Posts: 10076
Location: Geneva NY
Has thanked: 2877 times
Have thanks: 1863 times
Post # 348066
Post Re: conky question about cut command
The result


You do not have the required permissions to view the files attached to this post.

_________________
Production: 32 bit, 3.14-0.bpo.1-686-pae. MX-14.2, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB DDR3, / and /home on Kingston SSD 120 GB, data on WesternDigital 1TB, Dell SP2309W monitor.


Thu Sep 18, 2014 3:33 pm
Profile
Forum Veteran
Forum Veteran
User avatar

Joined: Wed Jul 12, 2006 2:10 am
Posts: 3394
Location: The Netherlands
Has thanked: 290 times
Have thanks: 329 times
Post # 348084
Post Re: conky question about cut command
Very nice and clean!

_________________
MX-14.2 (upgraded from 14.1.1) ext4 Xfce4.10 * AMD Asus M4A785TD-V EVO AM3 * ASUS GeForce GT640-1GD5-L * AMD Processor Athlon II X4 635, sAM3 * HDA ATI SB (VT1708S Analog) * 2x4Gb DDR3 1600 Kingston * 22" Samsung SyncMaster P2250 * HP DeskJet F2280


Thu Sep 18, 2014 4:49 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.