summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremy@tifa.local>2008-02-18 15:53:46 -0800
committerJeremy Huddleston <jeremy@tifa.local>2008-02-18 15:53:46 -0800
commit916b1ab10d10efbdf3a544534acb95f9d28692cf (patch)
tree210610efc6c9128f1082a755237a10a5856f9b86
parent19fa8408a2c707081ba984537a3dcab744b0a565 (diff)
Apple: font caching and defaults
Quieted defaults "error" messages by initializing default values Do font caching in startx, so users with custom ~/.xinitrc won't have to worry about updating it. Add "cache_fonts" defaults item to toggle whether or not to cache fonts at startup Fall back on fc-cache if font_cache.sh is not present.
-rw-r--r--startx.cpp25
-rw-r--r--xinitrc.cpp2
2 files changed, 24 insertions, 3 deletions
diff --git a/startx.cpp b/startx.cpp
index bde93fb..c31fd7f 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -79,7 +79,30 @@ clientargs=""
serverargs=""
#ifdef __APPLE__
-if [ x`defaults read org.x.X11 no_auth` = x0 ] || ! defaults read org.x.X11 no_auth ; then
+
+XCOMM Initialize defaults (this will cut down on "safe" error messages)
+if ! defaults read org.x.X11 cache_fonts >& /dev/null ; then
+ defaults write org.x.X11 cache_fonts -bool true
+fi
+
+if ! defaults read org.x.X11 no_auth >& /dev/null ; then
+ defaults write org.x.X11 no_auth -bool false
+fi
+
+if ! defaults read org.x.X11 nolisten_tcp >& /dev/null ; then
+ defaults write org.x.X11 nolisten_tcp -bool true
+fi
+
+XCOMM First, start caching fonts
+if [ x`defaults read org.x.X11 cache_fonts` = x1 ] ; then
+ if [ -x /usr/X11/bin/font_cache.sh ] ; then
+ /usr/X11/bin/font_cache.sh &
+ elif [ -x /usr/X11/bin/fc-cache ] ; then
+ /usr/X11/bin/fc-cache &
+ fi
+fi
+
+if [ x`defaults read org.x.X11 no_auth` = x0 ] ; then
enable_xauth=1
else
enable_xauth=0
diff --git a/xinitrc.cpp b/xinitrc.cpp
index 74424ad..e42002d 100644
--- a/xinitrc.cpp
+++ b/xinitrc.cpp
@@ -87,8 +87,6 @@ XCOMM This is the fallback case if nothing else is executed above
#ifdef __APPLE__
-[ -x /usr/X11/bin/font_cache.sh ] && /usr/X11/bin/font_cache.sh
-
if [ -x /usr/X11/bin/xset ] ; then
fontpath="/usr/X11/lib/X11/fonts/misc/,/usr/X11/lib/X11/fonts/TTF/,/usr/X11/lib/X11/fonts/OTF,/usr/X11/lib/X11/fonts/Type1/,/usr/X11/lib/X11/fonts/75dpi:unscaled/,/usr/X11/lib/X11/fonts/100dpi/:unscaled,/usr/X11/lib/X11/fonts/75dpi:unscaled/,/usr/X11/lib/X11/fonts/100dpi/:unscaled"