{ ... }: { text = '' # Switch bottle. # Usage: bt function bt() { export SHELL_NAME="''${*}" } # Create new bottle. # Usage: btc [ENV] [EXTRA] function btc() { local env="''${1}" [[ "''${env}" = "" ]] && env="gaming" bottles-cli new --bottle-name "''${SHELL_NAME}" --environment "''${env}" "''${@:2}" } # Run an exe inside a bottle. # Usage: bte [EXTRA] function bte() { bottles-cli run -b "''${SHELL_NAME}" -e "''${@}" } # Run a program inside a bottle. # Usage: btr [EXTRA] function btr() { bottles-cli run -b "''${SHELL_NAME}" -p "''${@}" } # List bottles. function btl() { bottles-cli list bottles } # List programs in a bottle. function btlp() { bottles-cli programs -b "''${SHELL_NAME}" } # Add a program to bottle. # Usage: bta [EXTRA] function bta() { local name="''${1}" local exe=$(printf "%q" "''${2}") if [[ "''${exe}" = "" ]]; then help bta return 2 fi bottles-cli add -b "''${SHELL_NAME}" -n "''${name}" -p "$(realpath ''${exe})" "''${@:3}" } # Set bottle env var. # Usage: bte function bte() { local env="''${1}" if [[ "''${env}" = "" ]]; then help bte return 2 fi bottles-cli edit -b "''${SHELL_NAME}" --env-var "''${@}" } function _comp_bottles_list() { _autocomplete $(bottles-cli list bottles 2> /dev/null | sed -e "1d; s/^- //") } function _comp_programs_list() { local IFS=$'\n' _autocomplete $(bottles-cli programs -b "''${SHELL_NAME}" 2> /dev/null | sed -e "1d; s/^- //") } complete -F _comp_bottles_list bt complete -F _comp_programs_list btr ''; }