diff --git a/Makefile b/Makefile index 6e69297..10c0819 100644 --- a/Makefile +++ b/Makefile @@ -145,6 +145,7 @@ install-kde-distro-addons: dist-update $(INSTALL_DATA) kde/config/plasma-desktoprc $(DESTDIR)$(kdeconfigdir)/plasma-desktoprc $(INSTALL_DATA) kde/config/powerdevilrc $(DESTDIR)$(kdeconfigdir)/powerdevilrc cp -a kde/wallpapers/$(WALLPAPER) $(DESTDIR)$(kdewallpapersdir) + $(INSTALL_SCRIPT) bin/kickoffcfg $(DESTDIR)$(bindir)/kickoffcfg install-srpms: @$(INSTALL_DIR) $(DESTDIR)$(distrosrpmsdir) diff --git a/bin/kickoffcfg b/bin/kickoffcfg new file mode 100755 index 0000000..8fbfd4e --- /dev/null +++ b/bin/kickoffcfg @@ -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 diff --git a/kde/config/kickoffrc b/kde/config/kickoffrc index e9103d7..0de6e1e 100644 --- a/kde/config/kickoffrc +++ b/kde/config/kickoffrc @@ -1,2 +1,2 @@ [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