Skip to content

Commit

Permalink
Add more logging around call to virtual keyboard
Browse files Browse the repository at this point in the history
This is to help investigate issue martin-ueding#36.
  • Loading branch information
jturner314 committed Jan 7, 2014
1 parent a630e18 commit c37dc7c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bin/think-rotate
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand Down

0 comments on commit c37dc7c

Please sign in to comment.