0

i am using linux mint 17 cinnamon , well somehow i have some problemes in my laptop charger , i like my panel to be hidden so it's hard to watch if the charger is connected or not .

is there any way to configure or create a script or something to notify me if my charger is disconnected ?

1 Answer 1

1

Run this script at background:

#!/bin/bash
while :;do
    (( $(</sys/class/power_supply/ADP0/online) )) || notify-send offline
    sleep 1
done
3
  • sleep 1 will make my laptop in sleep mode ? then how to save this script to be rune automatically ?
    – melbx
    Dec 7, 2016 at 21:40
  • help i pasted the script , i've notifications even charger is connected ... notify me eight time before close it and every time write this message as output bash: /sys/class/power_supply/ADP0/online: No such file or directory
    – melbx
    Dec 7, 2016 at 21:43
  • then find your location of this file. kernel 4.8 uses this location. Dec 7, 2016 at 21:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .