Le lun 10/03/2003 � 03:44, Brent Hasty a �crit :
> On Sunday 09 March 2003 06:44 pm, Jean-Michel Dault wrote:
> I like these real tips like you and Jim are providing. I have a user setup on 
> my system who is a nobody I just use it to define the desktop (for each 
> diffrence in each new mdk release) I use this as a skeleton and copy it into 
> any new users directory then chown it to the new user, who can take it from 
> there.
> 
> Is there a skeleton profile somewhere in mandrake that can be edited 
> (particuarly for KDE) and if so whear is it found?

Better than a skeleton, here is the kdesktop-links that me and the
Sherbrooke University Users Group came up with for their deployment.
It's in attachment.

This creates default icons, a default theme, default language
preferences and other stuff for new users.

This was for 9.0 and probably needs to be redone, but it's a good
starting point.

You'll have to look in /usr/share/config for the default Mandrake files.
I don't suggest modifying them, since they'll affect all users on the
system, and will be overriden if you upgrade KDE.

Jean-Michel
#!/bin/sh

if [ ! -d $HOME/Desktop ]; then
        mkdir -p $HOME/Desktop
fi

# Media
if [ ! -e ~/Desktop/.md5sumetcfstab ] || [ $(md5sum -c ~/Desktop/.md5sumetcfstab | awk '{print $2}') != OK ]; then
	   
	   # CD-ROM
	   for i in $(grep cdrom /etc/fstab | grep -v ^# | awk '{print $1 $2 $3 $4}'); do
		   if [ $(echo $i | grep supermount) ] ; then
			   supermount=1
			   dev=$(echo $i | awk -F, '{print $1}' | sed -e 's/.*dev=//')
			   i=$(echo $i | sed -e 's/supermount.*//')
		   else supermount=0
			   i=$(echo $i | sed -e 's/adfs.*//;s/affs.*//;s/auto.*//;s/coherent.*//;s/cramfs.*//;s/efs.*//;s/ext.*//;s/ext2.*//;s/ext3.*//;s/hfs.*//;s/hpfs.*//;s/iso9660.*//;s/jfs.*//;s/minix.*//;s/msdos.*//;s/ncpfs.*//;s/ntfs.*//;s/qnx4.*//;s/reiserfs.*//;s/romfs.*//;s/sysv.*//;s/tmpfs.*//;s/udf.*//;s/ufs.*//;s/umsdos.*//;s/vfat.*//;s/xenix.*//;s/xfs.*//;s/xiafs.*//')
			   dev=$(echo $i | sed -e 's/\/mnt.*//')
		   fi

		   template="/usr/share/templates/.source/CDROM-Device.desktop"
		   mountpoint=$(echo $i | sed -e 's/.*\/mnt/\/mnt/')
		   name=$(echo $i | sed -e 's/.*cdrom/cd-rom/' | tr '[a-z]' '[A-Z]')
		   output="$HOME/Desktop/Media/$name"
		   if [ $supermount = 0 ] && [ ! -e $HOME/Desktop/Media/.$name ]; then
			   if [ ! -d $HOME/Desktop/Media/ ]; then
				   mkdir -p $HOME/Desktop/Media/
				   cp /usr/share/mdk/kde/removable_media.directory $HOME/Desktop/Media/.directory
			   fi
			   perl -pi -e "s|MountPoint=|MountPoint=$mountpoint|;s|Dev=|Dev=$dev|;s|Icon=.*|Icon=cd.png|" < $template > $output
			   touch $HOME/Desktop/.$name
		   elif [ $supermount = 1 ] && [ ! -e $HOME/Desktop/Media/.$name ]; then
			   if [ ! -d $HOME/Desktop/Media/ ]; then
				   mkdir -p $HOME/Desktop/Media/
				   cp /usr/share/mdk/kde/removable_media.directory $HOME/Desktop/Media/.directory
			   fi
			   perl -pi -e "s|^[F;M;R;T;U].*\n||;s|Dev=\n|Dev=$dev\nType=Link\nURL=$mountpoint\n|;s|Icon=.*\n|Icon=cd.png\n|" < $template > $output
			   touch $HOME/Desktop/Media/.$name
		   fi

	   done


	   # Floppy
	   for i in $(grep floppy /etc/fstab | grep -v ^# | awk '{print $1 $2 $3 $4}'); do
		   if [ $(echo $i | grep supermount) ] ; then
			   supermount=1
			   dev=$(echo $i | awk -F, '{print $1}' | sed -e 's/.*dev=//')
			   i=$(echo $i | sed -e 's/supermount.*//')
		   else supermount=0
			   i=$(echo $i | sed -e 's/adfs.*//;s/affs.*//;s/auto.*//;s/coherent.*//;s/cramfs.*//;s/efs.*//;s/ext.*//;s/ext2.*//;s/ext3.*//;s/hfs.*//;s/hpfs.*//;s/iso9660.*//;s/jfs.*//;s/minix.*//;s/msdos.*//;s/ncpfs.*//;s/ntfs.*//;s/qnx4.*//;s/reiserfs.*//;s/romfs.*//;s/sysv.*//;s/tmpfs.*//;s/udf.*//;s/ufs.*//;s/umsdos.*//;s/vfat.*//;s/xenix.*//;s/xfs.*//;s/xiafs.*//')
			   dev=$(echo $i | sed -e 's/\/mnt.*//')
		   fi

		   template="/usr/share/templates/.source/Floppy.desktop"
		   mountpoint=$(echo $i | sed -e 's/.*\/mnt/\/mnt/')
		   name=$(echo $i | sed -e 's/.*floppy/Floppy/')
		   output="$HOME/Desktop/Media/$name"

		   if [ $supermount = 0 ] && [ ! -e $HOME/Desktop/Media/.$name ]; then
			   if [ ! -d $HOME/Desktop/Media/ ]; then
				   mkdir -p $HOME/Desktop/Media/
				   cp /usr/share/mdk/kde/removable_media.directory $HOME/Desktop/Media/.directory
			   fi
			   perl -pi -e "s|MountPoint=|MountPoint=$mountpoint|;s|Dev=|Dev=$dev|;s|Icon=.*|Icon=3floppy_unmount.png|" < $template > $output
			   touch $HOME/Desktop/Media/.$name
		   elif [ $supermount = 1 ] && [ ! -e $HOME/Desktop/Media/.$name ]; then
			   if [ ! -d $HOME/Desktop/Media/ ]; then
				   mkdir -p $HOME/Desktop/Media/
				   cp /usr/share/mdk/kde/removable_media.directory $HOME/Desktop/Media/.directory
			   fi
			   perl -pi -e "s|^[F;M;R;T;U].*\n||;s|Dev=\n|Type=Link\nURL=$mountpoint\n|;s|Icon=.*\n|Icon=3floppy_unmount.png\n|" < $template > $output
			   touch $HOME/Desktop/Media/.$name
		   fi

	   done

	   
	   # Zip
	   for i in $(grep zip /etc/fstab | grep -v ^# | awk '{print $1 $2 $3 $4}'); do
		   if [ $(echo $i | grep supermount) ] ; then
			   supermount=1
			   template="/usr/share/mdk/kde/Zip.desktop"
			   dev=$(echo $i | awk -F, '{print $1}' | sed -e 's/.*dev=//')
			   i=$(echo $i | sed -e 's/supermount.*//')
		   else supermount=0
			   template="/usr/share/mdk/kde/Zip2.desktop"
			   i=$(echo $i | sed -e 's/adfs.*//;s/affs.*//;s/auto.*//;s/coherent.*//;s/cramfs.*//;s/efs.*//;s/ext.*//;s/ext2.*//;s/ext3.*//;s/hfs.*//;s/hpfs.*//;s/iso9660.*//;s/jfs.*//;s/minix.*//;s/msdos.*//;s/ncpfs.*//;s/ntfs.*//;s/qnx4.*//;s/reiserfs.*//;s/romfs.*//;s/sysv.*//;s/tmpfs.*//;s/udf.*//;s/ufs.*//;s/umsdos.*//;s/vfat.*//;s/xenix.*//;s/xfs.*//;s/xiafs.*//')
			   dev=$(echo $i | sed -e 's/\/mnt.*//')
		   fi

		   mountpoint=$(echo $i | sed -e 's/.*\/mnt/\/mnt/')
		   name=$(echo $i | sed -e 's/.*zip/Zip/')
		   output="$HOME/Desktop/Media/$name"

		   if [ $supermount = 0 ] && [ ! -e $HOME/Desktop/Media/.$name ]; then
			   if [ ! -d $HOME/Desktop/Media/ ]; then
				   mkdir -p $HOME/Desktop/Media/
				   cp /usr/share/mdk/kde/removable_media.directory $HOME/Desktop/Media/.directory
			   fi
			   perl -pi -e "s|MountPoint=.*|MountPoint=$mountpoint|;s|Dev=.*|Dev=$dev|;s|Icon=.*|Icon=zip_unmount.png|" < $template > $output
			   touch $HOME/Desktop/Media/.$name
		   elif [ $supermount = 1 ] && [ ! -e $HOME/Desktop/Media/.$name ]; then
			   if [ ! -d $HOME/Desktop/Media/ ]; then
				   mkdir -p $HOME/Desktop/Media/
				   cp /usr/share/mdk/kde/removable_media.directory $HOME/Desktop/Media/.directory
			   fi
			   #perl -pi -e "s|^[F;M;R;T;U].*\n||;s|Dev=\n|Type=Link\nURL=$mountpoint\n|" < $template > $output
			   perl -pi -e "s|^URL=.*\n|URL=$mountpoint\n|;s|Icon=.*\n|Icon=zip_unmount.png\n|" < $template > $output
			   touch $HOME/Desktop/Media/.$name
		   fi
	   done
 
fi

if [ ! -e $HOME/Desktop/.md5sumetcfstab ]; then
	md5sum /etc/fstab > $HOME/Desktop/.md5sumetcfstab
fi


cd $HOME/Desktop

[ -e $HOME/Desktop/.directory ]|| cat << EOF > .directory
[IconPosition::Calc]
X=31
Y=408

[IconPosition::Corbeille]
X=21
Y=136

[IconPosition::Trash]
X=21
Y=136

[IconPosition::EMail]
X=30
Y=272

[IconPosition::Home]
X=19
Y=68

[IconPosition::MP3]
X=31
Y=476

[IconPosition::Media]
X=29
Y=5

[IconPosition::Office]
X=30
Y=340

[IconPosition::WEB]
X=31
Y=204
EOF


# Home directory
if [ ! -e $HOME/Desktop/.home ]; then
touch $HOME/Desktop/.home
cat << EOF > Home
[Desktop Entry]
Name=Home
Comment=Home
Exec=kfmclient openProfile filemanagement
Terminal=false
Icon=folder_home.png

Encoding=UTF-8
Terminal=0
GenericName=Personal Files
Type=Application
Name[fr_CA]=Dossier personnel
Name[fr]=Dossier personnel
EOF
fi

if [ ! -e $HOME/Desktop/.web ]; then
touch $HOME/Desktop/.web
cat << EOF > WEB
[Desktop Entry]
Comment=The free and open source web browser
Comment[fr]=Navigateur internet gratuit et open source
Exec=soundwrapper /usr/bin/mozilla %u
Icon=netscape
MimeType=text/html
Name=WEB
ServiceTypes=
Terminal=false
Type=Application
EOF
fi


if [ ! -e $HOME/Desktop/.calc ]; then
touch $HOME/Desktop/.calc
cat << EOF > Calc
[Desktop Entry]
Comment=KCalc
DocPath=kcalc/index.html
Encoding=UTF-8
Exec=kcalc  -caption "%c" %i %m
GenericName=Scientific Calculator
Icon=kcalc.png
Name=Calc
Terminal=0
Type=Application
X-KDE-StartupNotify=true
EOF
fi

if [ ! -e $HOME/Desktop/.email ]; then
touch $HOME/Desktop/.email
cat << EOF > EMail
[Desktop Entry]
Comment=The free and open source web browser
Comment[fr]=Navigateur internet gratuit et open source
Exec=/usr/bin/mozilla  -mail
Icon=email
MimeType=
Name=EMail
ServiceTypes=
Terminal=false
Type=Application

EOF
fi

if [ ! -e $HOME/Desktop/.mp3 ]; then
touch $HOME/Desktop/.mp3
cat << EOF > MP3
[Desktop Entry]
Comment=Multimedia Player
Comment[fr]=Lecteur multim�dia
Exec=soundwrapper xmms
Icon=xmms_classic
MimeType=application/x-ogg;audio/x-mp3;audio/x-mpegurl;audio/x-ogg;audio/x-wav;video/mpeg
Name=MP3
ServiceTypes=
Terminal=false
Type=Application
EOF
fi

if [ ! -e $HOME/Desktop/.office ]; then
touch $HOME/Desktop/.office
cat << EOF > Office
[Desktop Entry]
Comment=OpenOffice.org Word Processing Component
Comment[fr]=Processeur de texte d'OpenOffice.org
Exec=ooffice
Icon=soffice
MimeType=application/msword;application/vnd.ms-word;application/vnd.stardivision.writer;application/vnd.sun.xml.writer;application/x-doc;text/rtf
Name=Office
ServiceTypes=
SwallowExec=
SwallowTitle=
Terminal=false
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
fi


#sleep 2s
#/usr/bin/dcop kdesktop KDesktopIface lineupIcons


mkdir -p $HOME/.kde/share/apps/kdisplay/color-schemes/
cd $HOME/.kde/share/apps/kdisplay/color-schemes/
[ -f UdeS.kcsrc ] || cat << EOF > UdeS.kcsrc
[Color Scheme]
Name=UdeS
activeBackground=32,113,32
activeBlend=33,68,156
activeForeground=255,255,255
activeTitleBtnBg=220,220,220
alternateBackground=238,246,255
background=220,220,220
buttonBackground=228,228,228
buttonForeground=0,0,0
contrast=7
foreground=0,0,0
inactiveBackground=220,220,220
inactiveBlend=220,220,220
inactiveForeground=0,0,0
inactiveTitleBtnBg=220,220,220
linkColor=0,0,192
selectBackground=119,131,189
selectForeground=255,255,255
visitedLinkColor=128,0,128
windowBackground=255,255,255
windowForeground=0,0,0
EOF

cd $HOME/.kde/share/config
if [ ! -f $HOME/.kde/.UdeS ];then
#/usr/bin/dcop kdesktop KDesktopIface rearrangeIcons
cat << EOF >> konsolerc

[TipOfDay]
RunOnStart=false

EOF
touch $HOME/.kde/.UdeS
fi

[ -f kdeglobals ] || cat << EOF > kdeglobals
[Desktops]
Name_1=1
Name_2=2
Number=2

[KDE]
SingleClick=false
colorScheme=UdeS.kcsrc

[WM]
activeBackground=32,113,32

[Icons]
Theme=UdeS

[DesktopIcons]
Size=32
EOF


[ -f kickerrc ] || cat << EOF > kickerrc
[Applet_1]
ConfigFile=minipager_panelapplet
DesktopFile=minipagerapplet.desktop
FreeSpace=0
WidthForHeightHint=89

[Applet_2]
ConfigFile=taskbar_panelappletrc
DesktopFile=taskbarapplet.desktop
FreeSpace=0
WidthForHeightHint=208

[Applet_3]
ConfigFile=lockout_panelapplet
DesktopFile=lockout.desktop
FreeSpace=1
WidthForHeightHint=68

[Applet_4]
ConfigFile=systemtray_panelappletrc
DesktopFile=systemtrayapplet.desktop
FreeSpace=1
WidthForHeightHint=8

[Applet_5]
ConfigFile=clock_panelappletrc
DesktopFile=clockapplet.desktop
FreeSpace=1
WidthForHeightHint=69

[DesktopButton_1]
FreeSpace=0

[General]
Applets=KMenuButton_1,DesktopButton_1,ServiceButton_1,ServiceButton_2,Applet_1,Applet_2,Applet_3,Applet_4,Applet_5

[KMenuButton_1]
FreeSpace=0

[ServiceButton_1]
DesktopFile=Terminals/konsole.desktop
FreeSpace=0

[ServiceButton_2]
DesktopFile=Configuration/Mandrake Control Center.desktop
FreeSpace=0
EOF

[ -f ktaskbarrc ] || cat << EOF > ktaskbarrc
[General]
GroupTasks=false
LeftButtonAction=Show Task List
MiddleButtonAction=Activate, Raise or Minimize Task
RightButtonAction=Show Operations Menu
ShowAllWindows=true
ShowIcon=true
ShowWindowListBtn=true
SortByDesktop=true

EOF

[ -f kwinrc ] || cat << EOF > kwinrc
[Style]
ButtonsOnLeft=MS
ButtonsOnRight=HIAX
CustomButtonPositions=false
PluginLib=kwin_redmond
ShowToolTips=true
EOF

Reply via email to