Would you like to react to this message? Create an account in a few clicks or log in to continue.

  • Post new topic
  • Reply to topic

How to get battery state into conky

nobody
nobody


Posts : 47
Join date : 2024-05-12
Location : Finland

How to get battery state into conky Empty How to get battery state into conky

Post by nobody 26th May 2024, 12:04 am

Usually battery state is easy to redirect into conky, but when reading state from upower, it can be tricky. Anyway it can redirect the next way. In the example battery is BAT1 in stead of regular BAT0 (inxi -B tells).

If BAT1, then the next lines to .conkyrc file.

Code:
Battery BAT1
${execpi 30 upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep state | sed s/^/\${alignr}/ }
${execpi 30 upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | sed s/^/\${alignr}/ }
${execpi 30 upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | sed s/^/\${alignr}/ }

How to get battery state into conky Conky10
  • Post new topic
  • Reply to topic

Current date/time is 29th June 2024, 6:48 am