diff options
Diffstat (limited to 'system/xrdp/xrdp-xwmconfig')
-rw-r--r-- | system/xrdp/xrdp-xwmconfig | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/system/xrdp/xrdp-xwmconfig b/system/xrdp/xrdp-xwmconfig index b614ba6020..e94a908e72 100644 --- a/system/xrdp/xrdp-xwmconfig +++ b/system/xrdp/xrdp-xwmconfig @@ -20,14 +20,16 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Modified by Phillip Warner <pc_warner@yahoo.com> -# for editing xrdp-xinitrc for use with xrdp - -# $DWM is the file under /usr/lib/xrdp that points to /etc/xrdp/xrdp-xinitrc. -# /etc/xrdp/xrdp-xinitrc will be modified by this script if run by root. -# $UWM is the file under $HOME that will be modified by this script. +# for editing xrdp's xinit files (xrdp-xinitrc) +# +# $DWM under /etc/xrdp will be modified by this script if run by root. +# Otherwise, $UWM in the user's folder will be modified. +# +# $DWM represents the default xrdp-xinit file for xrdp under /etc/xrdp. +# $UWM is the xrdp-xinit file under $HOME that will be modified by this script. # The values for DefaultWindowManager and UserWindowManager, respectively, # in sesman.ini should match these. -DWM=startwm.sh +DWM=xrdp-xinitrc UWM=.xrdp-xinitrc # First, let's bail if our being here doesn't make sense: @@ -42,12 +44,12 @@ if [ ! -d /etc/xrdp ]; then fi if [ $(grep -w DefaultWindowManager /etc/xrdp/sesman.ini | cut -f2 -d"=") != $DWM ] then - echo "DefaultWindowManager in sesman.ini MUST be $DWM to use this tool. Aborting..." + echo "DefaultWindowManager in sesman.ini MUST be set to $DWM to use this tool. Aborting..." exit fi if [ $(grep -w UserWindowManager /etc/xrdp/sesman.ini | cut -f2 -d"=") != $UWM ] then - echo "UserWindowManager in sesman.ini MUST be $UWM to use this tool. Aborting..." + echo "UserWindowManager in sesman.ini MUST be set to $UWM to use this tool. Aborting..." exit fi @@ -64,14 +66,14 @@ fi # Do we already have an existing default? unset PRESELECT -if [ -L /etc/xrdp/xrdp-xinitrc ]; then - CURRENT="$(basename $(/bin/ls -l /etc/xrdp/xrdp-xinitrc | cut -f 2 -d '>'))" +if [ -L /etc/xrdp/$DWM ]; then + CURRENT="$(basename $(/bin/ls -l /etc/xrdp/$DWM | cut -f 2 -d '>'))" PRESELECT=" --default-item $CURRENT " fi # Figure out who we are and set up some background information: if [ "$USER" = "root" ]; then - BACKTITLE="--backtitle \"Setting system-wide default xrdp window manager at /etc/xrdp/xrdp-xinitrc\"" + BACKTITLE="--backtitle \"Setting system-wide default xrdp window manager at /etc/xrdp/$DWM\"" else BACKTITLE="--backtitle \"Setting user default xrdp window manager in $HOME/$UWM\"" fi @@ -195,7 +197,7 @@ OUTPUT=`cat $TMP/output` # that do not have a $HOME/$UWM: if [ "$USER" = "root" ]; then if [ -r /etc/X11/xinit/$OUTPUT ]; then - ( cd /etc/xrdp/ ; rm -f xrdp-xinitrc ; ln -sf /etc/X11/xinit/$OUTPUT xrdp-xinitrc ) + ( cd /etc/xrdp/ ; rm -f $DWM ; ln -sf /etc/X11/xinit/$OUTPUT $DWM ) fi fi |