-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrapi.sh
executable file
·54 lines (40 loc) · 1.11 KB
/
rapi.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
49
50
51
52
53
54
#!/bin/bash
function error_exit {
printf "\n\033[0;31mInstallation failed\033[0m\n"
cd ${base_dir}
exit 1
}
function finished {
printf "\n\033[0;92mInstallation completed\033[0m\n"
cd ${base_dir}
exit 0
}
config_dir="$HOME/.config"
caffeine_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
if [ ! -d $config_dir ]; then
mkdir -p $config_dir
fi
function install_root {
# X server and audio
apt install -y \
xserver-xorg xdm \
pulseaudio pulseaudio-utils pavucontrol \
|| return 1
# Desktop notifications
apt install -y \
dunst libnotify-bin dbus-x11 || return 1
# XDM Configuration
cp $caffeine_dir/global/etc/X11/xdm/Xresources /etc/X11/xdm/Xresources
cp $caffeine_dir/global/etc/X11/xdm/Xsetup /etc/X11/xdm/Xsetup
echo "exec i3" > $HOME/.xsession
}
function install_user {
ln -s $caffeine_dir/home/.config/dunst $config_dir/dunst
ln -s $caffeine_dir/home/.config/scripts $config_dir/scripts
}
if [ "$(id -u)" != "0" ]; then
install_user || error_exit
else
install_root || error_exit
fi
finished