Code: Select all
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
DESCRIPTION="A C++ library that supports a few operations on boolean expression binary trees."
HOMEPAGE="http://perso.b2b2c.ca/sarrazip/dev/boolstuff.html"
SRC_URI="http://perso.b2b2c.ca/sarrazip/dev/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND=""
RDEPEND=""
src_unpack() {
unpack ${P}.tar.gz
}
src_compile() {
einfo "Running configure"
econf || die "econf failed"
einfo "Building ${P}"
emake || die "emake failed"
}
src_install () {
einfo "Running make install"
emake DESTDIR="${D}" install || die "install failed"
}
Code: Select all
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
DESCRIPTION="A daemon built on ivman that executes arbitrary commands on HAL events"
HOMEPAGE="http://www.environnement.ens.fr/perso/dumas/halevt.html"
SRC_URI="http://www.environnement.ens.fr/perso/dumas/halevt-download/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND=">=sys-apps/hal-0.5.11-r1
>=sys-apps/dbus-1.2.3-r1
>=dev-libs/dbus-glib-0.76
>=dev-libs/glib-2.16.5
>=dev-libs/boolstuff-0.1.12"
RDEPEND=""
src_unpack() {
unpack ${P}.tar.gz
}
src_compile() {
einfo "Running configure"
econf || die "econf failed"
einfo "Building ${P}"
emake || die "emake failed"
}
src_install () {
einfo "Running make install"
emake DESTDIR="${D}" install || die "install failed"
}
Code: Select all
halevt -fI guess it's possible to create an init script to start halevt as root... the only issue I see with this is that some of the mounted devices may not be user accessible. I always had that problem with ivman, so I started it as my user instead of root.smlgbl wrote:Wow, finally there is a solution for this...and it works exactly how I had ivman configured.
Is there an option to make it run in like "system-mode", so that it is started even without a user being logged in? Kind of the way ivman was intended when run without a user instance (at least according to the man page).
Thanks for this work!
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<halevt:Configuration version="0.1" xmlns:halevt="http://www.environnement.ens.fr/perso/dumas/halevt.html">
<halevt:Device match="hal.volume.disc.is_videodvd">
<halevt:Insertion exec="/usr/bin/xine --auto-play --auto-scan dvd"/>
</halevt:Device>
</halevt:Configuration>
Code: Select all
<halevt:Device match="hal.block.device & hal.block.is_volume = true" value="usb">
<halevt:Property name="hal.volume.is_mounted">
<halevt:Action value="true" exec="xmessage 'USB Storage: $hal.volume.mount_point$ -- $hal.volume.label$'"/>
</halevt:Property>
</halevt:Device>Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<halevt:Configuration version="0.1" xmlns:halevt="http://www.environnement.ens.fr/perso/dumas/halevt.html">
<!--
Useful links:
http://people.freedesktop.org/~david/hal-spec/hal-spec.html
http://www.environnement.ens.fr/perso/dumas/halevt-doc/halevt.html
-->
<!-- DVD autoplay -->
<halevt:Device match="hal.volume.disc.is_videodvd = true">
<halevt:Insertion exec="xine --auto-play --auto-scan dvd"/>
</halevt:Device>
<!-- CD-ROM insertion -->
<halevt:Device match="hal.volume.disc.is_videodvd = false">
<halevt:Insertion exec="xmessage 'Inserted CD-ROM: $hal.volume.mount_point$ - $hal.volume.label$'"/>
</halevt:Device>
<!-- CD-ROM mounted -->
<halevt:Device match="hal.volume.disc.is_videodvd = false">
<halevt:Property name="hal.volume.is_mounted">
<halevt:Action value="true" exec="xmessage 'CD-ROM Mounted: $hal.volume.mount_point$ - $hal.volume.label$'"/>
</halevt:Property>
</halevt:Device>
<!-- CDROM Unmount -->
<halevt:Device match="hal.volume.disc.is_videodvd = false">
<halevt:Property name="hal.volume.is_mounted">
<halevt:Action value="false" exec="xmessage 'CD-ROM Unmounted: $hal.volume.mount_point$ - $hal.volume.label$'"/>
</halevt:Property>
</halevt:Device>
<!-- USB drive inserted -->
<halevt:Device match="hal.storage.bus = usb">
<halevt:Insertion exec="xmessage 'USB Storage: $hal.volume.mount_point$ - $hal.volume.label$'"/>
</halevt:Device>
<!-- USB drive mounted -->
<halevt:Device match="hal.volume.is_disc = false">
<halevt:Property name="hal.volume.is_mounted">
<halevt:Action value="true" exec="xmessage 'USB Storage mounted: $hal.volume.mount_point$ - $hal.volume.label$'"/>
</halevt:Property>
</halevt:Device>
<!-- USB Unmount -->
<halevt:Device match="hal.volume.is_disc = false">
<halevt:Property name="hal.volume.is_mounted">
<halevt:Action value="false" exec="xmessage 'USB Storage Unmounted: $hal.volume.mount_point$ - $hal.volume.label$'"/>
</halevt:Property>
</halevt:Device>
</halevt:Configuration>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE halevt:Configuration [
<!-- this entity corresponds with mountable devices, which have
volume.policy.should_mount true or don't have
volume.policy.should_mount false and are block devices hotpluggable or
removable.
-->
<!ENTITY MOUNTABLE "hal.block.device & hal.block.is_volume = true & (hal.volume.policy.should_mount = true | ((! hal.volume.policy.should_mount = false) & (hal.block.storage_device.hal.storage.policy.should_mount = true | ((! hal.block.storage_device.hal.storage.policy.should_mount = false) & (hal.block.storage_device.hal.storage.hotpluggable = true | hal.block.storage_device.hal.storage.removable = true)))))">
]>
<halevt:Configuration version="0.1" xmlns:halevt="http://www.environnement.ens.fr/perso/dumas/halevt.html">
<!-- audio CD -->
<halevt:Device match="hal.block.is_volume & hal.volume.disc.type=cd_rom & hal.volume.disc.has_audio=true & hal.volume.disc.has_data=false">
<halevt:Insertion exec="grip"/>
</halevt:Device>
<!-- blank CD/DVD -->
<halevt:Device match="hal.block.is_volume & hal.volume.is_disc=true & hal.volume.disc.is_blank=true">
<halevt:Insertion exec="k3b"/>
</halevt:Device>
<!--
This rule matches removable devices which have volume.policy.should_mount true
or don't have volume.policy.should_mount false.
Upon insertion, they are mounted and recorded by halevt-mount.
-m 002 sets the umask of mount to 002 when pmount is used system-wide
to mount the device. This allows regular users to read the device.
!-->
<halevt:Device match="&MOUNTABLE; & (!hal.volume.is_disc | hal.volume.is_disc=false)">
<halevt:Insertion exec="halevt-mount -u $hal.udi$ -o codepage=866,iocharset=koi8-r -m 002"/>
</halevt:Device>
<halevt:Device match="&MOUNTABLE; & hal.volume.is_disc=true">
<halevt:Insertion exec="halevt-mount -u $hal.udi$ -o iocharset=koi8-r -m 002"/>
</halevt:Device>
<!--
When a device get a mount point, it is passed to halevt-mount which can
record it. The property that changes is volume.is_mounted, and the action is
executed when the value of volume.is_mounted becomes true.
!-->
<halevt:Device match="hal.block.device & hal.block.is_volume = true & hal.volume.mount_point">
<halevt:Property name="hal.volume.is_mounted">
<halevt:Action value="true" exec="halevt-mount -s"/>
</halevt:Property>
</halevt:Device>
<!--
When a device is unmounted, it is recorded by halevt-mount.
!-->
<halevt:Device match="hal.block.device & hal.block.is_volume = true">
<halevt:Property name="hal.volume.is_mounted">
<halevt:Action value="false" exec="halevt-mount -s"/>
</halevt:Property>
</halevt:Device>
<!--
When a device is removed, it is recorded by halevt-mount.
Note that at that point the device is already out of hal, so we use
* which matches any device in the match attribute, and only pass the
udi to the command.
!-->
<halevt:Device match="hal.*">
<halevt:Removal exec="halevt-umount -u $hal.udi$; halevt-umount -s"/>
</halevt:Device>
<!--
Example of a use of OnInit. At startup all the devices are matched and the exec
comand is run for those that match. Here we match all the removable devices
that aren't already mounted and mount and register them.
!-->
<halevt:Device match="&MOUNTABLE; & (!hal.volume.is_disc | hal.volume.is_disc=false)">
<halevt:OnInit exec="halevt-mount -u $hal.udi$ -o codepage=866,iocharset=koi8-r -m 002"/>
</halevt:Device>
<halevt:Device match="&MOUNTABLE; & hal.volume.is_disc=true">
<halevt:OnInit exec="halevt-mount -u $hal.udi$ -o iocharset=koi8-r -m 002"/>
</halevt:Device>
</halevt:Configuration>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE halevt:Configuration [
<!-- this entity corresponds with mountable devices, which have
volume.policy.should_mount true or don't have
volume.policy.should_mount false and are block devices hotpluggable or
removable.
-->
<!ENTITY MOUNTABLE "hal.block.device & hal.block.is_volume = true & (hal.volume.policy.should_mount = true | ((! hal.volume.policy.should_mount = false) & (hal.block.storage_device.hal.storage.policy.should_mount = true | ((! hal.block.storage_device.hal.storage.policy.should_mount = false) & (hal.block.storage_device.hal.storage.hotpluggable = true | hal.block.storage_device.hal.storage.removable = true)))))">
]>
<halevt:Configuration version="0.1" xmlns:halevt="http://www.environnement.ens.fr/perso/dumas/halevt.html">
<halevt:Device match="hal.info.category=storage">
<halevt:Insertion exec="notify-send -i "/usr/kde/3.5/share/icons/crystalsvg/48x48/devices/usbpendrive_unmount.png" "Storage device detected" "$hal.info.product$""/>
<halevt:Removal exec="notify-send -i "/usr/kde/3.5/share/icons/crystalsvg/48x48/devices/usbpendrive_unmount.png" "Storage device removed" "$hal.info.product$""/>
</halevt:Device>
<halevt:Device match="hal.linux.subsystem=usb">
<halevt:Insertion exec="notify-send -i "/home/kos/.kde3.5/share/icons/Noia KDE 0.95/48x48/apps/usb.png" "USB device detected" "$hal.info.product$""/>
<halevt:Removal exec="notify-send -i "/home/kos/.kde3.5/share/icons/Noia KDE 0.95/48x48/apps/usb.png" "USB device removed" "$hal.info.product$""/>
</halevt:Device>
<!-- audio CD -->
<halevt:Device match="hal.block.is_volume & hal.volume.disc.type=cd_rom & hal.volume.disc.has_audio=true & hal.volume.disc.has_data=false">
<halevt:Insertion exec="notify-send -i "/usr/share/icons/oxygen/48x48/devices/media-optical-audio.png" "Audio CD inserted" "$hal.volume.label$""/>
</halevt:Device>
<!-- blank CD/DVD -->
<halevt:Device match="hal.block.is_volume & hal.volume.is_disc=true & hal.volume.disc.is_blank=true">
<halevt:Insertion exec="notify-send -i "/usr/share/icons/oxygen/48x48/devices/media-optical-recordable.png" "Blank recordable disc inserted" "$hal.block.storage_device$""/>
</halevt:Device>
<halevt:Device match="&MOUNTABLE;">
<halevt:Insertion exec="notify-send -i "/usr/share/icons/oxygen/48x48/devices/drive-removable-media-usb.png" "Mountable device inserted" "$hal.info.product$""/>
<halevt:Removal exec="notify-send -i "/usr/share/icons/oxygen/48x48/devices/drive-removable-media-usb.png" "Mountable device removed" "$hal.info.product$""/>
</halevt:Device>
<!-- open mounted device -->
<halevt:Device match="&MOUNTABLE;">
<halevt:Property name="hal.volume.is_mounted">
<halevt:Action value="true" exec="/home/kos/bin/open_mounted_device.sh "$hal.volume.mount_point$""/>
</halevt:Property>
</halevt:Device>
</halevt:Configuration>
I stopped using ivman and have switched over to halevt for a few months now. Overall I've had less problems with halevt than I had with ivman in the past.lyallp wrote:Is halevt the way to go? I might as well unmerge ivman as it's useless in it's current form.
I gather it's not in portage yet.
Is there any other alternative that is available in portage now?
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE halevt:Configuration [
<!-- this entity corresponds with mountable devices, which have
volume.policy.should_mount true or don't have
volume.policy.should_mount false and are block devices hotpluggable or
removable.
-->
<!ENTITY MOUNTABLE "hal.block.device & hal.block.is_volume = true & (hal.volume.policy.should_mount = true | ((! hal.volume.policy.should_mount = false) & (hal.block.storage_device.hal.storage.policy.should_mount = true | ((! hal.block.storage_device.hal.storage.policy.should_mount = false) & (hal.block.storage_device.hal.storage.hotpluggable = true | hal.block.storage_device.hal.storage.removable = true)))))">
]>
<halevt:Configuration version="0.1" xmlns:halevt="http://www.environnement.ens.fr/perso/dumas/halevt.html">
<!--
Remember to use & and " for & and " in xml attributes.
In a match attribute, hal.* is special since it matches any device.
In a match attribute property it is possible to refer to other
device properties. For example
hal.block.storage_device.hal.storage.policy.should_mount
refers to the storage.policy.should_mount property of the block.storage_device
device associated with a given device.
In an exec attribute, $hal.udi$ is special since it is replaced by
the device udi. $hal.some.property$ is replaced by the value
of the property some.property.
!-->
<!-- Removable devices support !-->
<!--
This rule matches removable devices which have volume.policy.should_mount true
or don't have volume.policy.should_mount false.
Upon insertion, they are mounted using KDE4's Solid framework
!-->
<halevt:Device match="&MOUNTABLE;">
<halevt:Insertion exec="solid-hardware mount $hal.udi$"/>
</halevt:Device>
<!-- CD-ROM ejection support !-->
<!--
This rule matches cdrom drives. When the eject button on the cdrom is pressed,
the disc is ejected using KDE4's Solid framework.
!-->
<halevt:Device match="hal.storage.drive_type = cdrom">
<halevt:Condition name="EjectPressed" exec="solid-hardware eject $hal.udi$"/>
</halevt:Device>
</halevt:Configuration>