Added kickoffcfg script to manage addition and removal of favorites from kickoff menu

Removed firefox, amarok and dragonplayer from default kickoffrc
This commit is contained in:
Silvan Calarco 2011-06-02 15:59:13 +02:00
parent 33eba70db5
commit b902b3a6a6
3 changed files with 36 additions and 1 deletions

View File

@ -145,6 +145,7 @@ install-kde-distro-addons: dist-update
$(INSTALL_DATA) kde/config/plasma-desktoprc $(DESTDIR)$(kdeconfigdir)/plasma-desktoprc $(INSTALL_DATA) kde/config/plasma-desktoprc $(DESTDIR)$(kdeconfigdir)/plasma-desktoprc
$(INSTALL_DATA) kde/config/powerdevilrc $(DESTDIR)$(kdeconfigdir)/powerdevilrc $(INSTALL_DATA) kde/config/powerdevilrc $(DESTDIR)$(kdeconfigdir)/powerdevilrc
cp -a kde/wallpapers/$(WALLPAPER) $(DESTDIR)$(kdewallpapersdir) cp -a kde/wallpapers/$(WALLPAPER) $(DESTDIR)$(kdewallpapersdir)
$(INSTALL_SCRIPT) bin/kickoffcfg $(DESTDIR)$(bindir)/kickoffcfg
install-srpms: install-srpms:
@$(INSTALL_DIR) $(DESTDIR)$(distrosrpmsdir) @$(INSTALL_DIR) $(DESTDIR)$(distrosrpmsdir)

34
bin/kickoffcfg Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
[ "$1" -a "$2" ] || {
echo "KDE4 kickoff configuration tool"
echo
echo "Usage: kickoffcfg {--add-favorite|--del-favorite} /path/to/desktopfile.desktop"
echo
exit 1
}
FAVORITES=`kreadconfig --file /opt/kde/share/config/kickoffrc --group Favorites --key FavoriteURLs 2>/dev/null`
if [ "$1" = "--add-favorite" ]; then
# ADD
echo "$FAVORITES" | grep $2 >/dev/null || {
if [ "$FAVORITES" ]; then
FAVORITES="$FAVORITES,$2"
else
FAVORITES="$2"
fi
kwriteconfig --file /opt/kde/share/config/kickoffrc --group Favorites --key FavoriteURLs $FAVORITES
}
elif [ "$1" = "--del-favorite" ]; then
# DELETE
MODFAVORITES=`echo "$FAVORITES" | sed "s|$2||" | sed "s| ,||" | sed "s|,,|,|"`
if [ ! "$MODFAVORITES" ]; then
kwriteconfig --file /opt/kde/share/config/kickoffrc --group Favorites --key FavoriteURLs ''
elif [ "$FAVORITES" != "$MODFAVORITES" ]; then
kwriteconfig --file /opt/kde/share/config/kickoffrc --group Favorites --key FavoriteURLs $MODFAVORITES
fi
else
echo "Invalid option $1; aborting."
exit 1
fi
exit 0

View File

@ -1,2 +1,2 @@
[Favorites] [Favorites]
FavoriteURLs=/opt/kde/share/applications/dolphin.desktop,/usr/share/applications/mozilla-firefox3.desktop,/opt/kde/share/applications/amarok.desktop,/opt/kde/share/applications/dragonplayer.desktop FavoriteURLs=/opt/kde/share/applications/dolphin.desktop