forked from ppvan/nautilus-open-in-blackbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·53 lines (41 loc) · 1.03 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
#!/usr/bin/bash
EXT_PATH=nautilus-open-in-blackbox.py
restart_nautilus() {
read -p "Restart Nautilus(Files)? [Y/n]" ans
if [[ $ans == 'y' || $ans == 'Y' || $ans == '' ]]; then
nautilus -q
fi
}
install_user() {
path=$EXT_PATH
target=~/.local/share/nautilus-python/extensions/
if [[ ! -d $target ]]; then
mkdir -v -p $target
fi
cp -v $path $target
restart_nautilus
}
install_sudo() {
path=$EXT_PATH
target=/usr/share/nautilus-python/extensions/
if [[ ! -d $target ]]; then
sudo mkdir -v -p $target
fi
sudo cp -v $path $target
restart_nautilus
}
if [[ $(id -u) == 0 ]]; then
read -p "This is run with sudo, install system-wide?[Y/n]" ans
if [[ $ans == 'y' || $ans == 'Y' || $ans == '' ]]; then
install_sudo
else
echo -n "Skip install..."
fi
else
read -p "Install OpenInBlackBox?[Y/n]" ans
if [[ $ans == 'y' || $ans == 'Y' || $ans == '' ]]; then
install_user
else
echo -n "Skip install..."
fi
fi