Add script for time notification
This commit is contained in:
parent
d157d92a7f
commit
f1a68680a8
|
@ -3,16 +3,14 @@
|
|||
# Run this script as a cronjob every 5 minutes or so, to get notifications when
|
||||
# battery percentage goes below 30% or above 80%.
|
||||
# Cronjob line example:
|
||||
# */5 * * * * /bin/bash /path/to/battery_health_notifications.sh
|
||||
# */5 * * * * /bin/bash /path/to/battery-notification.sh
|
||||
|
||||
# This line is to make notify-send always work, also when run in a crontab.
|
||||
# https://askubuntu.com/questions/298608/notify-send-doesnt-work-from-crontab/346580#346580
|
||||
#
|
||||
# Credits to gitaarik: https://gitlab.com/gitaarik/battery-health-notifications/-/blob/master/battery_health_notifications.sh
|
||||
|
||||
export $(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session | head -n 1)/environ | tr '\0' '\n')
|
||||
|
||||
wall "It's good"
|
||||
# export $(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session | head -n 1)/environ | tr '\0' '\n')
|
||||
|
||||
BATTERY_PATH=$(upower -e | grep battery)
|
||||
LINE_POWER_PATH=$(upower -e | grep line_power)
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
# Run this as a cron job to announce stop time
|
||||
# 0 22 * * * /bin/bash /path/to/time-notification.sh
|
||||
|
||||
mpc stop
|
||||
xmessage "Please stop working." & mplayer /usr/lib64/libreoffice/share/gallery/sounds/explos.wav
|
Loading…
Reference in New Issue