Refactor main function and cleanup setup code

Refactor launcher.sh to streamline the main function and remove unnecessary setup code.
This commit is contained in:
Lucas Morel
2025-10-08 20:09:08 +02:00
committed by GitHub
parent 2d37d86fcd
commit 5d1faa3afb

View File

@@ -198,22 +198,13 @@ start_launcher(){
nix-shell -p appimage-run --run "appimage-run $launcher_appimage" nix-shell -p appimage-run --run "appimage-run $launcher_appimage"
} }
setup(){ #Configure i3 pour l'ajouter le launcher dans dmenu_run
#archi
#$HOME/afs/.confs/config/i3/config
#apres bindsym $mod+d exec --no-startup-id PATH=$HOME/afs/minecraft/bin:$PATH dmenu_run
#avant bindsym $mod+d exec --no-startup-id dmenu_run
sed -i "s|bindsym $mod+d exec --no-startup-id|bindsym $mod+d exec --no-startup-id PATH=$HOME/afs/minecraft:$PATH|" "$HOME/afs/.confs/config/i3/config"
#revoir la modif de ligne, trouver un truc plus opti (sed)
echo "export PATH=$HOME/afs/minecraft/bin:$PATH" >> $HOME/.bashrc
source .bashrc
mv $(pwd)/launcher.sh $bin_path
}
main() { main() {
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
help_msg check_path
check_config
check_launcher
cop_files
check_account & start_launcher
exit 0 exit 0
fi fi
@@ -239,7 +230,7 @@ main() {
cop_files cop_files
check_account & start_launcher check_account & start_launcher
;; ;;
--add-dmenu) -ad|--add-dmenu)
add_to_dmenu add_to_dmenu
;; ;;
-h|--help) -h|--help)