Device Settings - On Insert, On Unmount, On Remove fail to pass %m mount point value to bash script
SpaceFM also has this same issue. They do pass the %v device and %l label, but not %m mount point. I created a createdesktopicon script and a removedesktopicon script, but with the current zzzfm or spacefm antiX programs they don't work. I came up with a workaround to not use the %m mount point in the naming scheme to allow me to create and remove dynamic desktop icons as flashdrives are added or removed.
The script command in setting for On Insert would be: createdesktopicon %m %v %l
The script command in setting for On Unmount or On Remove would be: removedesktopicon %m %v %l
To install workaround for antiX 21 and change to zzz-icewm desktop:
- Download createdesktopicon above
- Open a terminal, change to your ~/Downloads directory
cd ~/Downloads - Make createdesktopicon executable
chmod +x createdesktopicon - Copy to /usr/local/bin
sudo cp createdesktopicon /usr/local/bin - Download removedesktopicon above
- Make removedesktopicon executable
chmod +x removedesktopicon - Copy to /usr/local/bin
sudo cp removedesktopicon /usr/local/bin - Exit zzzfm if you have it open and remove all flashdrives using Unplug Removable Device toolbar option.
- Backup existing zzzfm session file just in case
cp ~/.config/zzzfm/session ~/.config/zzzfm/session.bak - Edit ~/.config/zzzfm/session [MOD] section, change settings for On Insert, On Unmount, and On Remove, then save file
geany ~/.config/zzzfm/session
dev_exec_insert-s=createdesktopicon %m %v %l
dev_exec_unmount-s=removedesktopicon %m %v %l
dev_exec_remove-s=~removedesktopicon %m %v %l
- Change to zzz-icewm desktop antiX Menu >> Desktop >> Other Desktops >> zzz-icewm
- Try inserting a flashdrive. Open it's icon on the desktop (should open with zzzfm). Remove or unmount it via toolbar, menu or zzzfm. Icon should be removed from the desktop after it is gone.
Here is an animation of me adding and removing a flashdrive running antiX 21 with current code and using the zzz-icewm desktop.
Separately, and not required for the workaround, I have also attached a revised version of vfs-volume-nohal.c where I think I have the On Insert fixed. I haven't attempted to fix the On Unmount or On Remove, yet. C is not a language I normally program in, so I have limited ability, and any code I write should be tested.
