#[solved] how do I check laptops battery power status?
80 messages · Page 1 of 1 (latest)
widgets work right?
I don't have any GUI installed
Trying to keep it minimalistic
Mostly likely /sys/class/power_supply/BAT0/status
If not, see output of
ls /sys/class/power_supply/*/status
That with BAT0 exists, but how do I access it
To get battery %
Isn't that obvious?
Sorry but no
cat /sys/class/power_supply/BAT0/status
cat /sys/class/power_supply/BAT0/capacity
Thank you very much, I am just starting with arch linux so I don't know some of the things
By any chance do you know how to make a script I could run even if I am not in the same directory?
Was?
I could make a bash script which shows me battery status and %, but I have to be in the same directory or type out directory to run it
content?
Of bash script? These 2 lines
It's not like I poses some extrasensory perception. Can you post the content
cat /sys/class/power_supply/BAT0/status
cat /sys/class/power_supply/BAT0/capacity
I just noticed that for some reason me replying didn't work in few of my previous messages
I tried replying to this
How did you execute it?
If it’s in your path you can just use script.sh
Put the script in the PATH
I want to be able to use it like that no matter the path I am innit that's possible
Yes, if it’s in a directory in your PATH variable
Yep
Thanks, I'll try it tomorrow since I already turned off my pc for the night
឵឵ received a thank you cookie!
Also thank you very much for these
You're thanking too much ó_ò
Damn 2 thank you 's is too much
Too many cookies can be bad for you :/
%cookies
Hai theernis, you have 9 cookies!
You can nom one with the %nom command, or you can give a cookie to your friend using %give @friend
Nah I’ve got plenty. This is also off topic.
Yeah, I should mark this as solved now
how do I check laptops battery power status? [solved]
Doesn't work for some reason
is it marked executable
Uhm, how do I do that?
sudo chmod 0755 /usr/local/bin/script
I did that, what now?
you should be able to just type script in the terminal and it will run the script
whatever it's called
because /usr/local/bin is in $PATH
does it work?
Thank you it works
឵឵ received a thank you cookie!
yw 👍
I accidentally made it /script instead of actual script name tho
huh
oh
just sudo mv /usr/local/bin/script /usr/local/bin/NAME
where name is whatever you want
Oh, I already did sudo rm old_path, and ran commands with new path
that works too
Yeah I realized that
just make sure you don't name it the same as another command you already have
because things in /usr/local/bin take priority over things in /usr/bin (which is where commands from installed packages go)
Oh so to make sure not to overwrite stuff like vim