Commits

Taylor Venable committed 88e4e4b

Move font path manipulation to xinitrc file

Comments (0)

Files changed (2)

-# Add my custom-compiled xterm if appropriate.
-if [ -d /opt/xterm -a -x /opt/xterm/bin/xterm ]; then
-    export PATH="/opt/xterm/bin:${PATH}"
-fi
-
 setxkbmap -option ctrl:swapcaps -option compose:ralt
 latitude="41.08"
 longitude="-85.11"
 
 xset r rate 500 50
 
-if [ -e $HOME/.xmodmaprc ]; then xmodmap $HOME/.xmodmaprc ; fi
-if [ -e $HOME/.fonts ]; then
-    xset +fp $HOME/.fonts
+if [ -r "${HOME}/.xmodmaprc" ]; then
+    xmodmap $HOME/.xmodmaprc
 fi
 
+read -d '' font_dirs <<EOS
+${HOME}/.fonts
+/usr/local/share/fonts/terminus
+/usr/X11R6/lib/X11/fonts/local
+EOS
+
+old_ifs=$IFS
+IFS=$'\n'
+for dir in $font_dirs ; do
+    if [[ -d "$dir" && -e "$dir/fonts.dir" ]]; then
+        xset +fp "$dir"
+        xset fp rehash
+    fi
+done
+IFS=$old_ifs
+
 xscreensaver -no-splash &
 
-dimensions="unknown"
-show_clock=NO
-show_load=NO
+dimensions='unknown'
+show_clock='NO'
+show_load='NO'
+wm='xfce'
 
 case ${TCV_HOST} in
     lionel)
         show_load=YES
         wm=fvwm
         ;;
-    system76)
-        show_clock=NO
-        show_load=NO
-        wm=xfce
-        ;;
-    thinkpad)
-        show_clock=NO
-        show_load=NO
-        wm=xfce
-        ;;
-    fw-its-kt209a-2)
-        show_clock=NO
-        show_load=NO
-        wm=xfce
-        ;;
     *)
         echo "WARNING: I don't know where I am."
-        show_clock=NO
-        show_load=NO
-        wm=xfce
         ;;
 esac
 
 if [ "$wm" = "fvwm" ]; then
-if [ "$show_clock" = "YES" ]; then
-    xclock &
-fi
-if [ "$show_load" = "YES" ]; then
-    xload &
-fi
+    if [ "$show_clock" = "YES" ]; then
+        xclock &
+    fi
+    if [ "$show_load" = "YES" ]; then
+        xload &
+    fi
 
-if [ "$dimensions" != "unknown" ]; then
-    $HOME/bin/setbg.pl --daemon --random $HOME/Pictures/Backgrounds/$dimensions &
-else
-    xearth -proj orthographic -pos "fixed ${latitude} ${longitude}" -nolabel -nomarkers -nogrid -night 10 -term 0 -twopix -ncolors 256 -root -fork
-fi
+    if [ "$dimensions" != "unknown" ]; then
+        $HOME/bin/setbg.pl --daemon --random $HOME/Pictures/Backgrounds/$dimensions &
+    else
+        xearth -proj orthographic -pos "fixed ${latitude} ${longitude}" -nolabel -nomarkers -nogrid -night 10 -term 0 -twopix -ncolors 256 -root -fork
+    fi
 fi
 
 case "$wm" in
 
 xscreensaver-command -exit
 sleep 1
+
 # vim:set ft=sh:

Programs/xfce-startup.sh

 
 xset r rate 500 50
 
-if [[ -d '/usr/local/share/fonts/terminus' ]]; then
-    xset +fp '/usr/local/share/fonts/terminus'
-elif [[ -d '/usr/X11R6/lib/X11/fonts/local' ]]; then
-    xset +fp '/usr/X11R6/lib/X11/fonts/local'
-fi
-
-xset fp rehash
-
 case ${TCV_HOST} in
     thinkpad)
         xset b off