83 lines
3.1 KiB
Bash
83 lines
3.1 KiB
Bash
#!/bin/bash
|
|
|
|
URL="https://libregit.org/heckyel/i3-config.git"
|
|
|
|
while true
|
|
do
|
|
function _copy_i3_config() {
|
|
## Install dependencies
|
|
if [[ $(command -v pacman) ]]; then
|
|
sudo pacman -Syy
|
|
# i3 base
|
|
sudo pacman -S i3-wm i3status dmenu sysstat
|
|
# i3 blocks and dependecies
|
|
sudo pacman -S i3blocks i3lock rofi termite \
|
|
dunst conky playerctl acpi \
|
|
scrot xfce4-terminal thunar tumbler feh ranger \
|
|
ttf-hack ttf-bitstream-vera
|
|
elif [[ $(command -v apt-get) ]]; then
|
|
sudo apt update
|
|
# i3 base
|
|
sudo apt install i3-wm i3status suckless-tools sysstat
|
|
# i3 blocks and dependecies
|
|
sudo apt install i3blocks i3lock rofi termite dunst \
|
|
conky playerctl acpi network-manager-gnome scrot \
|
|
xfce4-terminal thunar tumbler feh ranger \
|
|
fonts-hack-ttf ttf-bitstream-vera
|
|
fi
|
|
|
|
# Install i3config
|
|
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Cloning i3-config...' '\e[m'
|
|
git clone "$URL" "/tmp/i3config/" --depth=1
|
|
|
|
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Copying images...' '\e[m'
|
|
install -d -m755 "$HOME/.config/i3/images"
|
|
for i in background.png imagelock.png; do
|
|
install -m644 -v /tmp/i3config/images/$i "$HOME/.config/i3/images/$i"
|
|
done
|
|
|
|
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Copying scripts...' '\e[m'
|
|
cp -rv /tmp/i3config/scripts "$HOME/.config/i3/"
|
|
|
|
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Copying i3-config...' '\e[m'
|
|
for i in config i3blocks.conf; do
|
|
install -m644 -v /tmp/i3config/$i "$HOME/.config/i3/$i"
|
|
done
|
|
|
|
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Copying conky...' '\e[m'
|
|
install -d -m755 "$HOME/.config/conky/"
|
|
install -m644 -v /tmp/i3config/tmp/conky.conf "$HOME/.config/conky/"
|
|
|
|
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Copying FontAwesome...' '\e[m'
|
|
install -m644 -v /tmp/i3config/tmp/fontawesome.ttf "$HOME/.local/share/fonts/"
|
|
|
|
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Copying termite-config...' '\e[m'
|
|
install -d -m755 "$HOME/.config/termite"
|
|
install -m644 -v /tmp/i3config/tmp/termite "$HOME/.config/termite/config"
|
|
|
|
# clean up temp files
|
|
rm -rf /tmp/i3config/
|
|
}
|
|
|
|
case ${LANG/_*/} in
|
|
es)
|
|
read -r -p "¿Estás seguro de instalar i3config? [S/n]: " input
|
|
case $input in
|
|
[sS]|"") _copy_i3_config "$@"; break ;;
|
|
[nN]) break ;;
|
|
*) echo "Por favor responde sí o no" ;;
|
|
esac
|
|
;;
|
|
*)
|
|
read -r -p "Are you sure to install i3config? [Y/n]: " input
|
|
case $input in
|
|
[yY]|"") _copy_i3_config "$@"; break ;;
|
|
[nN]) break ;;
|
|
*) echo "Please answer yes or no.";;
|
|
esac
|
|
;;
|
|
esac
|
|
done
|
|
|
|
unset URL
|