mount .iso file with custom action in Dolphin

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
tony37
Posts: 1306
Joined: Sat Jul 18, 2020 12:34 pm

mount .iso file with custom action in Dolphin

#1 Post by tony37 »

Sometimes I want to check some files on the file system of an .iso file, and instead of using a Virtualbox, I found out someone has written the very useful /usr/local/bin/isomount program, which mounts .iso files at /mnt/iso.
And to make live a tad easier, I created a custom action for Dolphin (in KDE), so I can right-click an .iso file and select 'isomount'. For this I created a file called /usr/share/kservices5/ServiceMenus/isomount.desktop with following content:

Code: Select all

[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/x-cd-image;
Actions=isomount;
X-KDE-AuthorizeAction=shell_access

[Desktop Action isomount]
TryExec=konsole
Exec=konsole -e bash -c 'isomount "${@}"; ANYKEY="Press any key to close"; ANYKEY=$(gettext -d mx-goodies "$ANYKEY"); echo; read -n 1 -s -r -p "$ANYKEY"' bash %F
Icon=emblem-mounted
Name=Isomount

Comment=mount iso file at /mnt/iso
If anyone else finds this useful, then maybe someone can write a custom action for Thunar and maybe this could be added to MX 21...

User avatar
m_pav
Developer
Posts: 1909
Joined: Sun Aug 06, 2006 3:02 pm

Re: mount .iso file with custom action in Dolphin

#2 Post by m_pav »

Nice! Not a KDE user myself, but maybe you could get Adrians attention for his next build.
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD Ryzen 5 5600G, 32G, 8TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

User avatar
dolphin_oracle
Developer
Posts: 22796
Joined: Sun Dec 16, 2007 12:17 pm

Re: mount .iso file with custom action in Dolphin

#3 Post by dolphin_oracle »

quick question: do dolphin custom actions show up even if the target utility is not present? (I presume yes, but thought I would ask).
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

tony37
Posts: 1306
Joined: Sat Jul 18, 2020 12:34 pm

Re: mount .iso file with custom action in Dolphin

#4 Post by tony37 »

so you mean when there's no 'isomount' installed? yes, it still shows, opening bash with 'command not found'
or do you mean if there's no 'konsole' installed? well, if I deliberately misspell 'konsole' as 'konsol', then I still have a custom action for .iso files, but getting a window with: can't find program 'konsol'

User avatar
dolphin_oracle
Developer
Posts: 22796
Joined: Sun Dec 16, 2007 12:17 pm

Re: mount .iso file with custom action in Dolphin

#5 Post by dolphin_oracle »

tony37 wrote: Mon May 24, 2021 10:17 am so you mean when there's no 'isomount' installed? yes, it still shows, opening bash with 'command not found'
or do you mean if there's no 'konsole' installed? well, if I deliberately misspell 'konsole' as 'konsol', then I still have a custom action for .iso files, but getting a window with: can't find program 'konsol'
I meant about isomount, but either works for my purposes, thanks.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

tony37
Posts: 1306
Joined: Sat Jul 18, 2020 12:34 pm

Re: mount .iso file with custom action in Dolphin

#6 Post by tony37 »

I've noticed one tiny bug with this custom action: in the resulting terminal, I get errors about 'line 1366: losetup: command not found'
This doesn't cause problems, but I don't get these errors when I manually do 'isomount path_to_iso_file'

edit: now I remember my solution (I had reinstalled the isomount package): change line 1366 to

Code: Select all

    /usr/sbin/losetup -nl -O name,back-file | grep "^$dev " | sed -r 's/^[^ ]+ +//'
(so specifying the location of losetup)

Post Reply

Return to “Tips & Tricks by users (not for help)”