Powerlevel10k: custom segment

Created on 26 May 2020  路  3Comments  路  Source: romkatv/powerlevel10k

Can i have this code? I don't know the icon HOT and WARM, and *C

https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/custom-segment.gif

Most helpful comment

function prompt_my_cpu_temp() {
  integer cpu_temp="$(</sys/class/thermal/thermal_zone0/temp) / 1000"
  if (( cpu_temp >= 80 )); then
    p10k segment -s HOT  -f red    -t "${cpu_temp}"$'\uE339' -i $'\uF737'
  elif (( cpu_temp >= 60 )); then
    p10k segment -s WARM -f yellow -t "${cpu_temp}"$'\uE339' -i $'\uE350'
  fi
}

You can search for icons here: https://www.nerdfonts.com/cheat-sheet

All 3 comments

function prompt_my_cpu_temp() {
  integer cpu_temp="$(</sys/class/thermal/thermal_zone0/temp) / 1000"
  if (( cpu_temp >= 80 )); then
    p10k segment -s HOT  -f red    -t "${cpu_temp}"$'\uE339' -i $'\uF737'
  elif (( cpu_temp >= 60 )); then
    p10k segment -s WARM -f yellow -t "${cpu_temp}"$'\uE339' -i $'\uE350'
  fi
}

You can search for icons here: https://www.nerdfonts.com/cheat-sheet

Thank you for your supporting <3

I copy it to p10k.zsh file, then i reboot the machine.

After login, i hit enter for few time. Then it disappear.

I don't know why, can you help me?
Screenshot from 2020-05-27 08-45-52

i use Ubuntu 20.04

The function I posted displays temperature above 80 degrees as HOT, above 60 degrees as WARM and below 60 it doesn't display it at all. When you booted the machine it was at 62 degrees, then it got below 60 degrees.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leeallen337 picture leeallen337  路  3Comments

maximbaz picture maximbaz  路  7Comments

kensang248 picture kensang248  路  4Comments

gigglearrows picture gigglearrows  路  4Comments

georgijd picture georgijd  路  3Comments