[c++] Frage zu Conky

  • Hallo zusammen,

    Wie das halt so ist im Leben...habe ich mal angefangen mich mit Conky zu beschäftigen...bin also gerade damit gestartet...hoffe also das ich hier die eine oder andere Frage platzieren darf?

    Ich habe ein Problem mit der Anzeige der Temperaturen bzw. deren Farbe. Anfürsich bin ich schon recht zufrieden mit den Zwischenergebnissen, da ich erst seit gestern damit arbeite.

    Nur die Farben der Temperaturen der CPU machen nicht was sie sollten. bei >=30 sollte Color4 gesetzt werden, ansonsten color2...und genau das geht nicht.

    Kann mir jemand weiter helfen?

    Die entsprechende Zeile (CPU Package, gilt aber auch für die Kerne 1-4) habe ich mal hervorgehoben.


    conky.config = {
    alignment = 'middle_right',
    background = true,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = false,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'DejaVu Sans Mono:size=12',
    gap_x = 25,
    gap_y = 25,
    minimum_height = 1100,
    minimum_width = 300,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_transparent = black,
    own_window_argb_visual = true,
    own_window_class = 'Conky',
    own_window_type = 'panel',
    show_graph_range = t,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,

    color1 = 'grey',
    color2 = '#90EBCD',
    color3 = '#30BA78',
    color4 = '#FE7C3F',
    color5 = 'red'
       
    }

    conky.text = [[
    ${color3}${font Font Awesome 6 Free:style=Solid:size=12}${voffset 2} S Y S T E M ${hr 2}${font}${color}
    ${color1}${font Roboto:size=10}Hostname:${color2} ${alignr}${nodename}
    ${color1}OS: $alignr ${color2} ${execi 6000 lsb_release -d| awk '{$1=""; print $0}'}
    ${color1}Kernel: $alignr ${color2} $kernel
    ${color1}Uptime:$color $alignr ${color2} $uptime${font}${color}

    ${color3}${font Font Awesome 6 Free:style=Solid:size=12} C P U ${hr 2}${font}${color}
    ${color1}${font}${font Roboto:size=10}Intel® Core™ i5-1135G7 Prozessor${font}
    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} CPU Freq:${color2} $alignr${freq_g}GHz${font}

    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} CPU Package:$alignr${if_match "${exec sensors coretemp-isa-0000 | grep 'Package id 0' | cut -c13-21}">="30"}${color4}${exec sensors coretemp-isa-0000 | grep 'Package id 0' | cut -c13-21}${else}${color2}${exec sensors coretemp-isa-0000 | grep 'Package id 0' | cut -c13-21}${endif}${font}

    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} CPU Core 1:$alignr${if_match "${exec sensors coretemp-isa-0000 | grep 'Core 0' | cut -c13-21}">="30"}${color4}${exec sensors coretemp-isa-0000 | grep 'Core 0' | cut -c13-21}${else}${color2}${exec sensors coretemp-isa-0000 | grep 'Core 0' | cut -c13-21}${endif}${font}

    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} CPU Core 2:$alignr${if_match "${exec sensors coretemp-isa-0000 | grep 'Core 1' | cut -c13-21}">="30"}${color4}${exec sensors coretemp-isa-0000 | grep 'core 1' | cut -c13-21}${else}${color2}${exec sensors coretemp-isa-0000 | grep 'Core 1' | cut -c13-21}${endif}${font}

    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} CPU Core 3:$alignr${if_match "${exec sensors coretemp-isa-0000 | grep 'Core 2' | cut -c13-21}">="30"}${color4}${exec sensors coretemp-isa-0000 | grep 'core 2' | cut -c13-21}${else}${color2}${exec sensors coretemp-isa-0000 | grep 'Core 2' | cut -c13-21}${endif}${font}

    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} CPU Core 4:$alignr${if_match "${exec sensors coretemp-isa-0000 | grep 'Core 3' | cut -c13-21}">="30"}${color4}${exec sensors coretemp-isa-0000 | grep 'core 3' | cut -c13-21}${else}${color2}${exec sensors coretemp-isa-0000 | grep 'Core 3' | cut -c13-21}${endif}${font}

    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} CPU Usage: ${color2} $alignr ${cpu}%${font}${color}
    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} CPU Fanspeed: ${color2} $alignr ${exec sensors asus-isa-0000 | grep 'cpu_fan' | cut -c13-21}${font}${color}

    ${color3}${font Font Awesome 6 Free:style=Solid:size=12} G P U ${hr 2}${font}${color}
    ${color1}${font}${font Roboto:size=10}Intel® Iris Xe Graphics${font}
    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} GPU Temp:$alignr${if_match "${hwmon 1 temp 1}">="80"}${color4}+${hwmon 1 temp 1}°C${else}${color2}+${hwmon 1 temp 1}°C${endif}${font}

    ${color3}${font Font Awesome 6 Free:style=Solid:size=12} M E M O R Y ${hr 2}${font}${color}
    ${color1}${font Roboto:size=10}Usage: ${color2}$memperc% ${alignr}${color1}Total: ${color2}$memmax
    ${color1}Used: ${color2}$mem ${alignr}${color1}Free: ${if_match "${memfree}"<="15"}${color4}$memfree${else}${color2}${memfree}${endif}${font}

    ${color1}${font Roboto:size=10}Top Processes ${goto 200}CPU% ${alignr}Mem%${font}${color}
    ${color2}${font Roboto:size=10}${top_mem name 1}${alignr}${goto 200}${top_mem cpu 1} ${alignr}${top_mem mem 1}
    ${color2}${top_mem name 2}${alignr}${goto 200}${top_mem cpu 2} ${alignr}${top_mem mem 2}
    ${color2}${top_mem name 3}${alignr}${goto 200}${top_mem cpu 3} ${alignr}${top_mem mem 3}
    ${color2}${top_mem name 4}${alignr}${goto 200}${top_mem cpu 4} ${alignr}${top_mem mem 4}
    ${color2}${top_mem name 5}${alignr}${goto 200}${top_mem cpu 5} ${alignr}${top_mem mem 5}
    ${color2}${top_mem name 6}${alignr}${goto 200}${top_mem cpu 6} ${alignr}${top_mem mem 6}
    ${color2}${top_mem name 7}${alignr}${goto 200}${top_mem cpu 7} ${alignr}${top_mem mem 7}
    ${color2}${top_mem name 8}${alignr}${goto 200}${top_mem cpu 8} ${alignr}${top_mem mem 8}${font}${color}

    ${color3}${font Font Awesome 6 Free:style=Solid:size=12} N E T W O R K ${hr 2}${font}${color}
    ${color1}${font Font Awesome 6 Free:style=Solid:size=8}${font}${goto 25}${font Roboto:size=10}Download ${alignr}${color2}${downspeedf wlo1}k/s (${totaldown wlo1})${font}${color}
    ${color1}${font Font Awesome 6 Free:style=Solid:size=8}${font}${goto 25}${font Roboto:size=10}Upload ${alignr}${color2}${upspeedf wlo1}k/s (${totalup wlo1})${font}${color}

    ${color3}${font Font Awesome 6 Free:style=Solid:size=12} D I S K ${hr 2}${font}${color}
    ${color1}${font Roboto:size=10}Partition /: $alignr ${color2}${fs_free} free / ${fs_size}
    ${color1}Partition /home: $alignr ${color2}${fs_free /home} free / ${fs_size /home}${font}${color}
    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font Roboto:size=10}Temp: ${color2} $alignr ${exec sensors nvme-pci-e100 | grep 'Composite' | cut -c13-21}${font}${color}

    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font Roboto:size=10}Akku: ${color2} $alignr ${battery_percent}%${goto 760}
    ]]

    Linux Mint 21.3 Cinnamon Nutzer seit 18.04.2023 ;)

    In World without Fences and Walls, who needs Gates and Windows?

  • Als erstes würde ich die Resourcen fressenden exec, grep, cut u.s.w. Befehle gegen einen nativen Conky Befehl austauschen. Eleminiert gleichzeitig ein paar Fehlerquellen.

    Aus

    ${exec sensors coretemp-isa-0000 | grep 'Core 0' | cut -c13-21}

    wird dann

    ${hwmon coretemp temp 1}

    für Core 0. temp 2 für Core 1 u.s.w. Aktuell habe ich keinen Intel PC zum nachsehen welche Werte Sensors für coretemp ausgibt. "Package id" ist aber eher selten. Da vermute ich dann auch den Fehler.

    Poste mal die Ausgabe von sensors im Terminal.

    Just for Fun:

    Ryzen 5 5600G, 16 GB DDR4, Crucial P3 M.2 2TB, Deskmeet X300, Linux Mint 21.3 Cinnamon.
    Server Gigabyte Brix , Debian 11 + OMV

  • Danke für deine Tipps....


    coretemp-isa-0000
    Adapter: ISA adapter
    Package id 0: +91.0°C (high = +100.0°C, crit = +100.0°C)
    Core 0: +91.0°C (high = +100.0°C, crit = +100.0°C)
    Core 1: +76.0°C (high = +100.0°C, crit = +100.0°C)
    Core 2: +78.0°C (high = +100.0°C, crit = +100.0°C)
    Core 3: +74.0°C (high = +100.0°C, crit = +100.0°C)

    ucsi_source_psy_USBC000:002-isa-0000
    Adapter: ISA adapter
    in0: 20.00 V (min = +5.00 V, max = +0.00 V)
    curr1: 3.25 A (max = +0.00 A)

    nvme-pci-e100
    Adapter: PCI adapter
    Composite: +31.9°C (low = -0.1°C, high = +76.8°C)
    (crit = +79.8°C)

    BAT0-acpi-0
    Adapter: ACPI interface
    in0: 17.21 V

    iwlwifi_1-virtual-0
    Adapter: Virtual device
    temp1: +36.0°C

    ucsi_source_psy_USBC000:001-isa-0000
    Adapter: ISA adapter
    in0: 0.00 V (min = +0.00 V, max = +0.00 V)
    curr1: 0.00 A (max = +0.00 A)

    asus-isa-0000
    Adapter: ISA adapter
    cpu_fan: 0 RPM

    acpitz-acpi-0
    Adapter: ACPI interface
    temp1: +91.0°C (crit = +103.0°C)

    Linux Mint 21.3 Cinnamon Nutzer seit 18.04.2023 ;)

    In World without Fences and Walls, who needs Gates and Windows?

  • Im Verzeichnis /sys/class/hwmon/ findest Du für jeden Sensor in Deinem System ein hwmon[0-x] Verzeichnis. In jedem dieser Verzeichnisse gibt es ein Dokument name. Dieses Dokument enthält jeweils den Namen des Sensors wie er von Conky direkt angesprochen werden kann. coretemp ist wahrscheinlich hwmon0 bei Dir. Kontrolle über den Inhalt des name Doks.

    Dann enthält das Verzeichnis für jeden Temperatursensor das Dokument tempx_input. Das enthält jeweils die aktuelle Temperatur und wird in Conky wie in meinem ersten Beitrag beschrieben angesprochen:

    ${hwmon sensorname temp x}

    Für Drehzahlen eines Fans ist das Dok fanx_input zuständig:

    ${hwmon sensorname fan x}

    Für Spannungen inx_input:

    ${hwmon sensorname in x}

    der hwmon Befehl in Conky läßt auch Anpassungen des Wertes zu. Faktor und Offset.:

    ${hwmon k10temp temp 1 0,8 10,0} 

    würde den ausgelesenen Wert mit 0,8 multiplizieren und dann 10 dazu addieren.

    Wenn Du im hwmon Verzeichnis für coretemp nicht sicher den Temperaturwert für das Package finden kannst, nimm den temp1 Sensor von acpitc. Ist der Wert des gleichen Sensors per acpi

    ${hwmon acpi temp 1}

    Ryzen 5 5600G, 16 GB DDR4, Crucial P3 M.2 2TB, Deskmeet X300, Linux Mint 21.3 Cinnamon.
    Server Gigabyte Brix , Debian 11 + OMV

  • Ach ja... der Fehler. Der Cut Befehl für den Package Wert gibt das aus:

    : +91.0°

    Und der if Befehl prüft damit auf => 30

    Wie schon erwähnt, die nativen Conky Funktionen zu nutzen vermeidet Fehler und macht es auch noch sehr viel einfacher.

    Ryzen 5 5600G, 16 GB DDR4, Crucial P3 M.2 2TB, Deskmeet X300, Linux Mint 21.3 Cinnamon.
    Server Gigabyte Brix , Debian 11 + OMV

  • Der Conky Befehl exec führt einen Terminal Befehl aus. Diese Befehle lassen sich also leicht prüfen:

    sensors coretemp-isa-0000 | grep 'Package id 0' | cut -c13-21}

    Ohne Intel CPU tste ich das dann mit Deiner sensors Ausgabe:

    ralf@Nexus:~$ echo 'Package id 0: +91.0°C (high = +100.0°C, crit = +100.0°C)' | cut -c13-21
    : +91.0°
    ralf@Nexus:~$ 

    Wenn Du die Original Befehle weiter nutzen möchtest muss cut angepasst werden:

    ralf@Nexus:~$ echo 'Package id 0: +91.0°C (high = +100.0°C, crit = +100.0°C)' | cut -c16-17
    91
    ralf@Nexus:~$ 

    Ryzen 5 5600G, 16 GB DDR4, Crucial P3 M.2 2TB, Deskmeet X300, Linux Mint 21.3 Cinnamon.
    Server Gigabyte Brix , Debian 11 + OMV

  • Ich nochmal...

    also über den Befehl Hwmon funktioniert das nicht bei jedem Sensor.

    ${hwmon asus cpu_fan} und es passiert nichts....über den exec Befehl ist die Drehzahl vorhanden.

    Mache ich was falsch?

    Linux Mint 21.3 Cinnamon Nutzer seit 18.04.2023 ;)

    In World without Fences and Walls, who needs Gates and Windows?

  • Ich nochmal...

    also über den Befehl Hwmon funktioniert das nicht bei jedem Sensor.

    ${hwmon asus cpu_fan} und es passiert nichts....über den exec Befehl ist die Drehzahl vorhanden.

    Mache ich was falsch?

    Viel :)

    Der Aufbau ist immer gleich. hwmon wertet Dateien aus die auf _input enden! Sensors listet deinen Fan unter dem Namen CPU_Fan. Nach der sensors Ausgabe ist das der einzige Fan für den Sensor Asus. Im entsprechenden hwmon Verzeichnis heißt die Datei für diesen Temp Sensor dann: fan1_input

    Die entsprechende Zeile für Conky:

    ${hwmon asus fan 1}

    Nebenbei fällt mir noch auf das Deine sensors Ausgabe relativ mager ist. Hast Du

    sudo sensors-detect

    ausgeführt?

    Ryzen 5 5600G, 16 GB DDR4, Crucial P3 M.2 2TB, Deskmeet X300, Linux Mint 21.3 Cinnamon.
    Server Gigabyte Brix , Debian 11 + OMV

  • Nebenbei fällt mir noch auf das Deine sensors Ausgabe relativ mager ist. Hast Du

    sudo sensors-detect

    ausgeführt?

    sudo sensors-detect
    [sudo] Passwort für christoph:
    # sensors-detect version 3.6.0
    # System: ASUSTeK COMPUTER INC. ZenBook UX363EA_UX363EA [1.0]
    # Board: ASUSTeK COMPUTER INC. UX363EA
    # Kernel: 5.15.0-102-generic x86_64
    # Processor: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (6/140/1)

    This program will help you determine which kernel modules you need
    to load to use lm_sensors most effectively. It is generally safe
    and recommended to accept the default answers to all questions,
    unless you know what you're doing.

    Some south bridges, CPUs or memory controllers contain embedded sensors.
    Do you want to scan for them? This is totally safe. (YES/no): y
    Module cpuid loaded successfully.
    Silicon Integrated Systems SIS5595... No
    VIA VT82C686 Integrated Sensors... No
    VIA VT8231 Integrated Sensors... No
    AMD K8 thermal sensors... No
    AMD Family 10h thermal sensors... No
    AMD Family 11h thermal sensors... No
    AMD Family 12h and 14h thermal sensors... No
    AMD Family 15h thermal sensors... No
    AMD Family 16h thermal sensors... No
    AMD Family 17h thermal sensors... No
    AMD Family 15h power sensors... No
    AMD Family 16h power sensors... No
    Hygon Family 18h thermal sensors... No
    Intel digital thermal sensor... Success!
    (driver `coretemp')
    Intel AMB FB-DIMM thermal sensor... No
    Intel 5500/5520/X58 thermal sensor... No
    VIA C7 thermal sensor... No
    VIA Nano thermal sensor... No

    Some Super I/O chips contain embedded sensors. We have to write to
    standard I/O ports to probe them. This is usually safe.
    Do you want to scan for Super I/O sensors? (YES/no): y
    Probing for Super-I/O at 0x2e/0x2f
    Trying family `National Semiconductor/ITE'... No
    Trying family `SMSC'... No
    Trying family `VIA/Winbond/Nuvoton/Fintek'... No
    Trying family `ITE'... No
    Probing for Super-I/O at 0x4e/0x4f
    Trying family `National Semiconductor/ITE'... No
    Trying family `SMSC'... No
    Trying family `VIA/Winbond/Nuvoton/Fintek'... No
    Trying family `ITE'... No

    Some systems (mainly servers) implement IPMI, a set of common interfaces
    through which system health data may be retrieved, amongst other things.
    We first try to get the information from SMBIOS. If we don't find it
    there, we have to read from arbitrary I/O ports to probe for such
    interfaces. This is normally safe. Do you want to scan for IPMI
    interfaces? (YES/no): y
    Probing for `IPMI BMC KCS' at 0xca0... No
    Probing for `IPMI BMC SMIC' at 0xca8... No

    Some hardware monitoring chips are accessible through the ISA I/O ports.
    We have to write to arbitrary I/O ports to probe them. This is usually
    safe though. Yes, you do have ISA I/O ports even if you do not have any
    ISA slots! Do you want to scan the ISA I/O ports? (YES/no): y
    Probing for `National Semiconductor LM78' at 0x290... No
    Probing for `National Semiconductor LM79' at 0x290... No
    Probing for `Winbond W83781D' at 0x290... No
    Probing for `Winbond W83782D' at 0x290... No

    Lastly, we can probe the I2C/SMBus adapters for connected hardware
    monitoring devices. This is the most risky part, and while it works
    reasonably well on most systems, it has been reported to cause trouble
    on some systems.
    Do you want to probe the I2C/SMBus adapters now? (YES/no): y
    Found unknown SMBus adapter 8086:a0a3 at 0000:00:1f.4.
    Sorry, no supported PCI bus adapters found.

    Next adapter: SMBus I801 adapter at efa0 (i2c-0)
    Do you want to scan it? (YES/no/selectively): y

    Next adapter: Synopsys DesignWare I2C adapter (i2c-1)
    Do you want to scan it? (YES/no/selectively): y
    Adapter doesn't support all probing functions.
    Some addresses won't be probed.

    Next adapter: Synopsys DesignWare I2C adapter (i2c-2)
    Do you want to scan it? (YES/no/selectively): y
    Adapter doesn't support all probing functions.
    Some addresses won't be probed.

    Next adapter: i915 gmbus dpa (i2c-3)
    Do you want to scan it? (yes/NO/selectively): y

    Next adapter: i915 gmbus dpb (i2c-4)
    Do you want to scan it? (yes/NO/selectively): y
    Client found at address 0x4a
    Probing for `National Semiconductor LM75'... No
    Probing for `National Semiconductor LM75A'... No
    Probing for `Dallas Semiconductor DS75'... No
    Probing for `National Semiconductor LM77'... No
    Probing for `Analog Devices ADT7410/ADT7420'... No
    Probing for `Analog Devices ADT7411'... No
    Probing for `Maxim MAX6642'... No
    Probing for `Texas Instruments TMP435'... No
    Probing for `National Semiconductor LM73'... No
    Probing for `National Semiconductor LM92'... No
    Probing for `National Semiconductor LM76'... No
    Probing for `Maxim MAX6633/MAX6634/MAX6635'... No
    Probing for `NXP/Philips SA56004'... No
    Client found at address 0x4b
    Probing for `National Semiconductor LM75'... No
    Probing for `National Semiconductor LM75A'... No
    Probing for `Dallas Semiconductor DS75'... No
    Probing for `National Semiconductor LM77'... No
    Probing for `Analog Devices ADT7410/ADT7420'... No
    Probing for `Analog Devices ADT7411'... No
    Probing for `Maxim MAX6642'... No
    Probing for `Texas Instruments TMP435'... No
    Probing for `National Semiconductor LM92'... No
    Probing for `National Semiconductor LM76'... No
    Probing for `Maxim MAX6633/MAX6634/MAX6635'... No
    Probing for `NXP/Philips SA56004'... No
    Probing for `Analog Devices ADT7481'... No

    Next adapter: i915 gmbus dpc (i2c-5)
    Do you want to scan it? (yes/NO/selectively): y

    Next adapter: i915 gmbus tc1 (i2c-6)
    Do you want to scan it? (yes/NO/selectively): y

    Next adapter: i915 gmbus tc2 (i2c-7)
    Do you want to scan it? (yes/NO/selectively): y

    Next adapter: i915 gmbus tc3 (i2c-8)
    Do you want to scan it? (yes/NO/selectively): y

    Next adapter: i915 gmbus tc4 (i2c-9)
    Do you want to scan it? (yes/NO/selectively): y

    Next adapter: i915 gmbus tc5 (i2c-10)
    Do you want to scan it? (yes/NO/selectively): y

    Next adapter: i915 gmbus tc6 (i2c-11)
    Do you want to scan it? (yes/NO/selectively): y

    Next adapter: AUX A/DDI A/PHY A (i2c-12)
    Do you want to scan it? (yes/NO/selectively): y
    Client found at address 0x48
    Probing for `National Semiconductor LM75'... No
    Probing for `National Semiconductor LM75A'... No
    Probing for `Dallas Semiconductor DS75'... No
    Probing for `National Semiconductor LM77'... No
    Probing for `Analog Devices ADT7410/ADT7420'... No
    Probing for `Analog Devices ADT7411'... No
    Probing for `Maxim MAX6642'... No
    Probing for `Texas Instruments TMP435'... No
    Probing for `National Semiconductor LM73'... No
    Probing for `National Semiconductor LM92'... No
    Probing for `National Semiconductor LM76'... No
    Probing for `Maxim MAX6633/MAX6634/MAX6635'... No
    Probing for `NXP/Philips SA56004'... No
    Probing for `SMSC EMC1023'... No
    Probing for `SMSC EMC1043'... No
    Probing for `SMSC EMC1053'... No
    Probing for `SMSC EMC1063'... No

    Next adapter: AUX USBC1/DDI TC1/PHY TC1 (i2c-13)
    Do you want to scan it? (yes/NO/selectively): y

    Next adapter: AUX USBC2/DDI TC2/PHY TC2 (i2c-14)
    Do you want to scan it? (yes/NO/selectively): y


    Now follows a summary of the probes I have just done.
    Just press ENTER to continue: y

    Driver `coretemp':
    * Chip `Intel digital thermal sensor' (confidence: 9)

    To load everything that is needed, add this to /etc/modules:
    #----cut here----
    # Chip drivers
    coretemp
    #----cut here----
    If you have some drivers built into your kernel, the list above will
    contain too many modules. Skip the appropriate ones!

    Do you want to add these lines automatically to /etc/modules? (yes/NO)y
    Successful!

    Monitoring programs won't work until the needed modules are
    loaded. You may want to run '/etc/init.d/kmod start'
    to load them.

    Unloading cpuid... OK

    Linux Mint 21.3 Cinnamon Nutzer seit 18.04.2023 ;)

    In World without Fences and Walls, who needs Gates and Windows?

  • was mir gerade auffällt...


    über den Hwmon Befehl bekomme ich die Temperaturen ohne Dezimalstelle ausgegeben...beim exec aber schon..

    Kann man da was machen?

    Linux Mint 21.3 Cinnamon Nutzer seit 18.04.2023 ;)

    In World without Fences and Walls, who needs Gates and Windows?

  • über den Hwmon Befehl bekomme ich die Temperaturen ohne Dezimalstelle ausgegeben...beim exec aber schon..Kann man da was machen?

    Nein. Die input Dateien enthalten wohl mehrere Stellen hinterm Komma aber der hwmon Befehl arbeitet mit Ganzzahlen.

    Ryzen 5 5600G, 16 GB DDR4, Crucial P3 M.2 2TB, Deskmeet X300, Linux Mint 21.3 Cinnamon.
    Server Gigabyte Brix , Debian 11 + OMV

  • Nein. Die input Dateien enthalten wohl mehrere Stellen hinterm Komma aber der hwmon Befehl arbeitet mit Ganzzahlen.

    OK, Danke für die Info und deine Unterstützung...hab doch so einiges gelernt...

    Linux Mint 21.3 Cinnamon Nutzer seit 18.04.2023 ;)

    In World without Fences and Walls, who needs Gates and Windows?

  • Hallo nochmals,


    Ich habe noch eine Frage...

    Es geht um folgende Zeile:

    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font Roboto:size=10}Akku: ${color2} $alignr$ {if_match "${cat /sys/class/power_supply/BAT0/capacity}"<="40"}${color6}${if_match "${cat /sys/class/power_supply/BAT0/capacity}"<="25"}${color4}${else}${cat /sys/class/power_supply/BAT0/capacity}${color2}${endif}${endif}


    Ich möchte gerne die Akkuzustände farblich unterscheiden. Es geht um <=40 und <=25

    irgendwie bekomme ich es nicht hin..und dann kam die Frage auf, ob es überhaupt gehen würde...denn kleiner als 25 ist ja auch zeitgleich kleiner als 40...könnt Ihr mir auf die Sprünge helfen?

    Vielen Dank...

    Linux Mint 21.3 Cinnamon Nutzer seit 18.04.2023 ;)

    In World without Fences and Walls, who needs Gates and Windows?

  • Beitrag von Bleys (14. April 2024 um 19:02)

    Dieser Beitrag wurde vom Autor gelöscht (14. April 2024 um 19:03).
  • conky.config = {
    .
    .
    .
    color1 = '#ff0000',
    color2 = '#ff8000',
    color3 = '#ffbf00',
    color4 = '#80ff00',
    color5 = '#00ff00',
    };
    conky.text = [[
    ${color1} ${if_match ${battery_percent BAT0}>20}${color2}${endif}${if_match ${battery_percent BAT0}>40}${color3}${endif}${if_match ${battery_percent BAT0}>60}${color4}${endif}${if_match ${battery_percent BAT0}>80}${color5}${endif}${battery_percent BAT0}
    ]];

    Ryzen 5 5600G, 16 GB DDR4, Crucial P3 M.2 2TB, Deskmeet X300, Linux Mint 21.3 Cinnamon.
    Server Gigabyte Brix , Debian 11 + OMV

  • Ich danke Dir vielmals für deine Geduld und Hilfe...:thumbup:

    Nun hab ich noch eine Verständnisfrage...

    In dieser Zeile für die CPU Package Temperatur sind die Schwellwerte in Anführungszeichen

    ${color1}${font Font Awesome 6 Free:style=Solid:size=10}${font}${goto 25}${font Roboto:size=10} CPU Package:$alignr${if_match "${exec sensors coretemp-isa-0000 | grep 'Package id 0' | cut -c17-23}">="75"}${color4}${exec sensors coretemp-isa-0000 | grep 'Package id 0' | cut -c17-23}${else}${color2}${exec sensors coretemp-isa-0000 | grep 'Package id 0' | cut -c17-23}${endif}${font}

    Funktioniert nicht ohne...wird falsche Schriftfarbe ausgegeben.


    In der deinem Code sind keine Anführungszeichen...funktioniert aber...


    Warum?

    Linux Mint 21.3 Cinnamon Nutzer seit 18.04.2023 ;)

    In World without Fences and Walls, who needs Gates and Windows?

  • In der deinem Code sind keine Anführungszeichen...funktioniert aber...

    Warum?

    In Deiner Version wird per cut aus einer Datei gelesen. Das Ergebnis ist ein String und die müssen in Anführungszeichen gesetzt werden. Der ganze Vergleich in dieser Version ist daher eigentlich sinnlos.
    Mit dem nativen Conky Befehl battery_percent hast Du eine Ganzzahl die dann auch korrekt mit Ganzzahlen verglichen werden kann. Zitat aus der Beschreibung zu if_match:

    Zitat


    Recognised left and right side types are:
    double - Argument consists of only digits and a single dot.
    long - Argument consists of only digits.
    string - Argument is enclosed in quotation marks (")

    Valid operands are: '>', '<', '>=', '<=', '==', '!='.

    Ryzen 5 5600G, 16 GB DDR4, Crucial P3 M.2 2TB, Deskmeet X300, Linux Mint 21.3 Cinnamon.
    Server Gigabyte Brix , Debian 11 + OMV

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!