-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotionforlinux.sh
More file actions
45 lines (38 loc) · 1.09 KB
/
notionforlinux.sh
File metadata and controls
45 lines (38 loc) · 1.09 KB
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
#!/bin/bash
cd ~
# URL de descarga
version="0.05"
url="https://github.com/puneetsl/lotion/releases/download/V-$version/Lotion-native.tar.gz"
# Color de texto
yellow='\033[1;33m'
green='\033[1;32m'
red='\033[1;31m'
nc='\033[0m'
# Descargar el archivo
printf "${yellow}Descargando archivo...${nc}\n"
wget -q "$url" -P /tmp
# Descomprimir el archivo
printf "${yellow}Descomprimiendo archivo...${nc}\n"
sudo tar -xzf /tmp/Lotion-native.tar.gz -C /opt
# Dar permisos necesarios
printf "${yellow}Asignando permisos...${nc}\n"
sudo chmod +x /opt/Lotion/Lotion
# Crear acceso directo
printf "${yellow}Creando acceso directo...${nc}\n"
cat <<EOF > ~/.local/share/applications/Lotion.desktop
[Desktop Entry]
Name=Lotion
Exec=/opt/Lotion/Lotion
Icon=/opt/Lotion/resources/app/icon.png
Terminal=false
Type=Application
EOF
# Eliminar el archivo comprimido
printf "${yellow}Eliminando archivo comprimido...${nc}\n"
rm /tmp/Lotion-native.tar.gz
# Comprobar si se completó correctamente
if [ $? -eq 0 ]; then
printf "${green}Proceso completado con éxito.${nc}\n"
else
printf "${red}Error al completar el proceso.${nc}\n"
fi