3 # This script runs fvwm with fvwm-themes config. It should be run under X.
4 # Put a call to this script as the last line of your .Xclients or .xinitrc.
7 : ${ROOT_PREFIX=$DESTDIR}
8 : ${ROOT_PREFIX=@ROOT_PREFIX@}
10 : ${FVWM_USERDIR=@FVWM_DEFAULT_USERDIR@}
12 rcFile
=$FVWM_USERDIR/$rcName
14 rcFile2
=$FVWM_USERDIR/$rcName2
16 themesDir
=$FVWM_USERDIR/$themesName
17 currentThemeName
=current
18 currentThemeDir
=$themesDir/$currentThemeName
26 ### to be autoconfigured
30 while [ "x$1" != "x" ]; do
35 if [ "$whoseArgs" = "fvwm" ]; then
36 fvwmArgs
="$fvwmArgs $1"
39 --no-start|
-no-start|
-n)
41 --fvwm|
-fvwm|
--fvwm-exe|
-fvwm-exe|
-e)
44 --session|
-session|
-s)
45 # fvwm-2.2.x adds -s on 'Restart fvwm-themes-start'
48 if [ "$1" = "--" ]; then
60 realCurrentThemeName
="current-$session"
61 realCurrentThemeDir
="$themesDir/$realCurrentThemeName"
62 destRcFile2
="$themesName/$realCurrentThemeName/$rcName2"
64 [ -d $FVWM_USERDIR ] || mkdir
$FVWM_USERDIR
65 # create the symbolic links
66 # POSIX says that we can have symlink to a not existing file.
67 # However some 2.3.x Linux kernels and may be 2.4.x do not support this???
68 [ -d $themesDir ] || mkdir
$themesDir
69 [ -d $themesDir/personal
] || mkdir
$themesDir/personal
70 cd $themesDir ||
echo "Fatal error, can't chdir $themesDir"
71 if [ ! -d $realCurrentThemeName ]; then
72 mkdir
$realCurrentThemeName
75 rm -rf $currentThemeName
76 ln -s $realCurrentThemeName $currentThemeName
78 if [ ! -f $destRcFile2 ]; then
83 ln -s $destRcFile2 $rcName2
86 test -f $rcFile && HEADERS_LINE
="`head -1 $rcFile 2>/dev/null`"
88 # check whether this is the first run
89 test "`echo $HEADERS_LINE | cut -d' ' -f3`" = "@VERSION@"
91 if [ "$isNewVersion" = 1 -o "$isNewSession" = 1 ]; then
92 if [ "$isNewVersion" = 1 ]; then
93 echo '[FVWM-Themes]: Welcome to FVWM Themes @VERSION@!'
94 xmessage
-g 400x100
+0+0 -xrm "*form*background:rgb:c0/c0/a0" -xrm "*form*okay*background:rgb:90/90/7a" -xrm "*textSink*font:lucidasans-18" -xrm "*form*scrollVertical:false" -xrm "*form*message*background:rgb:f0/f0/c0" 'Welcome to FVWM Themes @VERSION@!' 2>/dev
/null
&
96 echo "[FVWM-Themes]: Initial $session FVWM Themes session"
98 @bindir@
/fvwm-themes-config
--reset
99 @bindir@
/fvwm-themes-config
--load @personal
2>/dev
/null
101 # different build id may mean that themes or prefix were changed,
102 # be safe and refresh in this case
103 if [ "`echo $HEADERS_LINE | cut -d' ' -f4-`" != "@FT_BUILD_ID@" ]; then
104 echo "[FVWM-Themes]: A new @VERSION@ build detected; refreshing configuration"
105 @bindir@
/fvwm-themes-config
--fresh
109 # check that @FVWM_BINDIR@ is in $PATH and first for fvwm-config
110 if [ "`which fvwm-config 2>/dev/null`" != "@FVWM_BINDIR@/fvwm-config" ]; then
111 echo "[FVWM-Themes]: There is no correct fvwm-config in your PATH; prepended"
112 PATH
="@FVWM_BINDIR@:$PATH"
116 # check that @bindir@ is in $PATH and first for fvwm-themes-config
117 if [ "`which fvwm-themes-config 2>/dev/null`" != "@bindir@/fvwm-themes-config" ]; then
118 echo "[FVWM-Themes]: There is no correct fvwm-themes-config in your PATH; prepended"
119 PATH
="@bindir@:$PATH"
124 echo "[FVWM-Themes]: Starting FVWM under the $session fvwm-themes session"
125 if [ "$start" = "yes" ]; then
126 exec $fvwmExe -f "$rcName" $fvwmArgs