-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install
executable file
·55 lines (43 loc) · 1.3 KB
/
Install
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
#!/bin/bash
# DropFilter Installer
if command -v DropFilter &> /dev/null; then
installed_path=$(command -v DropFilter)
echo "DropFilter is already installed at $installed_path."
echo "Aborted."
exit 1
fi
version=$(python3 -c "from DropFilter import Version; print(Version)")
path=''
if [ $EUID -eq 0 ]; then
path='/usr'
else
read -p "No sudo, install DropFilter only for $USER? (Y/N): " choice
if [[ $choice != [Yy]* ]]; then
echo "Aborted."
exit
fi
path=$HOME/.local
fi
cp DropFilter.py $path/bin/DropFilter
echo "DropFilter installed."
mkdir -p $path/share/icons/hicolor/scalable/apps
cp ArtWork/DropFilter_icon.svg $path/share/icons/hicolor/scalable/apps/DropFilter.svg
echo "Making .desktop file."
touch $path/share/applications/DropFilter.desktop
cat <<EOL > $path/share/applications/DropFilter.desktop
[Desktop Entry]
Encoding=UTF-8
Name=DropFilter
Comment=Version $version - Created by Enzo 'Zvorky' Delevatti
Comment[pt_BR]=Versão $version - Criado por Enzo 'Zvorky' Delevatti
GenericName=File Organizer
GenericName[pt_BR]=Organizador de Arquivos
Type=Application
Categories=System;Files;
Exec=DropFilter
Terminal=false
Icon=$path/share/icons/hicolor/scalable/apps/DropFilter.svg
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=0
EOL
echo "Done!"