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:
37
launcher.sh
37
launcher.sh
@@ -198,23 +198,14 @@ 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
|
||||||
exit 0
|
check_config
|
||||||
|
check_launcher
|
||||||
|
cop_files
|
||||||
|
check_account & start_launcher
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -232,14 +223,14 @@ main() {
|
|||||||
-r|--remove)
|
-r|--remove)
|
||||||
remove_all
|
remove_all
|
||||||
;;
|
;;
|
||||||
-l|--launch)
|
-l|--launch)
|
||||||
check_path
|
check_path
|
||||||
check_config
|
check_config
|
||||||
check_launcher
|
check_launcher
|
||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user