Weblog entry #2 for e5z8652
#2
KDE and default applications...
Posted by e5z8652 on Fri 27 Oct 2006 at 06:08
I am more used to the fairly rational world of servers. A few config files that have global impact. Want Postfix to act differently? Edit /etc/postfix/main.cf and reload. Want to add a virtual host to Apache? Edit /etc/apache/httpd.conf and you're good.
I also use a desktop (KDE) and I like my multimedia. The desktop environment is a very different world than a server environment though.
I have safely stored away my CD's where my two kids can't get at them, and listen to the ripped ogg vorbis files with gnump3d. For this, I choose xmms. I also like to listen to BBC news' live feed, using Real's realplayer.
Over time I've migrated machines, rebuilt machines, etc. and have re-installed realplayer multiple times. Always _after_ I've installed xmms. And every single time, realplayer installs itself as the default application for m3u files, along with a lot of other stuff. So when I hit gnump3d to play some music, realplayer comes up and barfs on the ogg files.
I dutifully start kcontrol, select file types, audio, and go down the list moving realplayer out of the number 1 spot and moving xmms out of the bottom spot. (I prefer xmms to noatun, etc. so I go through all of the settings.) This is great, except that my wife and kids are left with realplayer trying to decipher Ogg Vorbis files. My wife is non-technical, and my six year old doesn't like dealing with "mime types." KDE respects user choice, so leaves RealPlayer at the top of their list. They also know xmms' keybindings. They understand it's GUI better than a sideways arrow on the taskbar. They especially don't get a sideways arrow that keeps playing the audio after they've killed the video window. So all of the local users on my machine prefer xmms.
This past summer after being faced with updating everyone's profile again I tried kiosktool, but that just ended up locking everyone out of the machine. Kdm would fail since they didn't have rights to their home directory anymore -- which I guess made my new "kiosk" nice and secure. I got smart and started to experiment with VMware images, but even that got old.
With new hardware installed, I decided to figure out how to set global preferences quickly and easily. Since RealPlayer knows how to do it, there must be an easy way for root, right? Google shows lots of questions, and lots of answers like "open the control center..." Grr.
My hack solution is this (it will probably wrap some lines):
#!/bin/bash
###########################################################
# set-KDE-preferences.sh
# copies one user's mime prefs to all other user's profiles
# James Zuelow // Juneau Linux User's Group
# 26 October 2006
###########################################################
echo -e -n "Copy mime application order from user: "
read mst_user
for tgt_user in `find /home/ -maxdepth 1 | awk -F "/" '{print $3}'`
do
if [ "${tgt_user}" == "${mst_user}" ]
then
continue
else
if [ -e /home/${tgt_user}/Desktop ]
then
echo "Copying application preferences from ${mst_user} to ${tgt_user}"
cp /home/${mst_user}/.kde/share/config/profilerc /home/${tgt_user}/.kde/share/config/profilerc
chown ${tgt_user}:${tgt_user} /home/${tgt_user}/.kde/share/config/profilerc
echo "`ls -l /home/${tgt_user}/.kde/share/config/profilerc`"
else
echo "Not a real user? (No desktop for: ${tgt_user})"
fi
fi
done
When you run it, it looks like this:
independence:~/bin# ./set-KDE-preferences.sh
Copy mime application order from user: james
Copying application preferences from james to gwen
-rw------- 1 gwen gwen 11150 2006-10-26 19:44 /home/gwen/.kde/share/config/profilerc
Not a real user? (No desktop for: lost+found)
Copying application preferences from james to melissa
-rw------- 1 melissa melissa 11150 2006-10-26 19:44 /home/melissa/.kde/share/config/profilerc
Copying application preferences from james to stephen
-rw------- 1 stephen stephen 11150 2006-10-26 19:44 /home/stephen/.kde/share/config/profilerc
independence:~/bin#
And it seems to get the job done without too much trouble. It would be nice if I could figure out how to get RealPlayer to not take over all of the file associations in the first place though. Although I don't think I have so much time to dig into it...
I also use a desktop (KDE) and I like my multimedia. The desktop environment is a very different world than a server environment though.
I have safely stored away my CD's where my two kids can't get at them, and listen to the ripped ogg vorbis files with gnump3d. For this, I choose xmms. I also like to listen to BBC news' live feed, using Real's realplayer.
Over time I've migrated machines, rebuilt machines, etc. and have re-installed realplayer multiple times. Always _after_ I've installed xmms. And every single time, realplayer installs itself as the default application for m3u files, along with a lot of other stuff. So when I hit gnump3d to play some music, realplayer comes up and barfs on the ogg files.
I dutifully start kcontrol, select file types, audio, and go down the list moving realplayer out of the number 1 spot and moving xmms out of the bottom spot. (I prefer xmms to noatun, etc. so I go through all of the settings.) This is great, except that my wife and kids are left with realplayer trying to decipher Ogg Vorbis files. My wife is non-technical, and my six year old doesn't like dealing with "mime types." KDE respects user choice, so leaves RealPlayer at the top of their list. They also know xmms' keybindings. They understand it's GUI better than a sideways arrow on the taskbar. They especially don't get a sideways arrow that keeps playing the audio after they've killed the video window. So all of the local users on my machine prefer xmms.
This past summer after being faced with updating everyone's profile again I tried kiosktool, but that just ended up locking everyone out of the machine. Kdm would fail since they didn't have rights to their home directory anymore -- which I guess made my new "kiosk" nice and secure. I got smart and started to experiment with VMware images, but even that got old.
With new hardware installed, I decided to figure out how to set global preferences quickly and easily. Since RealPlayer knows how to do it, there must be an easy way for root, right? Google shows lots of questions, and lots of answers like "open the control center..." Grr.
My hack solution is this (it will probably wrap some lines):
#!/bin/bash
###########################################################
# set-KDE-preferences.sh
# copies one user's mime prefs to all other user's profiles
# James Zuelow // Juneau Linux User's Group
# 26 October 2006
###########################################################
echo -e -n "Copy mime application order from user: "
read mst_user
for tgt_user in `find /home/ -maxdepth 1 | awk -F "/" '{print $3}'`
do
if [ "${tgt_user}" == "${mst_user}" ]
then
continue
else
if [ -e /home/${tgt_user}/Desktop ]
then
echo "Copying application preferences from ${mst_user} to ${tgt_user}"
cp /home/${mst_user}/.kde/share/config/profilerc /home/${tgt_user}/.kde/share/config/profilerc
chown ${tgt_user}:${tgt_user} /home/${tgt_user}/.kde/share/config/profilerc
echo "`ls -l /home/${tgt_user}/.kde/share/config/profilerc`"
else
echo "Not a real user? (No desktop for: ${tgt_user})"
fi
fi
done
When you run it, it looks like this:
independence:~/bin# ./set-KDE-preferences.sh
Copy mime application order from user: james
Copying application preferences from james to gwen
-rw------- 1 gwen gwen 11150 2006-10-26 19:44 /home/gwen/.kde/share/config/profilerc
Not a real user? (No desktop for: lost+found)
Copying application preferences from james to melissa
-rw------- 1 melissa melissa 11150 2006-10-26 19:44 /home/melissa/.kde/share/config/profilerc
Copying application preferences from james to stephen
-rw------- 1 stephen stephen 11150 2006-10-26 19:44 /home/stephen/.kde/share/config/profilerc
independence:~/bin#
And it seems to get the job done without too much trouble. It would be nice if I could figure out how to get RealPlayer to not take over all of the file associations in the first place though. Although I don't think I have so much time to dig into it...