-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·36 lines (29 loc) · 962 Bytes
/
install.sh
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
#!/bin/bash
# set the DBUS_SESSION_BUS_ADDRESS variable. By default cron does not have access to the variable.
mkdir $HOME/.dbus
touch $HOME/.dbus/Xdbus
chmod 600 $HOME/.dbus/Xdbus
env | grep DBUS_SESSION_BUS_ADDRESS > $HOME/.dbus/Xdbus
echo 'export DBUS_SESSION_BUS_ADDRESS' >> $HOME/.dbus/Xdbus
# install sox (an app to play music from terminal)
echo "Enter root password to install dependencies"
sudo pacman -S sox
# location of script
address=$(readlink -f eye_care.sh)
# enable cron service
echo "enabling cron.service ..."
sudo systemctl enable --now cronie.service
# set cron to run app at startup
crontab -l > .cron
echo "*/20 * * * * $address" >> .cron
crontab .cron
rm .cron
# set location of notification sound
sound_pwd=$(readlink -f eye_care_song.mp3)
echo "play $sound_pwd" | sed -i '15r /dev/stdin' ./eye_care.sh
# final reasult
if [ $? -eq 0 ]; then
echo "Eye care 20 20 20 Installed Succefully"
else
echo "Installation failed"
fi