-
Notifications
You must be signed in to change notification settings - Fork 14
/
installer
executable file
·88 lines (76 loc) · 2.02 KB
/
installer
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
#!/bin/bash
# test for dependencies
if command -v zenity >/dev/null 2>&1;
then
echo -e "Looking for zenity...OK.\n"
else
echo -e "Looking for zenity...MISSING.\nPlease install it and restart this installer.\n"
exit;
fi
if command -v xclip >/dev/null 2>&1;
then
echo -e "Looking for xclip...OK.\n"
else
echo -e "Looking for xclip...MISSING.\nPlease install it and restart this installer.\n"
exit;
fi
if command -v curl >/dev/null 2>&1;
then
echo -e "Looking for curl...OK.\n"
else
echo -e "Looking for curl...MISSING.\nPlease install it and restart this installer.\n"
exit;
fi
if [ -f config ]
then
echo "config file exists..."
else
echo -e "config file...MISSING.\nPlease edit config.sample and copy it to config before running this installer.\n"
exit;
fi
sleep 2
## nautilus specific
if [ -f /usr/bin/nautilus ]
then
echo "Nautilus installed, copying to nautilus scripts..."
cp shareLinkCreator ~/.local/share/nautilus/scripts/
cp config ~/.local/share/nautilus/scripts/
exit;
else
echo "Nautilus is not installed."
fi
# add icon
echo "Installing Nextcloud icon to your homedir (/home/$(whoami)/.icons)..."
if [ ! -d "~/.icons" ]; then
mkdir ~/.icons
fi
cp nextcloud.png ~/.icons/
# place core bash script
echo "Installing sharing script to your homedir (/home/$(whoami)/bin)..."
if [ ! -d "~/bin" ]; then
mkdir ~/bin
fi
cp shareLinkCreator ~/bin
## thunar specific
if [ -f /usr/bin/thunar ]
then
echo "Thunar installed, processing custom actions file..."
# backup original thunar actions file
cp ~/.config/Thunar/uca.xml ~/.config/Thunar/uca.xml.sharelinkBAK
# replace last line "</actions>"
sed -i '$d' ~/.config/Thunar/uca.xml
cat shareLinkCreator.thunar_action >> ~/.config/Thunar/uca.xml
echo "Restarting Thunar."
killall -9 thunar -u $(whoami)
thunar
else
echo "Thunar is not installed."
fi
## nemo specific
if [ -f /usr/bin/nemo ]
then
echo "Nemo installed, copying custom action file..."
cp shareLinkCreator.nemo.action ~/.local/share/nemo/actions/
else
echo "Nemo is not installed."
fi