From 31d0e422a5cd3d1a3bbdd2facdbc9b460ab069c0 Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Wed, 16 Oct 2024 12:36:13 -0600 Subject: [PATCH] default-config: Don't close terminal if manpage not found. When viewing a manual page using the "Help" menu in the default-config, if the manual page is not found, don't close the terminal, instead use the 'read' command to wait for user input. This will require the user to hit 'Enter' or close the terminal manually. This ensures that if the manual pages are not installed the user gets a message from man saying that the manual page cannot be found vs just flashing a terminal. --- default-config/config | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/default-config/config b/default-config/config index 07b853a73..af5b57536 100644 --- a/default-config/config +++ b/default-config/config @@ -109,11 +109,14 @@ AddToFunc MoveToCurrent # Function: ViewManPage $0 # # This function loads the man page $0 in an terminal -# and is used with the help menu. +# and is used with the help menu. If the manual page is +# not found, point users at fvwm.org and keep terminal open. DestroyFunc ViewManPage AddToFunc ViewManPage + I Exec exec $[infostore.terminal] -g 80x40 \ - -n "Manual Page - $0" -T "Manual Page - $0" -e man "$0" + -n "Manual Page - $0" -T "Manual Page - $0" -e 'man "$0" || \ + (echo "$[gt.Documenation can be found at https://www.fvwm.org]"; \ + read tmp)' # Function: SetBG $0 # @@ -702,4 +705,4 @@ DestroyModuleConfig EventNewDesk:* # exists, then read it. This allows changes to default-config settings # without needing a full copy of the default-config. This will also allow # default-config changes to get used after upgrades (if applicable). -Test (f $[FVWM_USERDIR]/local.config) Read $[FVWM_USERDIR]/local.config \ No newline at end of file +Test (f $[FVWM_USERDIR]/local.config) Read $[FVWM_USERDIR]/local.config