# Conky temperature

**URL:** <https://forum.maboxlinux.org/t/conky-temperature/1358>\
**Category:** Conky\
**Created:** [May 31, 2023, 12:51am UTC](https://forum.maboxlinux.org/t/conky-temperature/1358 "2023-05-31T00:51:15Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claudio](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/claudio/32/2830_2.png) [@Claudio](https://forum.maboxlinux.org/u/Claudio)\
**Post date:** [May 31, 2023, 12:51am UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/1 "2023-05-31T00:51:15Z")

</div>

Hi, I was working on my Conky, the sysinfo box was not showing me the temperature, I solved it by inserting the following lines at the end.

```auto
#This shows us the temperature of the processors.
${color}Temperature ${color}$hr
Core 1 ${color}$alignr${exec sensors | grep 'Core 1' | cut -c10-21} C
Core 0 ${color}$alignr${exec sensors | grep 'Core 0' | cut -c10-21} C

```

This is how the result looks like, now I have to find how to modify the colors, I tried with colorizer but I can’t get the expected result, surely I need to touch something in the general configuration.

Translated with [Translate texts & full document files instantly. Accurate translations for individuals and Teams. Millions translate with DeepL every day.](http://www.DeepL.com/Translator) (free version)

 ![conky-sys-info](https://forum.maboxlinux.org/uploads/default/original/2X/1/13699f8f6721f933db821e1c2ecbf430b8687794.png)

---

<div class="post-metadata">

**Author:** ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)\
**Post date:** [May 31, 2023, 5:13am UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/2 "2023-05-31T05:13:01Z")

</div>

Just use variables:${color}, ${color0} , ${color1}, ${color2}. Colorizer will handle them.

---

<div class="post-metadata">

**Author:** ![Claudio](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/claudio/32/2830_2.png) [@Claudio](https://forum.maboxlinux.org/u/Claudio)\
**Post date:** [May 31, 2023, 12:42pm UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/3 "2023-05-31T12:42:03Z")

</div>

Hi, @napcok I tried it but they show in a disordered way, for example the line that follows Temperature is combined with Core below and what I want is that the line and the °C have one color and the rest have the same color. Surely a mistake I am making with the location of the variables. I will find the solution. 👍

---

<div class="post-metadata">

**Author:** ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)\
**Post date:** [May 31, 2023, 12:47pm UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/4 "2023-05-31T12:47:57Z")

</div>

Take a look how those variables are used on lines above.  
Hint:  
Conky is reloaded automatically on every config file save - that should help to figure this out quickly.

---

<div class="post-metadata">

**Author:** ![Claudio](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/claudio/32/2830_2.png) [@Claudio](https://forum.maboxlinux.org/u/Claudio)\
**Post date:** [May 31, 2023, 1:11pm UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/5 "2023-05-31T13:11:02Z")

</div>

Hi again. Yes, I was looking and trying to reproduce what was already in the original code, as I could not get it to behave in the same way, I started to make changes.  
Yes, I see that Conky updates every time I save the changes. Thank you.

---

<div class="post-metadata">

**Author:** ![Claudio](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/claudio/32/2830_2.png) [@Claudio](https://forum.maboxlinux.org/u/Claudio)\
**Post date:** [May 31, 2023, 11:32pm UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/6 "2023-05-31T23:32:01Z")

</div>

I finally figured out how to do it, defined and added a 3rd color as red, modified the added lines so that each thing has its color as I want it. Now I’m happy.

```auto
#Esto nos muestra la temperatura de los procesadores
${color}Temperatura ${color0}$hr
${color1}Core 1 $alignr ${color3}${exec sensors | grep 'Core 1' | cut -c10-21} C
${color1}Core 0 $alignr${color3}${exec sensors | grep 'Core 0' | cut -c10-21} C
${voffset -50}

```

 ![Conky-ok](https://forum.maboxlinux.org/uploads/default/original/2X/a/ad0e8f4c95c17e1b2c158f13e5a02f5c876f428c.png)

---

<div class="post-metadata">

**Author:** ![everardo17](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/everardo17/32/1723_2.png) [@everardo17](https://forum.maboxlinux.org/u/everardo17)\
**Post date:** [June 19, 2023, 9:30am UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/7 "2023-06-19T09:30:06Z")

</div>

I modified your file and I stay as follows, I would not have made it without your contribution, thanks

 ![imagen](https://forum.maboxlinux.org/uploads/default/original/2X/9/963da807382daba7ed0b3b15f6b4a9498368ba95.png)

---

<div class="post-metadata">

**Author:** ![Claudio](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/claudio/32/2830_2.png) [@Claudio](https://forum.maboxlinux.org/u/Claudio)\
**Post date:** [June 22, 2023, 10:21pm UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/8 "2023-06-22T22:21:34Z")

</div>

Hi @everardo17

I don’t know why sometimes I can’t reply from my cell phone.  
Glad to know I helped 👍👍👍👍👍👍👍👍👍👍👍.

---

<div class="post-metadata">

**Author:** ![everardo17](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/everardo17/32/1723_2.png) [@everardo17](https://forum.maboxlinux.org/u/everardo17)\
**Post date:** [November 1, 2023, 8:07am UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/9 "2023-11-01T08:07:40Z")

</div>

Yes, I have been away from Linux but I have already returned to good practices

---

<div class="post-metadata">

**Author:** ![muzqs](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/muzqs/32/3702_2.png) [@muzqs](https://forum.maboxlinux.org/u/muzqs)\
**Post date:** [November 2, 2023, 2:50pm UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/10 "2023-11-02T14:50:14Z")

</div>

Hi @Claudio ,

#### I added the core temp to my conky. Thanks for the work…

 ![Mabox_20231102-14-46-11](https://forum.maboxlinux.org/uploads/default/original/2X/c/c139064d952169c1e1ddc33f139596434e36bc3b.png)

> For the exchange two other output tweaks you maybe like.

- System Uptime, with a pronounceable output.
- Day’s of Mabox installed on the computer.  
_For this, I created “mabox\_days\_installed.sh” that displays the installed days.__inspired by **Mabox Control Center** _.

Conky :

```auto
# Uptime pronounceable output with uptime -p
${alignr}${color0}system ${color}${execpi 5 uptime -p}

# How many day's Mabox is installed
${alignr}${color}${alignr}day's installed ${color0}${execpi 20000 mabox_days_installed.sh}${font}${color0}

```

~/bin/mabox\_days\_installed.sh

```auto
#!/bin/bash

input=$(sed 1q /var/log/pacman.log)

date_part=$(echo "$input" | grep -o -E '\[[0-9]{4}-[0-9]{2}-[0-9]{2}')
start_date=$(echo "$date_part" | awk -F ']' '{print $1}' | tr -d '[]')

# Define the start date and format
date_format="%Y-%m-%d"

# Get the current date in the same format
current_date=$(date +$date_format)

# Convert both dates to UNIX timestamps
start_timestamp=$(date -d "$start_date" +%s)
current_timestamp=$(date -d "$current_date" +%s)

# Calculate the difference in seconds
date_diff=$((current_timestamp - start_timestamp))

# Calculate the difference in days
days_diff=$((date_diff / 86400))

# Output the result

echo "$days_diff"

```

**edit 07-11:** add Conky pix with _temp bar … noblank … mount …_

 ![Mabox_20231105-21-28-56](https://forum.maboxlinux.org/uploads/default/original/2X/8/82e21214fd9bb8f32a69f69f5f48abf943de99c2.png) ![Mabox_20231105-21-29-28](https://forum.maboxlinux.org/uploads/default/original/2X/3/306fa9a5bef66a59573a3a1f1794ca9f56cd0244.png)

🐦

---

<div class="post-metadata">

**Author:** ![Claudio](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/claudio/32/2830_2.png) [@Claudio](https://forum.maboxlinux.org/u/Claudio)\
**Post date:** [November 6, 2023, 6:58pm UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/11 "2023-11-06T18:58:42Z")

</div>

Hi, @muzqs very interesting to calculate the time since the distro was installed. I see that you have to make a script too, I’m still not very proficient in that, I must study a little more and then try it.

---

<div class="post-metadata">

**Author:** ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)\
**Post date:** [November 6, 2023, 8:20pm UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/12 "2023-11-06T20:20:00Z")

</div>

Install date and days since installation is also shown in mcc (Mabox Control Center)

 ![Mabox_20231106-21-14-13](https://forum.maboxlinux.org/uploads/default/original/2X/d/d65f5f86667a4828dfdb830c94db56f7379289a9.jpeg)

Here how this is calculated in mcc script (if you like to use it somewhere)

```auto
# Install date ($INST)
INST="$(sed 1q /var/log/pacman.log)"
INST="${INST/ */}"
INST="${INST/T*/}" # newer pacman adds a different timestamp (TXX:XX:XX+0000), we just want the date
INST="${INST/\[/}"

# Days ago ($DIFF)
TODAY=$(date +%F)
let DIFF=($(date +%s -d ${TODAY})-$(date +%s -d ${INST}))/86400

```

---

<div class="post-metadata">

**Author:** ![muzqs](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/muzqs/32/3702_2.png) [@muzqs](https://forum.maboxlinux.org/u/muzqs)\
**Post date:** [November 7, 2023, 9:28am UTC](https://forum.maboxlinux.org/t/conky-temperature/1358/13 "2023-11-07T09:28:46Z")

</div>

> [@napcok](#):
>
> Install date and days since installation is also shown in mcc (Mabox Control Center)

Got my inspiration from mcc. I did’t know how to use the lines from mcc script. That’s why i created a seperate script.  
🐦
