I'm not using nested IFs to replicate an AND, I'm only saying IF thisA do this1 ELSE IF thisB do this2 ELSE do this3.
[SOLVED] Conky help needed
[SOLVED] Re: Conky help needed
Last edited by JayM on Mon Mar 18, 2019 3:10 am, edited 1 time in total.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.
Re: Conky help needed
If you look at the conky I wrote (see /home/,username>/.conky/MX-ManyRoads/) You'll find other (eye candy) ways of doing this sort of thing using graduated color bars. In mine I use it for disk, mem, but not temp.
Pax vobiscum,
Mark Rabideau - ManyRoads Genealogy -or- eirenicon llc. (geeky stuff)
i3wm, bspwm, hlwm, dwm, spectrwm ~ Linux #449130
"For every complex problem there is an answer that is clear, simple, and wrong." -- H. L. Mencken
Mark Rabideau - ManyRoads Genealogy -or- eirenicon llc. (geeky stuff)
i3wm, bspwm, hlwm, dwm, spectrwm ~ Linux #449130
"For every complex problem there is an answer that is clear, simple, and wrong." -- H. L. Mencken
Re: Conky help needed
See this:
Code: Select all
false:${if_match "41°C" < 40 } < 40°C ${else} >=40°C ${endif}
right:${if_match "41°C" < "40"} < 40°C ${else} >=40°C ${endif}
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
Re: Conky help needed
I didn't get much sleep last night as I had to get up very early to be somewhere by 8:30AM, so my brain isn't functioning well today. But I don't understand what you're saying, or rather, how I can make use of your example. However, you've given me a huge hint: I'd forgotten that "hddtemp /dev/sdb" returns "/dev/sdb: WDC WD5000AAKX-75U6AA0: 42°C" and piping that through "awk '{print $4}'" returns "42°C"" not "42". So what I need to figure out is how to pipe awk's results through something that removes the "°C"" from the end so the end result is just "42" in order to make my if statement work for the hard drive temps, or else use something other than that awk statement to extract just the temperature's number from the entire string produced by hddtemp (remove everything but the third and fourth characters from the end of the string. Please, please don't make me have to use sed, God!)fehlix wrote: ↑Sun Mar 17, 2019 9:55 amSee this:Code: Select all
false:${if_match "41°C" < 40 } < 40°C ${else} >=40°C ${endif} right:${if_match "41°C" < "40"} < 40°C ${else} >=40°C ${endif}
I'll take a little nap then see if I can figure this out.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.
Re: Conky help needed
In bash
and
give me the results I'm looking for, yet
gives me
Why is 42°C still green instead of yellow?
Code: Select all
$ hddtemp /dev/sda | awk '{print $3}' | sed 's/..$//'
38
Code: Select all
$ hddtemp /dev/sdb | awk '{print $4}' | sed 's/..$//'
43
Code: Select all
alignment top_right
background yes
background_color 000000
border_inner_margin 0
border_width 0
default_color FFFFFF
default_outline_color black
default_shade_color black
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
gap_x 0
gap_y 50
minimum_size 250 150
no_buffers yes
override_utf8_locale yes
own_window yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual no
own_window_argb_value 255
own_window_class Conky
own_window yes
own_window_transparent no
own_window_type normal
pad_percents 2
short_units yes
stippled_borders 0
top_name_width 5
update_interval 1
uppercase yes
use_spacer right
use_xft yes
xftalpha 1.0 #0.2
xftfont Cure:bold:size=12
# Color scheme #
default_color ffffff
color1 FFFFFF
color2 FF9616
color3 1CE3BB
color4 FFFF00 #yellow
color5 009900 #green
color6 FF0000 #red
###########################
own_window_colour 000000
TEXT
${if_match ${hwmon 0 temp 1} <"40"}${color5}${hwmon 0 temp 1}°C${color}
${else}
${if_match ${hwmon 0 temp 1} >"50"} ${color6}${hwmon 0 temp 1}°C${color}
${else}
${color4}${hwmon 0 temp 1}°C${color}
${endif}
${endif}
${if_match ${exec /usr/sbin/hddtemp /dev/sda | awk '{print $3}' | sed 's/..$//'} <"40"}${color5}${exec /usr/sbin/hddtemp /dev/sda | awk '{print $3}'}${color}
${else}
${if_match ${exec /usr/sbin/hddtemp /dev/sda | awk '{print $3}' | sed 's/..$//'} >"50"}${color6}${exec /usr/sbin/hddtemp /dev/sda | awk '{print $3}'}${color}
${else}
${color4}${exec "/usr/sbin/hddtemp /dev/sda | awk '{print $3}'"}${color}
${endif}
${endif}
${if_match ${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}' | sed 's/..$//'} <"40"}${color5}${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}'}${color}
${else}
${if_match ${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}' | sed 's/..$//'} >"50"}${color6}${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}'}${color}
${else}
${color4}${exec /usr/sbin/hddtemp /dev/sdb | awk '{print $4}'}${color}
Why is 42°C still green instead of yellow?
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.
Re: Conky help needed
Solved it. I had to remove the quotation marks around the numbers 40 and 50 so they'll be treated as actual numeric values, not strings.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.