本文へスキップ
onsuggest
ログイン
記事 en

Annoyance on low battery

情報源: 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 "

キーボードショートカット

前の発見
←P
次の発見
→N
いいね
L
合わない
X
保存
S
このヘルプを表示
?
閉じる
Esc

ショートカットは発見ページで使えます。