Aller au contenu
onsuggest
Connexion
Article en

Annoyance on low battery

Source: 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 "

Raccourcis clavier

Découverte précédente
←P
Découverte suivante
→N
J'aime
L
Pas pour moi
X
Enregistrer
S
Afficher cette aide
?
Fermer
Esc

Les raccourcis fonctionnent sur la page des découvertes.