1
0
Fork 0

[AUTOCONFIG] Add window manager i3 and awesome with basics configs

This commit is contained in:
Florian RICHER 2022-01-04 21:32:15 +01:00
parent 2f45fe5397
commit 5385467911
6 changed files with 66 additions and 15 deletions

8
.env
View file

@ -5,11 +5,13 @@
# SHELL=zsh
# Available configuration (awesome, i3)
WM=awesome
WINDOW_MANAGER=awesome
WITH_WINDOW_MANAGER_DEPENDENCIES=yes
WITH_WINDOW_MANAGER_CONFIG=yes
# Install neovim with custom configuration
WITH_NEOVIM=yes
WITH_NEOVIM_DEPENDENCIES=yes
# Possible value = yes | no | force
WITH_CUSTOM_NEOVIM_CONFIG=yes
WITH_CUSTOM_LAZYGIT_CONFIG=yes
WITH_NEOVIM_CONFIG=yes
WITH_LAZYGIT_CONFIG=yes

View file

@ -1,7 +0,0 @@
#!/bin/sh
CWD=$(pwd)
[ ! -f "$HOME/.config/nvim" ] && ln -s "$CWD/nvim" "$HOME/.config/nvim"
[ ! -f "$HOME/.config/i3" ] && ln -s "$CWD/i3" "$HOME/.config/i3"
[ ! -f "$HOME/.config/lazygit" ] && ln -s "$CWD/lazygit" "$HOME/.config/lazygit"
[ ! -f "$HOME/.config/awesome" ] && ln -s "$CWD/awesome" "$HOME/.config/awesome"

View file

@ -25,4 +25,6 @@ fi
find ./scripts -type f -iname "*.sh" -exec chmod +x {} \;
# Install and configure functionality
./scripts/tools/neovim/install.sh
./scripts/tools/neovim/install.sh
./scripts/window_manager/awesome/install.sh
./scripts/window_manager/i3/install.sh

View file

@ -12,8 +12,8 @@ if [[ "$WITH_NEOVIM" == 'yes' ]]; then
echo '[INFO] Neovim already installed'
fi
if [[ "$WITH_CUSTOM_LAZYGIT_CONFIG" == 'yes' || "$WITH_CUSTOM_LAZYGIT_CONFIG" == 'force' ]]; then
if [[ -d "$HOME/.config/lazygit" && "$WITH_CUSTOM_LAZYGIT_CONFIG" == 'force' ]]; then
if [[ "$WITH_LAZYGIT_CONFIG" == 'yes' || "$WITH_LAZYGIT_CONFIG" == 'force' ]]; then
if [[ -d "$HOME/.config/lazygit" && "$WITH_LAZYGIT_CONFIG" == 'force' ]]; then
rm -rf "$HOME/.config/lazygit"
echo '[INFO] Lazygit config removed | Forced by environment variable'
fi
@ -25,8 +25,8 @@ if [[ "$WITH_NEOVIM" == 'yes' ]]; then
fi
fi
if [[ "$WITH_CUSTOM_NEOVIM_CONFIG" == 'yes' || "$WITH_CUSTOM_NEOVIM_CONFIG" == 'force' ]]; then
if [[ -d "$HOME/.config/nvim" && "$WITH_CUSTOM_NEOVIM_CONFIG" == 'force' ]]; then
if [[ "$WITH_NEOVIM_CONFIG" == 'yes' || "$WITH_NEOVIM_CONFIG" == 'force' ]]; then
if [[ -d "$HOME/.config/nvim" && "$WITH_NEOVIM_CONFIG" == 'force' ]]; then
rm -rf "$HOME/.config/nvim"
echo '[INFO] Neovim config removed | Forced by environment variable'
fi

View file

@ -0,0 +1,27 @@
source ./scripts/common.sh
if [[ "$WINDOW_MANAGER" == 'awesome' ]]; then
if ! command_exists awesome; then
install_package awesome
echo '[INFO] Awesome installed'
if [[ "$WITH_WINDOW_MANAGER_DEPENDENCIES" == 'yes' ]]; then
#install_package ripgrep fd dart lazygit rust-analyzer lldb
fi
else
echo '[INFO] Awesome already installed'
fi
if [[ "$WITH_WINDOW_MANAGER_CONFIG" == 'yes' || "$WITH_WINDOW_MANAGER_CONFIG" == 'force' ]]; then
if [[ -d "$HOME/.config/awesome" && "$WITH_WINDOW_MANAGER_CONFIG" == 'force' ]]; then
rm -rf "$HOME/.config/awesome"
echo '[INFO] Awesome config removed | Forced by environment variable'
fi
if [[ ! -d "$HOME/.config/awesome" ]]; then
ln -s "$CWD/configs/awesome" "$HOME/.config/awesome"
echo "[INFO] Awesome config linked with symbolic link : $CWD/configs/awesome -> $HOME/.config/awesome"
else
echo '[INFO] Awesome config already linked'
fi
fi
fi

View file

@ -0,0 +1,27 @@
source ./scripts/common.sh
if [[ "$WINDOW_MANAGER" == 'i3' ]]; then
if ! command_exists i3; then
install_package i3-wm
echo '[INFO] I3 installed'
if [[ "$WITH_WINDOW_MANAGER_DEPENDENCIES" == 'yes' ]]; then
#install_package ripgrep fd dart lazygit rust-analyzer lldb
fi
else
echo '[INFO] I3 already installed'
fi
if [[ "$WITH_WINDOW_MANAGER_CONFIG" == 'yes' || "$WITH_WINDOW_MANAGER_CONFIG" == 'force' ]]; then
if [[ -d "$HOME/.config/i3" && "$WITH_WINDOW_MANAGER_CONFIG" == 'force' ]]; then
rm -rf "$HOME/.config/i3"
echo '[INFO] I3 config removed | Forced by environment variable'
fi
if [[ ! -d "$HOME/.config/i3" ]]; then
ln -s "$CWD/configs/i3" "$HOME/.config/i3"
echo "[INFO] I3 config linked with symbolic link : $CWD/configs/i3 -> $HOME/.config/i3"
else
echo '[INFO] I3 config already linked'
fi
fi
fi