#[solved] how do I check laptops battery power status?

80 messages · Page 1 of 1 (latest)

uneven cloak
#

I would like to be able to see it using some command or smth, because I had few times lately when I forgot to plug in power supply and had my laptop power off

uneven cloak
austere sierra
#

damn

#

why not?

#

i have never seen someone like that

uneven cloak
stable quiver
uneven cloak
#

To get battery %

stable quiver
uneven cloak
#

Sorry but no

stable quiver
stable quiver
uneven cloak
#

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?

uneven cloak
# stable quiver 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

uneven cloak
#

Of bash script? These 2 lines

stable quiver
uneven cloak
#
cat /sys/class/power_supply/BAT0/status
cat /sys/class/power_supply/BAT0/capacity
uneven cloak
uneven cloak
uneven cloak
#

If I put it in script.sh I would execute it with ./script.sh or directory/script.sh

old mirage
#

If it’s in your path you can just use script.sh

uneven cloak
old mirage
#

Yes, if it’s in a directory in your PATH variable

twilit heron
#

then you can just run script

#

anywhere

old mirage
#

Yep

uneven cloak
sand flameBOT
#

឵឵ received a thank you cookie!

uneven cloak
sand flameBOT
#

You're thanking too much ó_ò

uneven cloak
#

Damn 2 thank you 's is too much

old mirage
#

Too many cookies can be bad for you :/

uneven cloak
#

%cookies

sand flameBOT
# uneven cloak %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

uneven cloak
#

You want one?

old mirage
#

Nah I’ve got plenty. This is also off topic.

uneven cloak
#

Yeah, I should mark this as solved now

#

how do I check laptops battery power status? [solved]

old mirage
#

Put solved at the beginning

#

It might not be visible on smaller screens at the end

uneven cloak
#

Oh ok

#

[solved] how do I check laptops battery power status?

uneven cloak
twilit heron
#

is it marked executable

uneven cloak
#

Uhm, how do I do that?

twilit heron
#

sudo chmod 0755 /usr/local/bin/script

uneven cloak
twilit heron
#

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?

sand flameBOT
#

឵឵ received a thank you cookie!

twilit heron
#

yw 👍

uneven cloak
#

I accidentally made it /script instead of actual script name tho

twilit heron
#

huh

#

oh

#

just sudo mv /usr/local/bin/script /usr/local/bin/NAME

#

where name is whatever you want

uneven cloak
#

Oh, I already did sudo rm old_path, and ran commands with new path

twilit heron
#

that works too

uneven cloak
#

Thanks again, quick question can I use this method to run compiled C code

twilit heron
#

yes

#

just copy the binary to the same dir

uneven cloak
#

Yeah I realized that

twilit heron
#

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)

uneven cloak
#

Oh so to make sure not to overwrite stuff like vim

twilit heron
#

you can also copy stuff to /usr/bin, but this is not recommended; /usr/* should only be managed by the package manager
/usr/local/* is for things the user does outside of the package manager

#

yeah