Bit of a weird edge case here - I’m working with a non-root encrypted drive and using Dolphin to unlock/mount/unmount it works perfectly, but I’m trying to add a context menu action to lock it again. The use case I’m aiming for is unlocking the drive, editing, then locking it again; right now, I’ve made a .desktop service file that properly unmounts and locks the drive but it only appears in the main file window, rather than on the devices themselves. I can use it by navigating to the mountpoint in the main Dolphin window, then right clicking the folder there - what I’m aiming for is to be able to use it by right clicking the device in the Devices section. For reference, here’s the .desktop file:
[Desktop Entry]
Type=Service
X-KDE-Priority=TopLevel
MimeType=inode/directory;
Actions=lock;
[Desktop Action lock]
Name=Lock Drive
Icon=lock
Exec=TDEV=`df %u | grep -Eo '^[/a-z0-9]*'` && RDEV=`realpath --relative-to /dev $TDEV` && udisksctl unmount -b $TDEV && udisksctl lock -b /dev/`ls /sys/block/$RDEV/slaves`
My initial thought was that I just had the wrong MimeType, and needed inode/blockdevice or inode/mount-point or something. Unfortunately neither work - they’re ignored even in the main Dolphin window where inode/directory works (on folders that are mountpoints). I’ve read through all the documentation I can find, searched the web and this forum, and tried to use github’s (terrible) search in the Dolphin source code with no luck. Any chance someone here could give me a tip about how to add to Dolphin’s context menu in the side panel specifically?