diff --git a/bin/think-rotate b/bin/think-rotate index 22d474c..d34ef49 100755 --- a/bin/think-rotate +++ b/bin/think-rotate @@ -166,23 +166,39 @@ done mylogger $"Starting or killing virtual keyboard" kdialog-update $"Starting or killing virtual keyboard" +# Log the environment variables +mylogger "Environment variables: $(env)" + # Start the virtual keyboard, if it is installed. +mylogger "Checking to see if '$virtual_kbd' is available" if type "$virtual_kbd" &> /dev/null then + mylogger "The virtual keyboard program '$virtual_kbd' is visible to 'type'" + mylogger "The value of setto is '${setto}'" if [[ "$setto" = "normal" ]] then + mylogger "The virtual keyboard '${virtual_kbd}' will be killed" # So the user reverts back to normal. Kill the virtual keyboard (if it # is running), since it does not make any sense to use that any more. if pgrep "$virtual_kbd" &> /dev/null then + mylogger "Virtual keyboard is running with PIDs: '$(pgrep $virtual_kbd)'; killing it" killall "$virtual_kbd" fi + mylogger "Virtual keyboard killed; remaining PIDs: '$(pgrep $virtual_kbd)'" else # The user rotated the screen. Start the virtual keyboard since he # might need it. - "$virtual_kbd" &> /dev/null & + mylogger "Making log file for virtual keyboard '$virtual_kbd'" + temp_logging_file="$(mktemp)" + mylogger "Starting virtual keyboard and directing output to '$temp_logging_file'" + "$virtual_kbd" &> "$temp_logging_file" & + mylogger "Virtual keyboard started; PIDs: '$(pgrep $virtual_kbd)'" fi fi +mylogger "Sleeping 1 sec to check on status of virtual keyboard" +sleep 1 +mylogger "Virtual keyboard PIDs: '$(pgrep $virtual_kbd)'" ############################################################################### # TrackPoint and TouchPad #