Battery element won't display on garuda i3wm

System:
  Kernel: 6.0.12-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=abd777b9-4019-424d-b40b-01cd38fb38db rw [email protected]
    splash rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3
    ibt=off
  Desktop: i3 v: 4.21.1 info: i3bar vt: 7 dm: LightDM v: 1.32.0
    Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 20AMS1FW00 v: ThinkPad X240
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: LENOVO model: 20AMS1FW00 serial: <superuser required>
    UEFI-[Legacy]: LENOVO v: GIET76WW (2.26 ) date: 08/27/2014
Battery:
  ID-1: BAT0 charge: 17.8 Wh (99.4%) condition: 17.9/23.2 Wh (77.2%)
    volts: 12.2 min: 11.1 model: SANYO 45N1773 type: Li-ion serial: <filter>
    status: not charging
  ID-2: BAT1 charge: 25.2 Wh (67.9%) condition: 37.1/47.5 Wh (78.1%)
    volts: 10.2 min: 10.8 model: LGC 45N1735 type: Li-ion serial: <filter>
    status: discharging
CPU:
  Info: model: Intel Core i5-4300U bits: 64 type: MT MCP arch: Haswell
    gen: core 4 level: v3 note: check built: 2013-15 process: Intel 22nm
    family: 6 model-id: 0x45 (69) stepping: 1 microcode: 0x26
  Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache:
    L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB desc: 2x256 KiB
    L3: 3 MiB desc: 1x3 MiB
  Speed (MHz): avg: 849 high: 1003 min/max: 800/2900 scaling:
    driver: intel_cpufreq governor: schedutil cores: 1: 800 2: 798 3: 1003
    4: 798 bogomips: 19955
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX unsupported
  Type: l1tf mitigation: PTE Inversion
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: retbleed status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: conditional, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Haswell-ULT Integrated Graphics vendor: Lenovo ThinkPad X240
    driver: i915 v: kernel arch: Gen-7.5 process: Intel 22nm built: 2013 ports:
    active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2 bus-ID: 00:02.0
    chip-ID: 8086:0a16 class-ID: 0300
  Device-2: Lite-On Integrated Camera type: USB driver: uvcvideo
    bus-ID: 2-8:3 chip-ID: 04ca:7035 class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.6 compositor: Picom v: git-b700a
    driver: X: loaded: modesetting alternate: fbdev,intel,vesa dri: crocus
    gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.21x7.99")
    s-diag: 414mm (16.31")
  Monitor-1: eDP-1 model: AU Optronics 0x106c built: 2012 res: 1366x768
    hz: 60 dpi: 126 gamma: 1.2 size: 276x155mm (10.87x6.1") diag: 317mm (12.5")
    ratio: 16:9 modes: 1366x768
  API: OpenGL Message: Unable to show GL data. Required tool glxinfo
    missing.
Audio:
  Device-1: Intel Haswell-ULT HD Audio vendor: Lenovo ThinkPad X240
    driver: snd_hda_intel v: kernel bus-ID: 00:03.0 chip-ID: 8086:0a0c
    class-ID: 0403
  Device-2: Intel 8 Series HD Audio vendor: Lenovo ThinkPad X240
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:9c20
    class-ID: 0403
  Sound API: ALSA v: k6.0.12-zen1-1-zen running: yes
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.63 running: yes
Network:
  Device-1: Intel Ethernet I218-LM vendor: Lenovo ThinkPad X240 driver: e1000e
    v: kernel port: 3080 bus-ID: 00:19.0 chip-ID: 8086:155a class-ID: 0200
  IF: enp0s25 state: down mac: <filter>
  Device-2: Intel Wireless 7260 driver: iwlwifi v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:08b2 class-ID: 0280
  IF: wlp3s0 state: up mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8
    bus-ID: 2-7:2 chip-ID: 8087:07dc class-ID: e001
  Report: bt-adapter ID: hci0 rfk-id: 1 state: up address: <filter>
Drives:
  Local Storage: total: 119.24 GiB used: 10.5 GiB (8.8%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: MZ7TD128HAFV-000L1
    size: 119.24 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 4L0Q scheme: MBR
Partition:
  ID-1: / raw-size: 119.24 GiB size: 119.24 GiB (100.00%)
    used: 10.5 GiB (8.8%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
  ID-2: /home raw-size: 119.24 GiB size: 119.24 GiB (100.00%)
    used: 10.5 GiB (8.8%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
  ID-3: /var/log raw-size: 119.24 GiB size: 119.24 GiB (100.00%)
    used: 10.5 GiB (8.8%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
  ID-4: /var/tmp raw-size: 119.24 GiB size: 119.24 GiB (100.00%)
    used: 10.5 GiB (8.8%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 7.46 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 48.0 C mobo: N/A
  Fan Speeds (RPM): fan-1: 2590
Info:
  Processes: 217 Uptime: 52m wakeups: 1 Memory: 7.46 GiB
  used: 2.49 GiB (33.4%) Init: systemd v: 252 default: graphical
  tool: systemctl Compilers: gcc: 12.2.0 Packages: pm: pacman pkgs: 1173
  libs: 316 tools: pamac,paru Shell: Bash v: 5.1.16 running-in: xfce4-terminal
  inxi: 3.3.24
Garuda (2.6.12-1):
  System install date:     2022-12-21
  Last full system update: 2022-12-21 ↻
  Is partially upgraded:   No
  Relevant software:       NetworkManager
  Windows dual boot:       <superuser required>
  Snapshots:               Snapper
  Failed units:            

I'm trying to setup a battery element on garuda i3wm, but nothing seems to work? any ideas? I looked over the i3 user guide and the i3status user guide, nothing...

Bonus question: how do I access trackpoint settings on garuda i3wm? I want to set a deadzone and a flat sensativity, no accel. any ideas?

I'm on a thinkpad x240 btw

I am on Lenovo :smiley:

image


Works.

One problem, per thread, please.

And

reboot.

BTW, no screenshots from terminal, paste as text between three ~ in first and last line.

2 Likes

Seems you must check and edit the path.

It looks like <span is missing from the beginning of the format line. Also there is no value for a color declared. Maybe the beginning of the line was deleted by mistake?

2 Likes

I checked the path and it's correct, it brings me to a folder with all the battery info, could it be that tlp or powertop

it's a refubished thinkpad x240 if that helps

edit:
seems like a problem with how pango and i3 read the battery status?

the %status command manifests in a "<span col" element in the bar.

I checked this by commenting out markup=pango, oddly enough it finds the %percentage fine.

any ideas?

..

..

1 Like

I added it, same results.

You added what?

Paste the line into the thread as text so people can see what you are trying to do.

2 Likes
battery 0 {
format = "<span color='#008bef'> %status %percentage %remaining %emptytime</span>"
path = "/sys/class/power_supply/BAT0/uevent"
format_down = "No battery"
low_threshold = 10
status_chr = " 🠩"
status_bat = "  🠫"
#status_unk = "[? ukwn ] "
status_full = " "
last_full_capacity = true
hide_seconds = true
integer_battery_capacity = true
}
1 Like
  "markup"="pango"

works.

Before you start editing files make a backup.
Or restore by /etc/skel/.config/

format = "<span color='#fa4c7e'> %status %percentage // %remaining %emptytime </span>"

thank you for your patience, I was a bit of a dummy trying to copy paste from vim with ctrl shift c.

I just cp the etc/skel/.config/i3status/config into the ~/.config/i3status/ dir. same results.

We use micro, more fun :wink:

1 Like

reboot or Super + Shift + r
and
Super + Shift + c

1 Like

I did, still nothing :frowning:

Past the whole config into the thread so we can take a look--it sounds like there must be a typo somewhere.

You have reloaded i3 after making each change? (Meta+Shift+R, or Meta+Shift+C)

Yup, every time.


# i3status configuration file.
# see "man i3status" for documentation.
#        color_good = "#00e6ac"
#		 color_bad = "#ff0000"
#        color_degraded = "#ffff66"
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!

general {
  output_format = "i3bar"
  colors = true
  #color_good = "#2E588E"
  #color_degraded = "#FFFF00"
  #color_bad = "#FF0000"
  interval = 1
  "markup"="pango"
}

order += "disk /"
#order += "wireless _first_"
#order += "ethernet _first_"
order += "battery all"
order += "battery all"
#order += "load"
order += "cpu_temperature 0"
order += "cpu_temperature 1"
#order += "cpu_temperature 2"
#order += "cpu_temperature 3"
#order += "cpu_temperature 4"
order += "volume master"
order += "tztime local"

ipv6 {
    format_up = "%ip"
    format_down = ""
}

wireless _first_ {
# format_up = "W: (%quality at %essid) %ip"
# format_down = "W: down"
format_up = "<span color='#FFFFFF'>[  ]: On: %essid (%quality) %ip</span>"
format_down = "" #"[  ]  Wifi: down"
}



ethernet _first_ {
# if you use %speed, i3status requires root privileges
format_up = "<span color='#FFFFFF'>%ip | %speed </span>"
format_down = " no lan "
}

battery all {
format = "<span color='#FEFF72'> %status: %percentage %remaining %emptytime </span>"
format_down = "No battery"
#'#fa4c7e'
        status_chr = "<span color='#00e64d'>[  ]  </span> "
        status_bat = "<span color='#8080ff' >[   ] </span>"
        status_unk = "[? ukwn ] "
        status_full = "<span color='#66FF99'> [  ] </span>"
        path = "/sys/class/power_supply/BAT%d/uevent"
        low_threshold = 10
#       last_full_capacity = true
        hide_seconds = true
        integer_battery_capacity = true
}

tztime local {
format = "◔ %H:%M:%S | %a. %d.%m.%Y "
locale = "de_DE.UTF-8"
}


load {
format = "%1min"
}

cpu_temperature 0 {
        format = "T: %degrees °C"
        path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp1_input"
}
cpu_temperature 1 {
        format = "T: %degrees °C"
        path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp2_input"
}
cpu_temperature 2 {
        format = "T: %degrees °C"
        path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp3_input"
}
cpu_temperature 3 {
        format = "T: %degrees °C"
		path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp4_input"
}
cpu_temperature 4 {
        format = "T: %degrees °C"
		path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp5_input"
}


disk "/" {
        # format = " hdd %avail "
        format = " ⛁ %avail "
}

volume master {
    format = "<span color='#FFFFFF'>[VOL]: %volume </span>"
        format_muted = "<span color='#cfafc8'>[  ]: muted (%volume) </span>"
        device = "default"
        mixer = "Master"
        mixer_idx = 0
}

# i3status configuration file.
# see "man i3status" for documentation.
#        color_good = "#00e6ac"
#		 color_bad = "#ff0000"
#        color_degraded = "#ffff66"
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!

general {
  output_format = "i3bar"
  colors = true
  #color_good = "#2E588E"
  #color_degraded = "#FFFF00"
  #color_bad = "#FF0000"
  interval = 1
  "markup"="pango"
}

order += "disk /"
order += "wireless _first_"
#order += "ethernet _first_"
#order += "load"
order += "cpu_temperature 0"
order += "cpu_temperature 1"
order += "cpu_temperature 2"
order += "cpu_temperature 3"
order += "cpu_temperature 4"
order += "volume master"
order += "battery 0"
order += "tztime local"

ipv6 {
    format_up = "%ip"
    format_down = ""
}

wireless _first_ {
# format_up = "W: (%quality at %essid) %ip" On: %essid %ip
# format_down = "W: down"
format_up = "%quality"
format_down = "" #"[ ] Wifi: down"
}



ethernet _first_ {
# if you use %speed, i3status requires root privileges
format_up = "%ip | %speed"
format_down = " no lan "
}


battery 0 {
format = "<span color='#008bef'> %status %percentage %remaining %emptytime</span>"
path = "/sys/class/power_supply/BAT0/uevent"
format_down = "No battery"
low_threshold = 10
status_chr = " 🠩"
status_bat = "  🠫"
#status_unk = "[? ukwn ] "
status_full = " "
last_full_capacity = true
hide_seconds = true
integer_battery_capacity = true
}



tztime local {
# format = "%Y-%m-%d %H:%M:%S    %Z  "
# format = "<span color='#ffffff'>%time</span>"
format = " ◔ %H:%M:%S | %a. %d.%m.%Y "
locale = "de_DE.UTF-8"
}

load {
format = "load %1min"
}

cpu_temperature 0 {
        format = " %degrees°C"
        path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp1_input"
}
cpu_temperature 1 {
        format = " %degrees°C"
        path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp2_input"
}
cpu_temperature 2 {
        format = " %degrees°C"
        path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp3_input"
}
cpu_temperature 3 {
        format = " %degrees°C"
		path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp4_input"
}
cpu_temperature 4 {
        format = " %degrees°C"
		path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp5_input"
}



disk "/" {
        # format = " hdd %avail "
        format = "⛁ %avail "
}

volume master {
    format = "<span color='#cccb00'>🎝 %volume</span>"
        format_muted = "<span color='#ff0000'>  muted (%volume)</span>"
        device = "default"
        mixer = "Master"
        mixer_idx = 0
}



#battery all {
#POWER_SUPPLY_NAME=BAT0
#POWER_SUPPLY_TYPE=Battery
#POWER_SUPPLY_STATUS=Discharging
#POWER_SUPPLY_PRESENT=1
#POWER_SUPPLY_TECHNOLOGY=Li-poly
#POWER_SUPPLY_CYCLE_COUNT=45
#POWER_SUPPLY_VOLTAGE_MIN_DESIGN=7680000
#POWER_SUPPLY_VOLTAGE_NOW=7388000
#POWER_SUPPLY_POWER_NOW=17927000
#POWER_SUPPLY_ENERGY_FULL_DESIGN=60000000
#POWER_SUPPLY_ENERGY_FULL=59630000
#POWER_SUPPLY_ENERGY_NOW=17060000
#POWER_SUPPLY_CAPACITY=28

#format = "<span color='#FEFF72'> %status: %percentage </span>"
#// %remaining %emptytime"
#format_down = "No battery"
#'#fa4c7e'
#        status_chr = "<span color='#00e64d'>[  ]  </span> "
#        status_bat = "<span color='#8080ff' >[   ] </span>"
#        status_unk = "[? ukwn ] "
#        status_full = "<span color='#66FF99'> [  ] </span>"
#        path = "/sys/class/power_supply/BAT%d/uevent"
#        low_threshold = 10
#        last_full_capacity = true
#        hide_seconds = true
#       integer_battery_capacity = true
#}

I am to tired for meld :slight_smile:

I tried adding the battery 0 to the order, and adding your battery 0 config block too, same result, just an empty element on the bar.

All I can think of is maybe you are pulling status unknown somehow and it's throwing a blank icon to the tool.

Can you double-check this? Post to the thread:

cat /sys/class/power_supply/BAT%d/uevent

I obv subsititued the %d with a number :stuck_out_tongue:

cat /sys/class/power_supply/BAT0/uevent
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
POWER_SUPPLY_VOLTAGE_NOW=12326000
POWER_SUPPLY_POWER_NOW=0
POWER_SUPPLY_ENERGY_FULL_DESIGN=23200000
POWER_SUPPLY_ENERGY_FULL=17870000
POWER_SUPPLY_ENERGY_NOW=17870000
POWER_SUPPLY_CAPACITY=100
POWER_SUPPLY_CAPACITY_LEVEL=Full
POWER_SUPPLY_MODEL_NAME=45N1773
POWER_SUPPLY_MANUFACTURER=SANYO
POWER_SUPPLY_SERIAL_NUMBER=  346

I'll reintarate and say that whne I disable pango and remove all the ... elements everything works kinda fine...

# i3status configuration file.
# see "man i3status" for documentation.
#        color_good = "#00e6ac"
#		 color_bad = "#ff0000"
#        color_degraded = "#ffff66"
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!

general {
  output_format = "i3bar"
  colors = true
  #color_good = "#2E588E"
  #color_degraded = "#FFFF00"
  #color_bad = "#FF0000"
  interval = 1
  #"markup"="pango"
}

order += "disk /"
#order += "wireless _first_"
#order += "ethernet _first_"
order += "battery all"
#order += "battery 0"
#order += "load"
order += "cpu_temperature 0"
order += "cpu_temperature 1"
#order += "cpu_temperature 2"
#order += "cpu_temperature 3"
#order += "cpu_temperature 4"
order += "volume master"
order += "tztime local"

ipv6 {
    format_up = "%ip"
    format_down = ""
}

wireless _first_ {
# format_up = "W: (%quality at %essid) %ip"
# format_down = "W: down"
format_up = "<span color='#FFFFFF'>[  ]: On: %essid (%quality) %ip</span>"
format_down = "" #"[  ]  Wifi: down"
}



ethernet _first_ {
# if you use %speed, i3status requires root privileges
format_up = "<span color='#FFFFFF'>%ip | %speed </span>"
format_down = " no lan "
}

battery 0 {
format = "<span color='#008bef'> %status %percentage %remaining %emptytime</span>"
path = "/sys/class/power_supply/BAT0/uevent"
	format_down = "No battery"
	low_threshold = 10
	status_chr = " 🠩"
	status_bat = "  🠫"
	#status_unk = "[? ukwn ] "
	status_full = " "
	last_full_capacity = true
	hide_seconds = true
	integer_battery_capacity = true
}

battery all {

format = "%status %percentage %remaining %emptytime"
format_down = "No battery"
#'#fa4c7e'
        status_chr = "[  ]  "
        status_bat = "[   ]"
        status_unk = "[? ukwn ] "
        status_full = "[  ]"
        path = "/sys/class/power_supply/BAT%d/uevent"
        low_threshold = 10
#       last_full_capacity = true
        hide_seconds = true
        integer_battery_capacity = true
}

#battery all {
##format = "<span color='#FEFF72'> %status: %percentage %remaining %emptytime </span>"
#format = "<span color='#008bef'> %status %percentage %remaining %emptytime</span>"
#format_down = "No battery"
##'#fa4c7e'
#        status_chr = "<span color='#00e64d'>[  ]  </span> "
#        status_bat = "<span color='#8080ff' >[   ] </span>"
#        status_unk = "[? ukwn ] "
#        status_full = "<span color='#66FF99'> [  ] </span>"
#        path = "/sys/class/power_supply/BAT%d/uevent"
#        low_threshold = 10
##       last_full_capacity = true
#        hide_seconds = true
#        integer_battery_capacity = true
#}
#
#tztime local {
#format = "◔ %H:%M:%S | %a. %d.%m.%Y "
#locale = "de_DE.UTF-8"
#}


load {
format = "%1min"
}

cpu_temperature 0 {
        format = "T: %degrees °C"
        path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp1_input"
}
cpu_temperature 1 {
        format = "T: %degrees °C"
        path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp2_input"
}
cpu_temperature 2 {
        format = "T: %degrees °C"
        path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp3_input"
}
cpu_temperature 3 {
        format = "T: %degrees °C"
		path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp4_input"
}
cpu_temperature 4 {
        format = "T: %degrees °C"
		path = "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp5_input"
}


disk "/" {
        # format = " hdd %avail "
        format = " ⛁ %avail "
}

volume master {
    #format = "<span color='#FFFFFF'>[VOL]: %volume </span>"
    format = "[VOL]: %volume "
        #format_muted = "<span color='#cfafc8'>[  ]: muted (%volume) </span>"
        format_muted = "[  ]: muted (%volume) "
        device = "default"
        mixer = "Master"
        mixer_idx = 0
}