Controle da bateria
Publicado por Diogo Alexsander Cavilha (última atualização em 17/09/2015)
[ Hits: 3.632 ]
Homepage: https://github.com/diogocavilha
Quando a sua bateria chegar em 100% de carga e o cabo estiver conectado, o script vai alertar dizendo que você já pode remover o cabo.
Esse script foi feito pra não deixar a bateria viciar, mais a critério de teste. Pra mim está sendo últil. Espero que seja útil pra mais alguém.
É necessário configurar ele pra iniciar juntamente com o sistema. Para funcionar corretamente é necessário instalar o pacote acpi.
Link no github: https://github.com/diogocavilha/Battery-Indicator
#!/bin/bash
while true; do
percentage=$(upower -i $(upower -e | grep 'BAT') | grep -E "percentage\ full|percentage" | awk '{print $2}')
charger_status=$(acpi -a | awk '{print $3}')
if [ "$percentage" == "100%" ] && [ "$charger_status" == "on-line" ]; then
title="Indicador de bateria"
message="Bateria $percentage carregada.\nVocê já pode desplugar o carregador."
if [ $(which notify-send 2>/dev/null) ]; then
notify_cmd='notify-send "$title" "$message"'
fi
if [ $(which terminal-notifier 2>/dev/null) ]; then
notify_cmd='terminal-notifier -title "$title" -message "$message"'
fi
if [ $(which kdialog 2>/dev/null) ]; then
notify_cmd='kdialog --title "$title" --passivepopup "$message"'
fi
if [ $(which notify 2>/dev/null) ]; then
notify_cmd='notify --type information --title "$title" "$message"'
fi
if [ $(which zenity 2>/dev/null) ]; then
notify_cmd='zenity --info --title "$title" --text "$message" --display=:0.0'
fi
eval $notify_cmd
fi
sleep 60
done
Instalador Nagios 4.2 no Fedora 24
Prova LPI em shell script - com contador de acertos
Backup em HD Externa com Rsync
LazyDocker – Interface de Usuário em Tempo Real para o Docker
Instalando COSMIC no Linux Mint
Turbinando o Linux Mint: o poder das Nemo Actions
Inteligência Artificial no desenvolvimento de software: quando começar a usar?
O widget do Plasma 6 Área de Notificação
[Resolvido] Algo deu errado ao abrir seu perfil
Quando vocês pararam de testar distros? (14)
Problema com som no laptop (3)
Não estou conseguindo fazer funcionar meu Postfix na versão 2.4 no Deb... (2)









