diff --git a/tools/toolbox/create-toolbox.sh b/tools/toolbox/create-toolbox.sh index 0294719af..1b2ab9bbd 100755 --- a/tools/toolbox/create-toolbox.sh +++ b/tools/toolbox/create-toolbox.sh @@ -5,6 +5,7 @@ set -e TOOLBOX_IMAGE=registry.gitlab.gnome.org/gnome/gnome-shell/toolbox DEFAULT_NAME=gnome-shell-devel +CONFIG_FILE=${XDG_CONFIG_HOME:-$HOME/.config}/gnome-shell-toolbox-tools.conf usage() { cat <<-EOF @@ -22,6 +23,8 @@ usage() { -b, --builder Set up GNOME Builder configuration --locales=LOCALES Enable support for additional locales LOCALES --skip-mutter Do not build mutter + --set-default Set as default for other gnome-shell + toolbox tools -h, --help Display this help EOF @@ -76,6 +79,11 @@ setup_classic() { https://gitlab.gnome.org/GNOME/gnome-shell-extensions.git $branch } +set_default() { + mkdir -p $(dirname $CONFIG_FILE) + echo DEFAULT_TOOLBOX=$NAME > $CONFIG_FILE +} + TEMP=$(getopt \ --name $(basename $0) \ --options 'n:v:rcbh' \ @@ -86,6 +94,7 @@ TEMP=$(getopt \ --longoptions 'builder' \ --longoptions 'locales:' \ --longoptions 'skip-mutter' \ + --longoptions 'set-default' \ --longoptions 'help' \ -- "$@") @@ -127,6 +136,11 @@ while true; do shift ;; + --set-default) + SET_DEFAULT=1 + shift + ;; + --locales) IFS=" ," LOCALES+=($2) shift 2 @@ -161,3 +175,4 @@ install_extra_packages [[ $SETUP_CLASSIC ]] && setup_classic [[ $SETUP_BUILDER ]] && create_builder_config +[[ $SET_DEFAULT ]] && set_default