Tuesday, November 02, 2010

Adding an Action menu / service menu in kde4

Gnome has a much better way of handling bash scripts though once you get a hang of KDE was of doing things - it works out just fine.

We will use the last post for setting a wallpaper ans make it work in dolphin / konquerer file managers Action menu ;-)

  1. Make a new folder called ServiceMenus - normaly it does not exist by default

    mkdir /home/user/.kde4/share/kde4/services/ServiceMenus
     
  2. create a text file with .desktop extension
  3. copy the following text into it using the text editor of your choosing - I like nano or kate.

    [Desktop Entry]
    Encoding=UTF-8
    ServiceTypes=KonqPopupMenu/Plugin,image/*
    TryExec=/home/user/bin/scripts/conwall.sh
    Type=Service
    Actions=chwall;
    TryExec=/home/user/bin/scripts/conwall.sh

    [Desktop Action chwall]
    Name=Change wallpaper
    Icon=ksplash
    Exec=/home/user/bin/scripts/conwall.sh %f

  4. change the user with the account name of the user.
  5. right click on any image in the above file managers and you should see "Change wallpaper" option in  the Action menu.
Please post comments if there are any questions...

No comments:

Post a Comment