#!/bin/sh ## ## Nautilus ## SCRIPT: 00_anyfile_SHOW-MOUSE-ID_xinput-list.sh ## ## PURPOSE: Show name and ID of the mouse (and other X-input devices) ## via the 'xinput' command. ## ## METHOD: Uses the 'xinput list' command to list X input info. ## ## Puts the 'xinput list' output in a text file. ## ## Shows the text file using a text-file viewer of the ## user's choice. ## ## REFERENCES: ## - http://quandtum.weebly.com/2/post/2012/03/how-to-change-mouse-button-functions-in-linux.html ## - man xinput ## ## HOW TO USE: In the Nautilus file manager, right-click on the name of ## ANY file (or directory) in a Nautilus directory list. ## Then choose this Nautilus script to run (see name above). ## ## Created by: Blaise Montandon 2013mar15 ## Changed by: Blaise Montandon 2013 ## FOR TESTING: (show statements as they execute) # set -x ############################################################ ## Prep a temporary filename, to hold the list. ## We put the output in /tmp in case the user does ## not have write-permission to the current directory. ############################################################ OUTFILE="/tmp/${USER}_xinput_list.lis" if test -f "$OUTFILE" then rm -f "$OUTFILE" fi #################################################################### ## Generate HEADING for the listing. #################################################################### THISHOST=`hostname` echo "\ ................ `date '+%Y %b %d %a %T%p %Z'` ...................... OUTPUT OF THE 'xinput list' COMMAND. Some further information is at the bottom of this list. ------------------------------------------------------------------------------ " > "$OUTFILE" #################################################################### ## Generate 'guts' of the list with 'xinput list'. #################################################################### xinput list >> "$OUTFILE" #################################################################### ## Add a TRAILER to the listing. #################################################################### SCRIPT_BASENAME=`basename $0` SCRIPT_DIRNAME=`dirname $0` echo " ................ `date '+%Y %b %d %a %T%p %Z'` ...................... The report above was generated by the script $SCRIPT_BASENAME in directory $SCRIPT_DIRNAME The script created this list using the command xinput list This list shows information on X input devices attached to this host. ** END OF 'xinput list' output on host $THISHOST " >> "$OUTFILE" ################################################## ## Show the listing. ################################################# ## . $HOME/.gnome2/nautilus-scripts/.set_VIEWERvars.shi . $HOME/.freedomenv/feNautilusScripts/set_DIR_NautilusScripts.shi . $DIR_NautilusScripts/.set_VIEWERvars.shi $TXTVIEWER "$OUTFILE" &