diff --git a/Arian Theme Light/install.sh b/Arian Theme Light/install.sh index 58000e4..2cca90f 100644 --- a/Arian Theme Light/install.sh +++ b/Arian Theme Light/install.sh @@ -1,4 +1,125 @@ #!/bin/bash +# +# +# Author: Arian Hosseini - https://github.com/arianXdev +# Collaboration: Fernando Souza - https://www.youtube.com/@fernandosuporte/ | https://github.com/tuxslack +# Date: 19/01/2025 +# Script: ~/.local/share/plank/themes/Arian Theme Light/install.sh +# Version: 0.2 +# +# +# Arian Plank Theme +# +# https://www.gnome-look.org/p/1911700 +# +# ---------------------------------------------------------------------------------------- + +# Cores (tabela de cores: https://gist.github.com/avelino/3188137) + +VERM="\033[1;31m" # Deixa a saída na cor vermelho. +VERD="\033[0;32m" # Deixa a saída na cor verde. +CIAN="\033[0;36m" # Deixa a saída na cor ciano. + +NORM="\033[0m" # Volta para a cor padrão. + +# ---------------------------------------------------------------------------------------- + +# Lista dos programas a serem verificados. + +programas=("plank") + +# Variável para armazenar a lista de programas que não estão instalados. + +programas_faltando="" + +# Verifica se cada programa está instalado. + +for programa in "${programas[@]}"; do + + if ! command -v "$programa" &>/dev/null; then + + programas_faltando+="$program is not installed.\n" + + fi + +done + +# ---------------------------------------------------------------------------------------- + + +# Se algum programa não estiver instalado, exibe a tela de erro. + +if [ -n "$programas_faltando" ]; then + + echo -e "${VERM}\n\nThe following programs are not installed:\n\n$missing_programs \n ${NORM}" + + exit + +fi + +# ---------------------------------------------------------------------------------------- + + +# Verificar se o Picom está instalado. + +if ! command -v picom &> /dev/null; then + + echo -e "${VERM}\n\nPicom is not installed. \n ${NORM}" + + exit 1 + +else + + echo -e "${VERD}\nPicom is installed. \n ${NORM}" + +fi + +# ---------------------------------------------------------------------------------------- + +# Verificar se o processo Picom está rodando. + +if pgrep -x "picom" > /dev/null; then + + echo -e "${VERD}\nPicom is running. \n ${NORM}" + + killall -9 picom + +else + + echo -e "${VERM}\n\nPicom is not running. \n ${NORM}" + + # exit 2 +fi + +# ---------------------------------------------------------------------------------------- + +# Verificar se há algum erro no retorno do Picom (se há alguma mensagem de erro) + +# Rodando o Picom em segundo plano e redirecionando a saída de erro para um arquivo. + +picom &> /tmp/picom.log & + +# Espera um tempo para o Picom tentar iniciar. + +sleep 2 + +if [[ -s /tmp/picom.log ]]; then + + echo -e "${VERM}\n\nThere was an error starting Picom. Check /tmp/picom.log for details. \n ${NORM}" + + cat /tmp/picom.log + + exit 3 +else + echo -e "${VERD}\nPicom started successfully without errors. \n ${NORM}" +fi + +# Limpeza + +rm /tmp/picom.log + +# ---------------------------------------------------------------------------------------- + read -p "Do you want to install Arian theme (Light version) for Plank?" answer @@ -23,12 +144,23 @@ case "$answer" in *) esac else - echo "Couldn't find $PLANK_DIR" - echo "Please Make sure Plank Dock is installed properly" - echo "For Arch-based distros: Try 'sudo pacman -S plank'" - echo "In Debian-based distros: Try 'sudo apt install plank'" + + echo -e "${VERD} + + Couldn't find $PLANK_DIR + + Please Make sure Plank Dock is installed properly + + For Arch-based distros: Try '# pacman -S plank' + + For Void Linux-based distros: Try '# xbps-install -Suvy plank' + + In Debian-based distros: Try '# apt install -y plank' + + ${NORM}" + exit 1 - fi + fi ;; *) diff --git a/Arian Theme/install.sh b/Arian Theme/install.sh index b41d901..0c45b56 100644 --- a/Arian Theme/install.sh +++ b/Arian Theme/install.sh @@ -1,4 +1,125 @@ #!/bin/bash +# +# +# Author: Arian Hosseini - https://github.com/arianXdev +# Collaboration: Fernando Souza - https://www.youtube.com/@fernandosuporte/ | https://github.com/tuxslack +# Date: 19/01/2025 +# Script: ~/.local/share/plank/themes/Arian Theme/install.sh +# Version: 0.2 +# +# +# Arian Plank Theme +# +# https://www.gnome-look.org/p/1911700 +# +# ---------------------------------------------------------------------------------------- + +# Cores (tabela de cores: https://gist.github.com/avelino/3188137) + +VERM="\033[1;31m" # Deixa a saída na cor vermelho. +VERD="\033[0;32m" # Deixa a saída na cor verde. +CIAN="\033[0;36m" # Deixa a saída na cor ciano. + +NORM="\033[0m" # Volta para a cor padrão. + +# ---------------------------------------------------------------------------------------- + +# Lista dos programas a serem verificados. + +programas=("plank") + +# Variável para armazenar a lista de programas que não estão instalados. + +programas_faltando="" + +# Verifica se cada programa está instalado. + +for programa in "${programas[@]}"; do + + if ! command -v "$programa" &>/dev/null; then + + programas_faltando+="$program is not installed.\n" + + fi + +done + +# ---------------------------------------------------------------------------------------- + + +# Se algum programa não estiver instalado, exibe a tela de erro. + +if [ -n "$programas_faltando" ]; then + + echo -e "${VERM}\n\nThe following programs are not installed:\n\n$missing_programs \n ${NORM}" + + exit + +fi + +# ---------------------------------------------------------------------------------------- + + +# Verificar se o Picom está instalado. + +if ! command -v picom &> /dev/null; then + + echo -e "${VERM}\n\nPicom is not installed. \n ${NORM}" + + exit 1 + +else + + echo -e "${VERD}\nPicom is installed. \n ${NORM}" + +fi + +# ---------------------------------------------------------------------------------------- + +# Verificar se o processo Picom está rodando. + +if pgrep -x "picom" > /dev/null; then + + echo -e "${VERD}\nPicom is running. \n ${NORM}" + + killall -9 picom + +else + + echo -e "${VERM}\n\nPicom is not running. \n ${NORM}" + + # exit 2 +fi + +# ---------------------------------------------------------------------------------------- + +# Verificar se há algum erro no retorno do Picom (se há alguma mensagem de erro) + +# Rodando o Picom em segundo plano e redirecionando a saída de erro para um arquivo. + +picom &> /tmp/picom.log & + +# Espera um tempo para o Picom tentar iniciar. + +sleep 2 + +if [[ -s /tmp/picom.log ]]; then + + echo -e "${VERM}\n\nThere was an error starting Picom. Check /tmp/picom.log for details. \n ${NORM}" + + cat /tmp/picom.log + + exit 3 +else + echo -e "${VERD}\nPicom started successfully without errors. \n ${NORM}" +fi + +# Limpeza + +rm /tmp/picom.log + +# ---------------------------------------------------------------------------------------- + read -p "Do you want to install Arian theme for Plank?" answer @@ -23,10 +144,21 @@ case "$answer" in *) esac else - echo "Couldn't find $PLANK_DIR" - echo "Please Make sure Plank Dock is installed properly" - echo "For Arch-based distros: Try 'sudo pacman -S plank'" - echo "In Debian-based distros: Try 'sudo apt install plank'" + + echo -e "${VERD} + + Couldn't find $PLANK_DIR + + Please Make sure Plank Dock is installed properly + + For Arch-based distros: Try '# pacman -S plank' + + For Void Linux-based distros: Try '# xbps-install -Suvy plank' + + In Debian-based distros: Try '# apt install -y plank' + + ${NORM}" + exit 1 fi diff --git a/README.md b/README.md index d07710e..14efe8e 100644 --- a/README.md +++ b/README.md @@ -47,19 +47,56 @@ yay -S plank-theme-arian-git ![Linux Icon](https://img.shields.io/badge/manjaro-35BF5C?style=for-the-badge&logo=manjaro&logoColor=white) ![Linux Icon](https://img.shields.io/badge/Artix_Linux-10A0CC?style=for-the-badge&logo=artix-linux&logoColor=white) -### Other Distributions / Manually +### Void Linux (dependency installation) + ```Shell + +# xbps-install -Suvy plank picom + +$ mkdir -p $HOME/.local/share/plank/themes + +``` + +Configuring Picom on Void Linux. + +```Shell +$ killall -9 picom + +$ rm -Rf ~/.config/picom/ or mv -i ~/.config/picom ~/.config/picom-backup + +$ mkdir -p ~/.config/picom/ + +$ cp /usr/share/examples/picom/picom.sample.conf ~/.config/picom/picom.conf + +$ picom & +``` +### Clone the repository + +```Shell +$ killall -9 plank + git clone https://github.com/ryanhosseini/arian-plank-theme.git cd arian-plank-theme/ sh install.sh ``` +### Other Distributions / Manually +```Shell +$ killall -9 plank + +git clone https://github.com/ryanhosseini/arian-plank-theme.git +cd arian-plank-theme/ +sh install.sh + +``` + ![Linux Icon](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black) ![Linux Icon](https://img.shields.io/badge/Debian-A81D33?style=for-the-badge&logo=debian&logoColor=white) ![Linux Icon](https://img.shields.io/badge/Fedora-294172?style=for-the-badge&logo=fedora&logoColor=white) ![Linux Icon](https://img.shields.io/badge/Linux_Mint-87CF3E?style=for-the-badge&logo=linux-mint&logoColor=white) ![Linux Icon](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white) ![Linux Icon](https://img.shields.io/badge/Cent%20OS-262577?style=for-the-badge&logo=CentOS&logoColor=white) +![ Linux Icon](https://avatars.githubusercontent.com/u/37247796?s=80&v=4)
diff --git a/install.sh b/install.sh index d303163..aec61d0 100644 --- a/install.sh +++ b/install.sh @@ -1,36 +1,104 @@ #!/bin/bash +# +# +# Author: Arian Hosseini - https://github.com/arianXdev +# Collaboration: Fernando Souza - https://www.youtube.com/@fernandosuporte/ | https://github.com/tuxslack +# Date: 19/01/2025 +# Script: ~/.local/share/plank/themes/Arian Theme/install.sh +# Version: 0.2 +# +# +# Arian Plank Theme +# +# https://www.gnome-look.org/p/1911700 +# +# ---------------------------------------------------------------------------------------- -read -p "Do you want to install Arian theme for Plank?" answer +programas=("picom" "plank") + +# Verificar cada programa + +for prog in "${programas[@]}"; do + + if command -v "$prog" &> /dev/null; then + + echo -e "\n$prog is installed.\n" + + else + + echo -e "\n$prog is not installed.\n" + + exit 1 + + fi + +done + +# ---------------------------------------------------------------------------------------- + +read -p "Do you want to install Arian theme for Plank? (y/n) " answer PLANK_DIR="$HOME/.local/share/plank/themes" +SOURCE_DIR="./Arian Theme" +SOURCE_LIGHT_DIR="./Arian Theme Light" case "$answer" in [yY][eE][sS]|[yY]|"") + + echo "Installing... Please wait!" + + # Verificar se os diretórios de origem existem + + if [ -d "$SOURCE_DIR" ] && [ -d "$SOURCE_LIGHT_DIR" ]; then + + # Verificar se o diretório de instalação do Plank existe + + if [ -d "$PLANK_DIR" ]; then + + cp -Ri "$SOURCE_DIR" "$PLANK_DIR" && cp -Ri "$SOURCE_LIGHT_DIR" "$PLANK_DIR" + + echo "Done!" + + read -p "Arian theme for Plank has been installed successfully! Do you want to open Plank preferences? (y/n) " answer + + case "$answer" in + [yY][eE][sS]|[yY]|"") + + plank --preferences & + + echo "Finish! Enjoy it :)" + + ;; + *) + + echo "Skipping Plank preferences." + + ;; + esac + else + + echo "Couldn't find $PLANK_DIR" + echo "" + echo "Please make sure Plank Dock is installed properly." + echo "For Arch-based distros: Try '# pacman -S plank'" + echo "For Void Linux-based distros: Try '# xbps-install -Suvy plank'" + echo "In Debian-based distros: Try '# apt install -y plank'" + + exit 1 + fi + else + + echo "Couldn't find the theme directories: '$SOURCE_DIR' or '$SOURCE_LIGHT_DIR'" + + exit 1 + fi + ;; + *) + + echo "Installation aborted." + + exit 2 + ;; +esac - echo "Installing... Please wait!" - - if [ -d $PLANK_DIR ]; then - cp -Ri ./"Arian Theme" $PLANK_DIR && cp -Ri ./"Arian Theme Light" $PLANK_DIR - - echo "Done!" - read -p "Arian theme for Plank has been installed successfully! Do you want to open Plank preferences?" answer - - case "$answer" in - [yY][eE][sS]|[yY]|"") - plank --preferences - - echo "Finish! Enjoy it :)" - ;; - *) - esac - else - echo "Couldn't find $PLANK_DIR" - echo "Please Make sure Plank Dock is installed properly" - echo "For Arch-based distros: Try 'sudo pacman -S plank'" - echo "In Debian-based distros: Try 'sudo apt install plank'" - exit 1 - fi - - ;; -*) -esac \ No newline at end of file +exit 0