Message from @Big T
Discord ID: 605697128156889106
um, team jacob signing off
you just made a kid somewhere gay
lol
ah you dont like java, that makes sense then.
i like java
<- Oracle Certified Associate Programmer
idk if i dont like it, that was more than a few years ago, but i havent worked with a strictly defined language in at least a year
or whatever the term is
oh wait no i used VB
<:grrr:531619820697944092> <:grrr:531619820697944092> <:grrr:531619820697944092> <:grrr:531619820697944092> <:grrr:531619820697944092> <:grrr:531619820697944092> <:grrr:531619820697944092> <:grrr:531619820697944092> <:grrr:531619820697944092>
...
VB is globohomo
statically typed languages are great
it took me all night to get the bones and tendons of this idea out onto a shell script
whats the idea? and why would you use a shell script for it lol?
easier to write than a python script cuz i dont wanna encase everything in a fuckin function
so my linux machine is my laptop and i want to be able to have it on at all times so tasks and bots can run all the time
you technically dont have to with python
so i bought a pack of smart plugs....
and even if you had to wrap it with a function, its only 2 more lines
function definition and a line calling it
but again, you can just write python with out any function declarations.
im gonna use this to toggle the smart plug
(work in progress, got some shit to move around)
```
upower -i $(upower -e | grep BAT) | egrep 'state|percentage' > .power-temp
cut -c 26- .power-temp | sponge .power-temp
STATE=`head -1 .power-temp`
PERC=`tail -1 .power-temp | cut -c -2`
case $STATE in
charging)
echo charging
;;
discharging)
echo discharging
;;
fully-charged)
echo fully-charged
;;
esac
if [ $PERC -le '20' ]; then
echo '<=20%'
fi
rm .power-temp
```
ew
ikr
it's aids
why write that then?
cuz i didnt know how to do it efficiently with python
people keep telling me that but idk how
does the smart plug have an api?
think so
it works with IFTTT and Alexa n shit so i assume so
start there
well i dont have the plug yet so ill redesign it when i get it
have my laptop charger only be receiving power when the laptop needs to be charged
cronjob will check every 5 minutes for if it's 20% or under
cuz it looks like all you are doing is querying the status of the plug and then running a switch statement