Zum Inhalt springen
onsuggest
Anmelden
Artikel en

Annoyance on low battery

Quelle: cosarara.me ·

Laptops should be a bit annoying when they are low on battery. Otherwise, I will not realise it until it’s too late, and my computer will turn off in the middle of whatever I was doing. Proper linux Desktop Environments already do this, but since I am running the Awesome window manager with a custom config, I only get what I add myself. My solution is as follows. First, the annoyance script: ~/.local/bin/checkbattery #!/usr/bin/env python3 import subprocess import math import sys with open ( '/sys/class/power_supply/BAT0/status' ) as f : status = f . read () if status in [ "Charging \n "

Tastaturkürzel

Vorherige Entdeckung
←P
Nächste Entdeckung
→N
Mögen
L
Nicht für mich
X
Speichern
S
Diese Hilfe anzeigen
?
Schließen
Esc

Die Kürzel funktionieren auf der Entdeckungsseite.