#!/bin/sh ## ## NAUTILUS ## SCRIPT: 00_anyfile_LIST-LOCALE-VARS_locale-setxkbmap.sh ## ## PURPOSE: Lists output from the 'locale' command --- which includes ## the name and value of some LC_* environment variables. ## ## In particular, this script lists the current value and ## allowed values of the LC_COLLATE variable. LC_COLLATE is ## used by various programs to determine how sorts are done, ## --- such as filename sorts. ## ## The 'man' pages do not document which programs use ## LC_COLLATE, but it seems that one program that does is ## the Nautilus (2.28.1) file manager. ## ## This script also lists the output of 'setxkbmap -print'. ## This shows the locale that X is using. ## ## METHOD: Puts the output in a text file and shows the text file in ## a text-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). ## ############################################################################## ## Script ## Created: 2012aug20 ## Changed: 2012 ############################################################################# ## 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_locale_info.lis" if test -f "$OUTLIST" then rm -f "$OUTLIST" fi ################################ ## Make the HEADER for the list. ################################ THISHOST=`hostname` echo "\ ................ `date '+%Y %b %d %a %T%p %Z'` ...................... 'Locale' info (via commands 'locale' and 'xetxkbmap') --- for host: $THISHOST Some more information is at the bottom of this list. ------------------------------------------------------------------------------ " > "$OUTLIST" #################################################################### ## Add 'locale' and 'locale -a' and 'locale -m' output to the report. #################################################################### EXECHECK=`which locale` if test -f "$EXECHECK" then echo " ###### locale : (values of environment variables for 'locale categories') ###### " >> $OUTLIST locale >> "$OUTLIST" echo " ######### locale -a : (names of available locales) ######### " >> $OUTLIST locale -a >> "$OUTLIST" echo " ######### locale -m : (names of available charmaps) ######### " >> $OUTLIST locale -m >> "$OUTLIST" fi ############################################################## ## Add 'setxkbmap -print' output to the report. ############################################################## EXECHECK=`which setxkbmap` if test -f "$EXECHECK" then echo " ################ setxkbmap -print : (see locale indicator between the strings 'pc+' and '+inet') ################ " >> $OUTLIST setxkbmap -print >> "$OUTLIST" fi ############################################################## ## Add '/etc/default/locale' file content to the report. ############################################################## if test -f "/etc/default/locale" then echo " ################################## Content of file /etc/default/locale : ################################## " >> $OUTLIST cat /etc/default/locale >> "$OUTLIST" fi ################################# ## Make the TRAILER for the list. ################################# SCRIPT_BASENAME=`basename $0` SCRIPT_DIRNAME=`dirname $0` echo " ................ `date '+%Y %b %d %a %T%p %Z'` ...................... The list above was generated by the script $SCRIPT_BASENAME in directory $SCRIPT_DIRNAME If you want to add more host config info via more commands, you can simply edit the script. ------------------------------------------------------------------------------ FOR MORE INFO ON THESE EXECUTABLES: For some of these topics (or commands like 'locale'), you can type 'man ' or '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. ----------------------------------------------------------------------------- NOTE on 'locale': LC_COLLATE is used by various programs to determine how sorts are done, --- such as filename sorts. The 'man' pages do not document which programs use LC_COLLATE, but it seems that one program that does is the Gnome-Nautilus (2.28.1) file manager. However, the Gnome File-Open and File-Save dialogs may not necessarily use the same method of determining sort order. NOTE on 'xkbmap': The output of 'setxkbmap -print' shows the locale that X is using. Look for the locale indicator (usually 2 characters) between the strings 'pc+' and '+inet'. ******* END OF LOCALE info for host $THISHOST ******* ................ `date '+%Y %b %d %a %T%p %Z'` ...................... " >> "$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"