22
33SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
44
5- function setup(){
5+ function setup() {
66
77 # Prompt the user if he wants to do the common setup, if not exit the script
88 if ! gum confirm " Do you want to do the common setup?" ; then
99 echo " Common setup skipped. Exiting."
1010 exit 0
1111 fi
12-
1312
1413 echo -e " Move configuration files..."
1514
1615 # Install rsync if not present
17- if ! command -v rsync & > /dev/null; then
18- if command -v apt & > /dev/null; then
16+ if ! command -v rsync & > /dev/null; then
17+ if command -v apt & > /dev/null; then
1918 sudo apt-get update
2019 sudo apt-get install -y rsync
21- elif command -v pacman & > /dev/null; then
20+ elif command -v pacman & > /dev/null; then
2221 sudo pacman -Sy --noconfirm rsync
23- elif command -v dnf & > /dev/null; then
22+ elif command -v dnf & > /dev/null; then
2423 sudo dnf install -y rsync
2524 else
2625 echo " Package manager not found. Please install rsync manually." >&2
@@ -51,23 +50,23 @@ function setup(){
5150 cp " $SCRIPT_DIR /../default/zshrc" ~ /.zshrc
5251
5352 # If gum is available, ask the user to choose between bash and zsh as default shell
54- if command -v gum & > /dev/null; then
53+ if command -v gum & > /dev/null; then
5554 shell_choice=$( gum choose " bash" " zsh" " skip" --header " Choose your default shell:" )
56-
55+
5756 case $shell_choice in
58- bash )
59- chsh -s " $( which bash) "
60- ;;
61- zsh )
62- # If pacman is available, install zsh and zsh-completions
63- if command -v pacman & > /dev/null; then
64- sudo pacman -Sy --noconfirm zsh zsh-completions
65- fi
66- chsh -s " $( which zsh) "
67- ;;
68- skip )
69- echo " No shell selected. Keeping current shell ($SHELL )."
70- ;;
57+ bash)
58+ chsh -s " $( which bash) "
59+ ;;
60+ zsh)
61+ # If pacman is available, install zsh and zsh-completions
62+ if command -v pacman & > /dev/null; then
63+ sudo pacman -Sy --noconfirm zsh zsh-completions
64+ fi
65+ chsh -s " $( which zsh) "
66+ ;;
67+ skip)
68+ echo " No shell selected. Keeping current shell ($SHELL )."
69+ ;;
7170 esac
7271 fi
7372
@@ -86,6 +85,7 @@ function setup(){
8685
8786 if [ -d /usr/share/X11/xkb/symbols/ ]; then
8887 sudo wget -nc https://raw.githubusercontent.com/c4software/bepo_developpeur/master/linux/bepoDev -O /usr/share/X11/xkb/symbols/bepoDev || true
88+ sudo cp /usr/share/X11/xkb/symbols/bepoDev /usr/share/X11/xkb/symbols/custom
8989 return
9090 fi
9191
@@ -100,25 +100,26 @@ function setup(){
100100 fi
101101}
102102
103- function check(){
103+ function check() {
104104 # Check if rsync is installed
105- if command -v rsync & > /dev/null; then
106- show_success " rsync"
105+ if command -v rsync & > /dev/null; then
106+ show_success " rsync"
107107 else
108- show_error " rsync" " rsync is not installed."
108+ show_error " rsync" " rsync is not installed."
109109 fi
110110
111111 # Check if ./config contains the same directories as ~/.config (excluding theme)
112112 local all_matched=true
113113 for dir in " $SCRIPT_DIR /../config/" * ; do
114- local dirname
115- dirname=$( basename " $dir " )
116- if [ " $dirname " != " theme" ] && [ ! -e " $HOME /.config/$dirname " ]; then
117- show_error " Configuration" " $dirname is not installed in ~/.config/"
118- all_matched=false
119- fi
114+ local dirname
115+ dirname=$( basename " $dir " )
116+ if [ " $dirname " != " theme" ] && [ ! -e " $HOME /.config/$dirname " ]; then
117+ show_error " Configuration" " $dirname is not installed in ~/.config/"
118+ all_matched=false
119+ fi
120120 done
121121 if $all_matched ; then
122- show_success " Configuration"
122+ show_success " Configuration"
123123 fi
124- }
124+ }
125+
0 commit comments