[kde] dolphin menu pamac

How to find package from a dolphin file ?
Add menu "is in package ?"

in ~/.local/share/kservices5/ directory create file pacman.desktop

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/all
Actions=actions;
# by default is in sub-menu "Actions"
#X-KDE-Submenu=Pacman
# no want insert item in sub-menu
#X-KDE-Priority=TopLevel
X-KDE-StartupNotify=false

[Desktop Action actions]
Name=is in package ?
Name[fr]=est dans un paquet ?
Comment=this file is in package ?
Icon=system-software-install
# if no use pamac can display simple dialog
# Exec=bash -c 'pkg="$(pacman -Qo %F)" 2>/dev/null; [[ -n "$pkg" ]] && kdialog --msgbox  "$pkg" --title "pacman";'
#load pamac gui
Exec=bash -c 'pkg="$(pacman -Qoq %F)" 2>/dev/null; [[ -n "$pkg" ]] && pamac-manager --details="$pkg";'

if file is in pacman package, pamac is loaded, but we can also only display a dialogbox


ps: small bug with pamac : pamac can only display one package (for example if we select directory /usr/)

6 Likes

That's very neat. :stuck_out_tongue:

1 Like

Hey there!
I'm a newbie and I don't understand this language you pros talk in :crying_cat_face:

Where should I get started with learning this kind of stuff, can anyone help? :hugs:

https://techbase.kde.org/Development/Tutorials/Creating_Dolphin_Service_Menus

Exists a store if you can't write yours

3 Likes

Thanks!

Forum kindly sponsored by