Does anyone know if a script exists that would dynamically generate a menu of current mountable volumes detected by hal such as cds/dvds/usbdisks etc. Also maybe provide some actions depending on the volume type?
If not any suggestions on what the best way to implement this would be and what would have to be looked into
Sorry I hadnât replied. Ya I not sure what command you could really parse output from maybe lshal. But I think it might be possible to communicate with hal directly via dbus. I believe that is how ivman and gnome-volume-manager and what not work?
Not quite. Wanted each device to have some options associated with that type. Like for floppy/usbdisk i could unmount it, browse it. cds could eject and such. Would be even nicer if for instance audio cd there was option to rip cd and such.
Maybe give âivmanâ a try, it mounts the things automatically and I think it is capable of doing stuff with the mounted media.
but I guess it would be possible to generate a menu using lshall.
but Iâm affraid I canât help you much, as Iâm not very familiar with âsedâ.
I guess youâll need âgrepâ and âgrep -vâ first to loose the garbage of lshal. Once you have a combination of commands that gives you the lines mentionning the devices that are detected (also unmounted stuff if Iâm not mistaken), you can use âsedâ to remove unwanted stuff from a line of the output of the previous command.
I once looked at sed trying to understand it, as I saw it being used in many scripts to generate menus etc., but I still find it a bit difficult to use it.
Ya I think you can get ivman to execute different programs/scripts when certain media is detected. I guess I could probably right some kind of script that would write different info on what is currently mounted/pluged-in and what type of media it is into a simple easy to parse file. That way I could just have another script parse the file and generate the menu. Probably easier then trying to parse the output of lshalâŚ
Oh and I am not sure if it can perform actions on removal of media, I hope so anyway.
you might also take a look at Brice13âs config. he made a disk-mounter script to mount/umount things. It also shows different icons in case the drive is mounted/umounted
It is an old post, but an interesting matter. I donât know much about udev, hal and dbus. but maybe at it is possible to check something in /sys. This link can help (inclusive the links on the page): HAL and device management
A problem seam to be at udev, hal and dbus are independant from the wm. So, the mount-umount operation as well as other actions (as to start an audio player or whatever) have to be done at the system level, not at the wm level. This: HOWTO D-BUS, HAL, KDE media:/ and this: HOWTO ivman can be useful.
This cannot add or remove something from the fvwm menu, but ivman can write or remove a file, maybe directly or with a seperate script, file that can be used by the menu generation feature of fvwm.
Another way would be to not use ivman but write a program, some kind of new fvwm module for that, but it will require more programmer skils.
I have recently used udev to automount devices (without ivman) giving a simple and powerful automount system you can use in fvwm that has nothing to envy to KDE. There is an example in this post. Cheers!
Well, I guess than, if I want to incorporate such a function into fvwm-crystal, I must separate it into 2 parts, a system specific part and a fvwm specific part.
On linux, the system specific parts can be some udev rule(s) that will interact in some way with fvwm. As example, the udev rule(s) can maintain a file with a defined syntax, file that can be used inside fvwm by the icon-launch function. That way, on other systems, folks will only have to contribute a way to create and maintain this file.
I am working on the Amiga recipe (among other things) . On the real machine, it was desktop icons for every mounted drive and for the ram disk. I feel they are handy. And also I like to have some nice picture on my desk, and to click on a desk icon is a good opportunity to take a look at it.
I want some function that will launch an icon on the desktop for every mounted partition. For now, I check mtab and launch icons only for the drives/partitions (stuffs beginning with /dev/*). It is easy to associate actions to the icons like to launch a file manager with the corresponding path (thunar at that time).
I am also working on the next release, but thatâs another story. Those desktop icons will be implemented only into the Amiga recipe, and they are not my top priority for this release.