#!/bin/sh ## ## Nautilus ## SCRIPT: 00_anyfile_LIST-FONT-FILES_inFontDirs_ls-R.sh ## ## PURPOSE: List the files currently in the main system ## font directories --- ## $HOME/.fonts and ## /usr/share/fonts ## --- and, if non-empty --- ## /usr/share/X11/fonts, ## /usr/local/share/fonts, ## etc. ## ## METHOD: Uses the 'ls -R' command on these directories and concatenates ## the output in a list file. ## ## The list is shown in a text-file viewer of the user's choice. ## ## HOW TO USE: In Nautilus, click on the name of ANY file in ANY directory. ## Right-click and choose this script to run (name above). ## ############################################################################ ## Script ## Created: 2011may23 ## Changed: 2012apr18 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 output file in /tmp, in case the user ## does not have write-permission in the current directory. ############################################################### OUTFILE="/tmp/${USER}_list_fontFileDIRs.lis" if test -f "$OUTFILE" then rm -f "$OUTFILE" fi ############################### ## Prepare heading for the list. ############################### THISHOST=`hostname` echo "\ ................ `date '+%Y %b %d %a %T%p %Z'` ...................... List of Files in the main Linux font directories --- on host: $THISHOST Output of the 'ls -R' command applied to directories $HOME/.fonts and /usr/share/fonts Some more information is at the bottom of this list. ------------------------------------------------------------------------------ " > "$OUTFILE" ################################ ## Prepare the guts of the list. ################################ echo " ################# $HOME/.fonts: ################# " >> "$OUTFILE" ls -R $HOME/.fonts >> "$OUTFILE" echo " ########################################################################### /usr/share/fonts: ################ " >> "$OUTFILE" ls -R /usr/share/fonts >> "$OUTFILE" if test -d /usr/local/share/fonts then echo " ######################################################################## /usr/local/share/fonts: ###################### " >> "$OUTFILE" ls -R /usr/local/share/fonts >> "$OUTFILE" fi if test -d /usr/share/X11/fonts then echo " ###################################################################### /usr/share/X11/fonts: #################### " >> "$OUTFILE" ls -R /usr/share/X11/fonts >> "$OUTFILE" fi ############################### ## Add a 'trailer' to 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 The list was created with the 'ls' command applied to directories $HOME/.fonts and /usr/share/fonts If you want to change or add some directories, you can simply edit the script. ------------------------------------------------------------------------------ FOR MORE INFO ON Linux FONTS: You can browse the 'man' help for commands or topics such as - fonts-conf - fc-list - fc-cache - FcInit - defoma (Debian Font Manager) - Xft - freetype-config The Linux 'font-config' and 'Xft' (X-free-type) systems are in the process of replacing the old, fixed-size X-fonts with scalable and anti-aliased fonts. You can type 'man ' at a terminal prompt, to see details on these commands or topics. ('man' stands for Manual. It gives you the user manual for the command/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. ------------------------------------------------------------------------------ FONT FILE SUFFIXES - file descriptions: .ttf = a True Type (scalable) font .afm = an Adobe Postcript font file .pfa = an Adobe Postcript font file, ASCII .pfb = an Adobe Postcript font file, binary .pcf = an X-windows font file .enc = an X-windows font file A good source for more information on these file types is Wikipedia. ******* END OF LIST of most of the font files on host $THISHOST ******* " >> "$OUTFILE" ####################################### ## Show the list of font filenames. ####################################### ## . $HOME/.gnome2/nautilus-scripts/.set_VIEWERvars.shi . $HOME/.freedomenv/feNautilusScripts/set_DIR_NautilusScripts.shi . $DIR_NautilusScripts/.set_VIEWERvars.shi $TXTVIEWER "$OUTFILE" &