#!/bin/sh ## ## Nautilus ## SCRIPT: 00_anyfile_LIST_X-VISUALS_xdpyinfo.sh ## ## PURPOSE: List the X 'visuals' info for this host, via 'xdpyinfo'. ## ## METHOD: Puts the output of 'xdpyinfo' in a text file and then ## shows the text file using a textfile-viewer of the ## user's choice. ## ## HOW TO USE: In Nautilus, select ANY file in ANY directory. ## Then right-click and choose this script to run (name above). ## ############################################################################# ## Created: 2010may12 ## Changed: 2011may02 Added $USER to a temp filename. ## Changed: 2011may11 Get 'nautilus-scripts' directory via an include script. ## Changed: 2012may11 Changed script name in comments above and touched up ## the comments. Changed some indenting below. ########################################################################### ## FOR TESTING: (show statements as they execute) # set -x ############################################################### ## Prep a temporary filename, to hold the list of filenames. ## We put the outlist file in /tmp, in case the user ## does not have write-permission in the current directory, ## and because the output does not, usually, have anything ## to do with the current directory. ############################################################### OUTLIST="/tmp/${USER}_list_Xvisuals_xdpyinfo.lis" if test -f "$OUTLIST" then rm -f "$OUTLIST" fi ####################################### ## Prepare the HEADER for the list. ####################################### THISHOST=`hostname` echo "\ ................ `date '+%Y %b %d %a %T%p %Z'` ...................... X 'visuals' info (via 'xdpyinfo') --- for host: $THISHOST Some more information is at the bottom of this list. ------------------------------------------------------------------------------ " > "$OUTLIST" ##################################################### ## Use 'xdpyinfo' to create the main part of the list. ##################################################### EXECHECK=`which xdpyinfo` if test -f "$EXECHECK" then echo " ######## xdpyinfo : ######## " >> $OUTLIST xdpyinfo >> "$OUTLIST" fi ########################### ## Add TRAILER to the list. ########################### SCRIPT_BASENAME=`basename $0` SCRIPT_DIRNAME=`dirname $0` echo " ------------------------------------------------------------------------------ The list above was generated by the script $SCRIPT_BASENAME in directory $SCRIPT_DIRNAME If you want to add more X windows info via more commands, you can simply edit the script. ------------------------------------------------------------------------------ FOR MORE INFO ON THESE EXECUTABLES: For some of these topics (or commands, like 'xdpyinfo'), you can type 'man ' to see details on the topic. ('man' stands for Manual. It gives you a user manual for the command/utility/protocol/topic.) You can type 'man man' at a shell prompt to see a description of the 'man' command. Or use the 'show_manhelp_4topic' Nautilus script in the 'LinuxHELPS' group of Nautilus scripts. ******* END OF LIST of X resources database info on host $THISHOST ******* " >> "$OUTLIST" #################################### ## Show the listing. ################################### ## . $HOME/.gnome2/nautilus-scripts/.set_VIEWERvars.shi . $HOME/.freedomenv/feNautilusScripts/set_DIR_NautilusScripts.shi . $DIR_NautilusScripts/.set_VIEWERvars.shi $TXTVIEWER "$OUTLIST"