-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·48 lines (34 loc) · 1.23 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
#install requirements
#check curl
if ! command -v curl &> /dev/null
then
packagesNeeded='curl'
if [ -x "$(command -v apk)" ]; then sudo apk add --no-cache $packagesNeeded
elif [ -x "$(command -v apt-get)" ]; then sudo apt-get install $packagesNeeded
elif [ -x "$(command -v dnf)" ]; then sudo dnf install $packagesNeeded
elif [ -x "$(command -v zypper)" ]; then sudo zypper install $packagesNeeded
else echo "FAILED TO INSTALL PACKAGE: Package manager not found. You must manually install: $packagesNeeded">&2; fi
fi
INSTALL_DIR=/home/`whoami`/.RedditWallPaper
rm -rf ${INSTALL_DIR}
mkdir ${INSTALL_DIR}
chmod +x src/*
cp -r src/* ${INSTALL_DIR}
chmod +x /home/`whoami`/.RedditWallPaper/*
if ! [[ -d "${INSTALL_DIR}/pics" ]]
then
mkdir /home/`whoami`/.RedditWallPaper/pics
fi
# add to path
echo "PATH=""${INSTALL_DIR}:"\$"PATH">> /home/`whoami`/.bashrc
export PATH=${INSTALL_DIR}:$PATH
#removing directory
#cd ..
#rm -rf RedditWallPaper/*
tput setaf 014
echo "installation complete"
echo "1)to select which subreddit you want type 'redwall config'"
echo "2)to get a random wallpaper from the chosen subs type 'redwall change'"
echo "3)to change backround every x seconds type 'redwall set <seconds>'"
reset=`tput sgr0`
exec bash -l