You are not logged in.

#1 2007-06-12 21:40:56

Mhyrraner
Member
From: South Germany
Registered: 2007-02-14
Posts: 33

e17+automount+icons

hey!

Since e17 has desktop icons support now, i wonderd how to make it automount with a icon showing up when a usb device is plugged in, for example. I have tried to start kde(mod) in background, which works just well, but then i have kdesktop(?) running, on which i cant use the e17-menu and can't change desktop with simple mouse scrooling (though it works with ALT+scrool). It isnt good for the resources of my old laptop, too (and takes about 20s to start tongue).

Has anyone tried a similiar thing already?
Or will i have to do some scripting, moving .desktop files or so, with autofs? ivman?

Would be very nice if someone could help me.
Thanks
MyR

Offline

#2 2007-06-23 10:56:03

Mhyrraner
Member
From: South Germany
Registered: 2007-02-14
Posts: 33

Re: e17+automount+icons

Ok, this post is currently the first result if you search for "e17 automount" in google (damn).

What i tried is: make a simple udev rule for usb-storage devices.
It's an ugly and unclean solution, be warned, and post a good alternative, if you can.
udev rule is somthing like:

# automount usb-devices and link icons to ~/Desktop
KERNEL=="sd[a-z]", NAME="%k", SYMLINK+="usbhd-%k", GROUP="users", OPTIONS="last_rule" 
ACTION=="add", KERNEL=="sd[a-z][0-9]", SYMLINK+="usbhd-%k", GROUP="users", NAME="%k" 
ACTION=="add", KERNEL=="sd[a-z][0-9]", RUN+="/bin/mkdir -p /media/usbhd-%k" 
ACTION=="add", KERNEL=="sd[a-z][0-9]", RUN+="/bin/ln -s /media/usbhd-%k /mnt/usbhd-%k" 
ACTION=="add", KERNEL=="sd[a-z][0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="swap", RUN+="/bin/swapon /dev/%k", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[a-z][0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o users,rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/%k /media/usbhd-%k", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[a-z][0-9]", RUN+="/bin/mount -t auto -o users,rw,noauto,noexec,nodev,noatime /dev/%k /media/usbhd-%k"
ACTION=="add", KERNEL=="sd[a-z][0-9]", RUN+="/bin/ln -s /home/$user/.Desktop/disk.desktop /home/$user/Desktop/%k.desktop", OPTIONS="last_rule" 
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/rm -f /mnt/usbhd-%k" 
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/rm -f /home/$user/Desktop/%k.desktop" 
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/umount -l /media/usbhd-%k" 
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/rmdir /media/usbhd-%k", OPTIONS="last_rule"

The Problem is: you'll have to unmount the device maually (pumount /dev/usbhd-...).

Any hints, suggestions etc. are welcome,
MyR
(Edit: looks like ...)

Last edited by Mhyrraner (2007-06-23 19:27:49)

Offline

#3 2007-06-23 18:50:49

Matt
Member
Registered: 2007-06-23
Posts: 4

Re: e17+automount+icons

Hi,

nice work, but you could just use the already in e integrated automount feature wink
You have to use a recent cvs version and compile e_dbus before e itself to get this magic feature enabled ^^

Screenshot: http://img503.imageshack.us/img503/1348/screentz0.png

-A big e-fan smile

Last edited by Matt (2007-06-23 18:51:41)

Offline

#4 2007-06-23 19:26:25

Mhyrraner
Member
From: South Germany
Registered: 2007-02-14
Posts: 33

Re: e17+automount+icons

Ha!

I've been waiting for something like this tongue
Thanks a lot!:)

MyR

Offline

#5 2007-06-23 20:02:30

Matt
Member
Registered: 2007-06-23
Posts: 4

Re: e17+automount+icons

np, support for that is in e since 16.06. wink

Offline

Board footer

Powered by FluxBB