From 37d488dfdcb26c8635ce2576bcad8bb9467a8617 Mon Sep 17 00:00:00 2001 From: mviereck Date: Wed, 29 Jan 2020 23:03:16 +0100 Subject: [PATCH] --preset: experimental option to allow predefined option sets #218 --- x11docker | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/x11docker b/x11docker index e3da0f47..db9d6eb9 100755 --- a/x11docker +++ b/x11docker @@ -7797,6 +7797,7 @@ declare_variables() { # declare global variables Dockerexe="" # Can be docker.exe on MS Windows Hostexe="" # --exe: Host command Passwordterminal="" # Terminal emulator to use for password prompt (if no terminal emulator is needed, it will be 'bash -c') + Presetdir="$HOME/.config/x11docker/preset" Imagebasename="" # Image name without tags and / replaced with -. For use of --home folders. Preservecachefiles="no" # If yes, don't delete cache files on exit. For few failure cases only. Pullimage="ask" # --pull: Allow 'docker pull' yes|no|always|ask @@ -7911,7 +7912,7 @@ parse_options() { # parse cli options Longoptions="$Longoptions,cleanup,help,launcher,licence,license,version,wmlist" # Special options without starting X or container Longoptions="$Longoptions,install,remove,update,update-master" # Installation # - Longoptions="$Longoptions,iglx,xcomposite,xorgconf:" # Experimental + Longoptions="$Longoptions,iglx,xcomposite,xorgconf:,preset:" # Experimental Longoptions="$Longoptions,dbus-system,homedir:,no-xhost,sharedir:,systemd" # Deprecated Longoptions="$Longoptions,cachedir:,no-init,nothing,no-xtest,openrc,ps,runit,silent,starter,stderr,stdout" # Removed Longoptions="$Longoptions,sys-admin,sysvinit,tini,trusted,untrusted,vcxsrv" # Removed @@ -8120,6 +8121,14 @@ ${2:-}" ; shift ;; # Add custo --launcher) Createlauncher="yes" ;; # Create application launcher on desktop and exit #### Experimental options + --preset) [ -e "$Presetdir/${2:-}" ] && { + parse_options $(cat "$Presetdir/${2:-}") + : + } || [ -e "${2:-}" ] && { + parse_options $(cat "${2:-}") + : + } || note "Option --preset: Not found: ${2:-}" + shift ; note "Option --preset: experimental only." ;; --iglx) Iglx="yes" ; note "Option --iglx: experimental only." ;; # Indirect rendering; broken since Xorg ~18.2 --xcomposite) Xcomposite="yes" ; note "Option --xcomposite: experimental only." ;; # Enable X extension COMPOSITE --xorgconf) Xorgconf="${2:-}" ; note "Option --xorgconf: eperimental only" ; shift ;; # Custom xorg.conf