Commit b902b3a6a6a27ace01b7d7e00ef2547939447483

Authored by Silvan Calarco
1 parent 33eba70db5
Exists in master

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

Removed firefox, amarok and dragonplayer from default kickoffrc

Showing 3 changed files with 36 additions and 1 deletions Side-by-side Diff

... ... @@ -145,6 +145,7 @@
145 145 $(INSTALL_DATA) kde/config/plasma-desktoprc $(DESTDIR)$(kdeconfigdir)/plasma-desktoprc
146 146 $(INSTALL_DATA) kde/config/powerdevilrc $(DESTDIR)$(kdeconfigdir)/powerdevilrc
147 147 cp -a kde/wallpapers/$(WALLPAPER) $(DESTDIR)$(kdewallpapersdir)
  148 + $(INSTALL_SCRIPT) bin/kickoffcfg $(DESTDIR)$(bindir)/kickoffcfg
148 149  
149 150 install-srpms:
150 151 @$(INSTALL_DIR) $(DESTDIR)$(distrosrpmsdir)
  1 +#!/bin/sh
  2 +[ "$1" -a "$2" ] || {
  3 + echo "KDE4 kickoff configuration tool"
  4 + echo
  5 + echo "Usage: kickoffcfg {--add-favorite|--del-favorite} /path/to/desktopfile.desktop"
  6 + echo
  7 + exit 1
  8 +}
  9 +
  10 +FAVORITES=`kreadconfig --file /opt/kde/share/config/kickoffrc --group Favorites --key FavoriteURLs 2>/dev/null`
  11 +
  12 +if [ "$1" = "--add-favorite" ]; then
  13 + # ADD
  14 + echo "$FAVORITES" | grep $2 >/dev/null || {
  15 + if [ "$FAVORITES" ]; then
  16 + FAVORITES="$FAVORITES,$2"
  17 + else
  18 + FAVORITES="$2"
  19 + fi
  20 + kwriteconfig --file /opt/kde/share/config/kickoffrc --group Favorites --key FavoriteURLs $FAVORITES
  21 + }
  22 +elif [ "$1" = "--del-favorite" ]; then
  23 + # DELETE
  24 + MODFAVORITES=`echo "$FAVORITES" | sed "s|$2||" | sed "s| ,||" | sed "s|,,|,|"`
  25 + if [ ! "$MODFAVORITES" ]; then
  26 + kwriteconfig --file /opt/kde/share/config/kickoffrc --group Favorites --key FavoriteURLs ''
  27 + elif [ "$FAVORITES" != "$MODFAVORITES" ]; then
  28 + kwriteconfig --file /opt/kde/share/config/kickoffrc --group Favorites --key FavoriteURLs $MODFAVORITES
  29 + fi
  30 +else
  31 + echo "Invalid option $1; aborting."
  32 + exit 1
  33 +fi
  34 +exit 0
kde/config/kickoffrc
1 1 [Favorites]
2   -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
  2 +FavoriteURLs=/opt/kde/share/applications/dolphin.desktop