From 268445aade66c8e3f7523b24c5168e4e4b4d752f Mon Sep 17 00:00:00 2001 From: linull24 <2382963480@qq.com> Date: Fri, 11 Apr 2025 21:59:11 +0800 Subject: [PATCH 1/7] Update winapps --- bin/winapps | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/winapps b/bin/winapps index 92280e0..6f4da2f 100755 --- a/bin/winapps +++ b/bin/winapps @@ -581,7 +581,8 @@ function waRunCommand() { else # Convert path from UNIX to Windows style. FILE_PATH=$(echo "$2" | sed \ - -e 's|'"${HOME}"'|\\\\tsclient\\home|' \ + -e 's|^'"${HOME}"'|\\\\tsclient\\home|' \ + -e 's|^/run/media|\\\\tsclient\\media|' \ -e 's|/|\\|g') dprint "UNIX_FILE_PATH: ${2}" dprint "WINDOWS_FILE_PATH: ${FILE_PATH}" @@ -595,6 +596,7 @@ function waRunCommand() { +auto-reconnect \ +home-drive \ +clipboard \ + /drive:media,/run/media \ -wallpaper \ "$MULTI_FLAG" \ /wm-class:"$FULL_NAME" \ From 04e52f18ce9e05df0d95d8c06f264758dd0833b7 Mon Sep 17 00:00:00 2001 From: linull24 <2382963480@qq.com> Date: Sat, 12 Apr 2025 14:59:16 +0800 Subject: [PATCH 2/7] add variable REMOVABLE_MEDIA --- bin/winapps | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/bin/winapps b/bin/winapps index 6f4da2f..ff91054 100755 --- a/bin/winapps +++ b/bin/winapps @@ -45,6 +45,7 @@ RDP_IP="" WAFLAVOR="docker" RDP_FLAGS="" FREERDP_COMMAND="" +REMOVABLE_MEDIA="" RDP_SCALE=100 AUTOPAUSE="off" AUTOPAUSE_TIME="300" @@ -156,7 +157,16 @@ Please run: function dprint() { [ "$DEBUG" = "true" ] && echo "[$(date)-$RUNID] $1" >>"$LOG_PATH" } - +# Name: 'waFixRemovableMedia' +# Role: If user left REMOVABLE_MEDIA config null,fallback to /run/media for udisks defaults ,warning. +function waFixRemovableMedia() { + if [ -z "$REMOVABLE_MEDIA" ]; then + REMOVABLE_MEDIA="/run/media" # Default for udisks + dprint "NOTICE: Using default REMOVABLE_MEDIA: $REMOVABLE_MEDIA" + notify-send --expire-time=3000 --icon="drive-removable-media" \ + "WinApps Notice" "Using default removable media path: $REMOVABLE_MEDIA" + fi +} # Name: 'waFixScale' # Role: Since FreeRDP only supports '/scale' values of 100, 140 or 180, find the closest supported argument to the user's configuration. function waFixScale() { @@ -207,7 +217,8 @@ function waLoadConfig() { # Update $RDP_SCALE. waFixScale - + # Update when $REMOVABLE_MEDIA is null + waFixRemovableMedia # Update $AUTOPAUSE_TIME. # RemoteApp RDP sessions take, at minimum, 20 seconds to be terminated by the Windows server. # Hence, subtract 20 from the timeout specified by the user, as a 'built in' timeout of 20 seconds will occur. @@ -582,7 +593,7 @@ function waRunCommand() { # Convert path from UNIX to Windows style. FILE_PATH=$(echo "$2" | sed \ -e 's|^'"${HOME}"'|\\\\tsclient\\home|' \ - -e 's|^/run/media|\\\\tsclient\\media|' \ + -e 's|^\('"${REMOVABLE_MEDIA//|/\\|}"'\)/[^/]*|\\\\tsclient\\media|' 、 -e 's|/|\\|g') dprint "UNIX_FILE_PATH: ${2}" dprint "WINDOWS_FILE_PATH: ${FILE_PATH}" @@ -596,7 +607,7 @@ function waRunCommand() { +auto-reconnect \ +home-drive \ +clipboard \ - /drive:media,/run/media \ + /drive:media,"$REMOVABLE_MEDIA" \ -wallpaper \ "$MULTI_FLAG" \ /wm-class:"$FULL_NAME" \ From d6cc8480c1cb019d6a012686360c076fb9895593 Mon Sep 17 00:00:00 2001 From: linull24 <2382963480@qq.com> Date: Sat, 12 Apr 2025 15:04:24 +0800 Subject: [PATCH 3/7] Update README.md Add REMOVEABLE_MEDIA. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cae5970..b881c59 100644 --- a/README.md +++ b/README.md @@ -383,7 +383,13 @@ WAFLAVOR="docker" # - '140' # - '180' RDP_SCALE="100" - +# [MOUNTING REMOVEABLE PATHS FOR FILES] +# NOTES: +# udisks which you most probalbly have installed ,use /run/media by default. +# This will improve the experience while using DEs. +# However,FHS suggests using /media.Please check your system. +# If you prefer to mount manually,you can change it to /mnt. +REMOVABLE_MEDIA = "/run/media" # [ADDITIONAL FREERDP FLAGS & ARGUMENTS] # NOTES: # - You can try adding /network:lan to these flags in order to increase performance, however, some users have faced issues with this. From 167e6a68e668dd83905033043b9ceff27d6116fc Mon Sep 17 00:00:00 2001 From: linull24 <2382963480@qq.com> Date: Sat, 12 Apr 2025 15:11:01 +0800 Subject: [PATCH 4/7] typo fix --- bin/winapps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/winapps b/bin/winapps index ff91054..892e533 100755 --- a/bin/winapps +++ b/bin/winapps @@ -593,7 +593,7 @@ function waRunCommand() { # Convert path from UNIX to Windows style. FILE_PATH=$(echo "$2" | sed \ -e 's|^'"${HOME}"'|\\\\tsclient\\home|' \ - -e 's|^\('"${REMOVABLE_MEDIA//|/\\|}"'\)/[^/]*|\\\\tsclient\\media|' 、 + -e 's|^\('"${REMOVABLE_MEDIA//|/\\|}"'\)/[^/]*|\\\\tsclient\\media|' \ -e 's|/|\\|g') dprint "UNIX_FILE_PATH: ${2}" dprint "WINDOWS_FILE_PATH: ${FILE_PATH}" From 335b9f7c8d1a03d5230f75e3808928ff96f5c418 Mon Sep 17 00:00:00 2001 From: linull24 <2382963480@qq.com> Date: Sat, 12 Apr 2025 17:01:46 +0800 Subject: [PATCH 5/7] fix fxxking typo and grammer --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b881c59..50e98d7 100644 --- a/README.md +++ b/README.md @@ -383,13 +383,15 @@ WAFLAVOR="docker" # - '140' # - '180' RDP_SCALE="100" -# [MOUNTING REMOVEABLE PATHS FOR FILES] -# NOTES: -# udisks which you most probalbly have installed ,use /run/media by default. -# This will improve the experience while using DEs. -# However,FHS suggests using /media.Please check your system. -# If you prefer to mount manually,you can change it to /mnt. -REMOVABLE_MEDIA = "/run/media" + +# [MOUNTING REMOVABLE PATHS FOR FILES] +# NOTES: +# - By default, `udisks` (which you most likely have installed) uses `/run/media/` for mounting removable devices. +# - This improves compatibility with most desktop environments (DEs). +# - Note: The Filesystem Hierarchy Standard (FHS) recommends `/media` instead. Verify your system's configuration. +# - To manually mount devices, you may optionally use `/mnt`. +REMOVABLE_MEDIA="/run/media" + # [ADDITIONAL FREERDP FLAGS & ARGUMENTS] # NOTES: # - You can try adding /network:lan to these flags in order to increase performance, however, some users have faced issues with this. From 9795c1b642b3d8f9a53c550d2400fb0fce21f6d1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 09:01:54 +0000 Subject: [PATCH 6/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 50e98d7..2d7a236 100644 --- a/README.md +++ b/README.md @@ -384,12 +384,12 @@ WAFLAVOR="docker" # - '180' RDP_SCALE="100" -# [MOUNTING REMOVABLE PATHS FOR FILES] -# NOTES: -# - By default, `udisks` (which you most likely have installed) uses `/run/media/` for mounting removable devices. -# - This improves compatibility with most desktop environments (DEs). -# - Note: The Filesystem Hierarchy Standard (FHS) recommends `/media` instead. Verify your system's configuration. -# - To manually mount devices, you may optionally use `/mnt`. +# [MOUNTING REMOVABLE PATHS FOR FILES] +# NOTES: +# - By default, `udisks` (which you most likely have installed) uses `/run/media/` for mounting removable devices. +# - This improves compatibility with most desktop environments (DEs). +# - Note: The Filesystem Hierarchy Standard (FHS) recommends `/media` instead. Verify your system's configuration. +# - To manually mount devices, you may optionally use `/mnt`. REMOVABLE_MEDIA="/run/media" # [ADDITIONAL FREERDP FLAGS & ARGUMENTS] From de68c79876a067fe7cd3b14000a99159ed4a688a Mon Sep 17 00:00:00 2001 From: linull24 <2382963480@qq.com> Date: Sat, 12 Apr 2025 17:05:27 +0800 Subject: [PATCH 7/7] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2d7a236..24545d5 100644 --- a/README.md +++ b/README.md @@ -386,10 +386,11 @@ RDP_SCALE="100" # [MOUNTING REMOVABLE PATHS FOR FILES] # NOTES: -# - By default, `udisks` (which you most likely have installed) uses `/run/media/` for mounting removable devices. -# - This improves compatibility with most desktop environments (DEs). -# - Note: The Filesystem Hierarchy Standard (FHS) recommends `/media` instead. Verify your system's configuration. -# - To manually mount devices, you may optionally use `/mnt`. +# - By default, `udisks` (which you most likely have installed) uses /run/media for mounting removable devices. +# This improves compatibility with most desktop environments (DEs). +# ATTENTION: The Filesystem Hierarchy Standard (FHS) recommends /media instead. Verify your system's configuration. +# - To manually mount devices, you may optionally use /mnt. +# REFERRENCE: https://wiki.archlinux.org/title/Udisks#Mount_to_/media REMOVABLE_MEDIA="/run/media" # [ADDITIONAL FREERDP FLAGS & ARGUMENTS]