Comments (12)
Can you post the output of running ~/.i3/blocks/battery/battery.py
from the command line?
from i3blocks-contrib.
And also the output of acpi
please.
from i3blocks-contrib.
this is what i get:
http://ix.io/1MBL
http://ix.io/1MGb
from i3blocks-contrib.
@ralpheeee88 Very interesting (confusing). The only code path that leads to the output you posted is the following:
from subprocess import check_output
status = check_output(['acpi'], universal_newlines=True)
if not status:
# stands for no battery found
fulltext = "<span color='red'><span font='FontAwesome'>\uf00d \uf240</span></span>"
This only happens when everything runs successfully but acpi returns no output. This is standard behavior only if you have no battery. However, the acpi output you posted clearly is not empty, so the script should not have entered this code path.
The following troubleshooting ideas come to mind:
Try running python3 and interactively typing the two lines:
from subprocess import check_output
check_output(['acpi'], universal_newlines=True)
Is the output empty, or does it show something like "Battery 0: Discharging, 100%, 07:15:46 remaining"? Repeat process many times to ensure behavior is consistent.
Try running acpi many times from the command line, does it always produce good output, or does it sometimes produce empty output or an error?
Are you running an experimental version of python or acpi?
from i3blocks-contrib.
https://i.imgur.com/ZbVs7op.png
https://i.imgur.com/Lu2XhNM.png
'acpi' always produces results......am stumped on this one...
from i3blocks-contrib.
Alright my ideas are increasingly far-fetched but let's give it a go.
Run sha256sum battery.py
and check that you get
78f7381d558141ee2cead04ef66d58928527cde9a3050ce74289ae3e8c92a395 battery.py
I see you are using some fancy shell/terminal. Can you try using a different shells and terminals? E.g.
bash
./battery.py
Also, if you can manage, try running a live operating system (e.g. debian live) from a usb stick and run the script from that environment.
Finally, you can try cloning https://github.com/kb100/i3blocks-battery, the repo that used to be for the battery blockelt, and see if you can find any commit where the script works. You may want to use git bisect
to ease finding what may be the offending commit.
from i3blocks-contrib.
forgive my noobness pls....have a thinkpad (p50) and installed tlp.....while going through the conf file I saw that there is BAT0 and BAT1 ...with the script is the default BAT0....could this be possibly the course of my error
from i3blocks-contrib.
This script does not default to BAT0, it (should) handle the case of multiple batteries. Have you confused this repo's battery script https://github.com/vivien/i3blocks-contrib/blob/master/battery/battery.py with the official battery script https://github.com/vivien/i3blocks/blob/master/scripts/battery in the i3blocks repo?
That script does default to BAT0.
from i3blocks-contrib.
Kb100... Thxs for feedback.... I double checked I have the correct script....
from i3blocks-contrib.
Can you follow the steps I asked from 2 posts ago with sha256sum and using different shells. Your output is not consistent with running the current version of the script.
from i3blocks-contrib.
i dont know....i got the battery in my status bar but i think its a rather messy work around ...i dont know...
i3blocks config
https://i.imgur.com/rlQb7YM.png
https://i.imgur.com/nh1lx0q.png
using this script:
https://github.com/Anachron/i3blocks/blob/master/blocks/battery
in conjunction with your srcipt (made sure i also installed all the dependencies font-awesome ...my python version 3.6.0) produces the following result:
https://i.imgur.com/3noLbhQ.png
I am hoping the info can shed some light/clarity on whats going on...obviously i would prefer to use your script with the icons on its own....
UPDATE
icons are working now
https://i.imgur.com/8RpqLUB.png
just going through the steps you kindly asked me to follow (sorry didnt see it)
checksum: https://i.imgur.com/5DGgKRC.png
current shell: vanilla zsh
terminal: termite
with bash:
https://i.imgur.com/Lvh18Oa.png
from i3blocks-contrib.
Ok I'm confused, before when you ran ./battery.py
you got no output, but now the output you posted is correct. What changed? The block is not supposed to have a fixed label. The lightning label indicates charging, the plug label indicates that the device is plugged in, the battery label indicates that the device is on battery (i.e. not plugged in).
from i3blocks-contrib.
Related Issues (20)
- volume-pipewire is not able to forward default sink when clicked on HOT 1
- confusing formatting in rofi-calendar
- bandwidth2: missing dependency
- temperature block shows wrong temperature
- The cpu_usage2 blocklet isn't working HOT 1
- The blocklet battery-poly isn't working HOT 2
- only appears the clock with date
- key_layout doesn't work because it doesn't output a \n at the end HOT 1
- Root Makefile errors
- Using Font Awesome 6 instead of Font Awesome 5 for dunst
- apt-upgrades
- Issue with Icons in volume-pipewire
- The memory2 block uses incorrect math to calculate ram usage HOT 1
- volume-pulseaudio higher than 100%
- calendar: calendar display at wrong position for different i3 bar position HOT 2
- [bandwidth] tailscale showing as "down"
- [volume_pulse] grep warning
- [mediaplayer] no output if metadata invalid
- [mediaplayer][rfc] make MPRIS a hard dependency?
- The module `cpu_usage2` doesn't compile with clang/llvm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i3blocks-contrib.