-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·154 lines (128 loc) · 4.63 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash
cpcfg() {
echo "Installing $1"
cp "$1" "$HOME"/"$1"
}
cpcfgd() {
echo "Installing $1"
cp "$1" "$HOME"/"$2"/"$1"
}
cpcfgdf() {
echo "Installing $1"
cp "$1" "$HOME"/"$2"
}
fastcomputermessage() {
echo "Done!"
echo "The new config file is optimized for a fast computer by default. You can choose using the 'mpvcfgset' command."
}
echo "Creating melonDS config dir"
mkdir -p "$HOME"/.config/melonDS
echo "Creating Bash config dir"
mkdir -p "$HOME"/.config/bash-configs
echo "Creating Kitty config dir"
mkdir -p "$HOME"/.config/kitty
echo "Creating i3 config dir"
mkdir -p "$HOME"/.config/i3
echo "Creating compton config dir"
mkdir -p "$HOME"/.config/compton
echo "Creating BleachBit config dir"
mkdir -p "$HOME"/.config/bleachbit
echo "Creating Openbox config dir"
mkdir -p "$HOME"/.config/openbox
echo "Creating qutebrowser config dir"
mkdir -p "$HOME"/.config/qutebrowser
echo "Creating mpv config dir"
mkdir -p "$HOME"/.config/mpv
echo "Creating Git config dir"
mkdir -p "$HOME"/.config/git
echo "Creating Conky config dir"
mkdir -p "$HOME"/.config/conky
echo "Creating GDB config dir"
mkdir -p "$HOME"/.config/gdb
cpcfg .profile
cpcfg .vimrc
cpcfgd kitty.conf .config/kitty
cpcfgd compton.conf .config/compton
cpcfgd melonDS.ini .config/melonDS
cpcfgd bleachbit.ini .config/bleachbit
cpcfgd gdbinit .config/gdb
cpcfgdf i3cfg .config/i3/config
cpcfgdf qutebrowser.py .config/qutebrowser/config.py
cpcfgdf obrc.xml .config/openbox/rc.xml
cpcfgdf obautostart.sh .config/openbox/autostart.sh
cpcfgdf mpvinput.conf .config/mpv/input.conf
cpcfgdf .gitconfig .config/git/config
cpcfgdf .conkyrc .config/conky/conkyrc
echo "Setting up mpv config symlink"
if [ -L "$HOME"/.config/mpv/mpv.conf ]; then
echo "mpv config symlink already set up"
elif [ -f "$HOME"/.config/mpv/mpv.conf ]; then
echo "mpv config file is NOT a symlink"
echo "Replace with symlink? A copy of the file will be created in $(pwd) under the name 'mpv.conf.old'."
read -p "(y = yes, n = no) : " yn
case $yn in
[Yy]* )
mv "$HOME"/.config/mpv/mpv.conf ./mpv.conf.old
ln -s "$(pwd)"/mpv-fastcomputer.conf "$HOME"/.config/mpv/mpv.conf
fastcomputermessage
;;
[Nn]* )
echo "Okay, keeping the old config file."
;;
* )
echo "I'll take this as a no."
;;
esac
else
echo "mpv config file not found, creating symlink"
ln -s "$(pwd)"/mpv-fastcomputer.conf "$HOME"/.config/mpv/mpv.conf
fastcomputermessage
fi
# TODO make this a function
echo "Setting up bashrc symlink"
if [ -L "$HOME"/.bashrc ]; then
echo "Bashrc symlink already set up"
elif [ -f "$HOME"/.bashrc ]; then
echo "Bashrc is NOT a symlink"
echo "Replace with symlink? A copy of the file will be created in $(pwd) under the name 'bashrc.old'."
read -p "(y = yes, n = no) : " yn
case $yn in
[Yy]* )
mv "$HOME"/.bashrc ./bashrc.old
ln -s "$(pwd)"/.bashrc "$HOME"/.bashrc
echo "Done!"
;;
[Nn]* )
echo "Okay, keeping the old bashrc."
;;
* )
echo "I'll take this as a no."
;;
esac
else
echo "Bashrc not found, creating symlink"
ln -s "$(pwd)"/.bashrc "$HOME"/.bashrc
echo "Done!"
fi
if [ -d "$HOME/.config/jellyfin-mpv-shim" ]; then
echo "Setting up Jellyfin mpv shim symlinks"
echo "Any previous configuration will be moved to the home directory"
if [ ! -L "$HOME/.config/jellyfin-mpv-shim/mpv.conf" ] && [ -L "$HOME/.config/mpv/mpv.conf" ]; then
echo "Setting up mpv.conf symlink"
[ -f "$HOME/.config/jellyfin-mpv-shim/mpv.conf" ] && mv "$HOME/.config/jellyfin-mpv-shim/mpv.conf" "$HOME/jellyfin_mpv.conf.old" || true
ln -s "$HOME/.config/mpv/mpv.conf" "$HOME/.config/jellyfin-mpv-shim/mpv.conf"
fi
if [ ! -L "$HOME/.config/jellyfin-mpv-shim/input.conf" ]; then
echo "Setting up input.conf symlink"
[ -f "$HOME/.config/jellyfin-mpv-shim/input.conf" ] && mv "$HOME/.config/jellyfin-mpv-shim/input.conf" "$HOME/jellyfin_mpv_input.conf.old" || true
ln -s "$HOME/.config/mpv/input.conf" "$HOME/.config/jellyfin-mpv-shim/input.conf"
fi
if [ ! -L "$HOME/.config/jellyfin-mpv-shim/scripts" ]; then
echo "Setting up script directory symlink"
[ -d "$HOME/.config/jellyfin-mpv-shim/scripts" ] && mv "$HOME/.config/jellyfin-mpv-shim/scripts" "$HOME/jellyfin_mpv_scripts_old" || true
ln -s "$HOME/.config/mpv/scripts" "$HOME/.config/jellyfin-mpv-shim/scripts"
fi
else
echo "Jellyfin mpv shim config directory not found, skip symlink setup"
fi
echo "Success"