Installing a package through a Dolphin action

Hi all, I guess I’m becoming lazy.

I’ve just written a right-click service menu for Dolphin to install a package in Arch Linux (you could edit it to work with every package manager).

Here it’s:

[Desktop Entry]

[Desktop Action InstallWithPacman]
Name=Install package
Exec=kdesu konsole -e /bin/sh -c "pacman -U %U; read -p 'Press Enter to exit'"

Save that in $(kde4-config –localprefix)/share/kde4/services/ServiceMenus/ as something.desktop. Now, open Dolphin and right-click on a tar.xz archive, you will get something like this:

and then:

As you see multiple files selection works too. The Konsole terminal will not close after the installation so you can read the pacman output, to fetch errors and post_install messages. ~~I added the message “done, you can close konsole” to know when pacman quit~~.

PS. I found useful to have an Install package as dependence service too ;)

Tags: arch linux, howto, kde

By Andrea Scarpino on 2011-06-19

Discuss on HackerNews