-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomandos_shell.py
More file actions
53 lines (48 loc) · 1.38 KB
/
comandos_shell.py
File metadata and controls
53 lines (48 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import subprocess
def checar():
baterry = subprocess.check_output(['acpi','-b'])
sensors = subprocess.check_output(['acpi','-t'])
return baterry, sensors
bateria = str(checar()[0])
nova = bateria.split(":")[1]
nova = nova.split(",")[1]
nova = nova.split("%")[0]
nova = nova.strip()
novainter = int(nova)
sens = str(checar()[1])
sensor = sens.split(",")[1]
sensor = sensor.strip()
sensor = sensor.split(" ")[0]
sensorinter = float(sensor)
if 10 <= novainter <= 15:
msg = f'CUIDADO! Bateria acabando!: {nova}%'
subprocess.call(['notify-send',msg])
print(msg)
elif 1 <= novainter <= 5:
msg = f'FERRO! Corre pra pluga essa birosca! Bateria: {nova}%'
subprocess.call(['notify-send',msg])
print(msg)
elif novainter == 50:
msg = f'Metade! Bateria: {nova}%'
subprocess.call(['notify-send',msg])
print(msg)
elif novainter == 75:
msg = f'Ta tranquilo, bateria: {nova}%'
subprocess.call(['notify-send',msg])
print(msg)
elif novainter == 100:
msg = f'FullBaterry!!! {nova}%'
subprocess.call(['notify-send',msg])
print(msg)
if 50 <= sensorinter <= 60:
msg = f'CUIDADO! 50 GRAUS + !: {sensor}%'
subprocess.call(['notify-send',msg])
print(msg)
elif 60 <= sensorinter <= 70:
msg = f'DESLIGA AI QUE VAI QUEIMA!: {sensor}%'
subprocess.call(['notify-send',msg])
print(msg)
elif sensorinter >= 70:
msg = f'PERDENDO CPU EM 3..2..1.. MTU QUENTE!: {sensor}%'
subprocess.call(['notify-send',msg])
print(msg)