PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 25, 2012, 11:06:49 PM


Login with username, password and session length


Pages: [1] 2   Go Down
  Print  
Author Topic: LXDE - halevt - perform your predefined actions with hal-events ...  (Read 4451 times)
flux
Sr. Member
****
Offline Offline

Posts: 342


« on: December 24, 2009, 07:44:02 AM »

Edit by Admin: halevt is no longer needed with the current PCManFM. 0.9.9

To make LXDE behave like KDE or Gnome (auto events with plugged-in devices like digicams, dvb-t-adapters, usb-devices or inserted CD/DVD with Audio, Video, datas) you can install the package

halevt

via synaptic (make sure to update libxml2 and install libxml2-devel, all packages you can find).

Then define your wished actions in a configuration file, e. g. in this way:

Code:
<?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.has_data = true">
<halevt:Insertion exec="pcmanfm"/>
</halevt:Device>

<halevt:Device match="hal.volume.disc.has_audio = true">
<halevt:Insertion exec="xmms /mnt/cdrom"/>
<halevt:Removal exec="killall xmms"/>
</halevt:Device>

<halevt:Device match="hal.volume.disc.has_video = true">
<halevt:Insertion exec="xine dvd://"/>
<halevt:Removal exec="killall xine"/>
</halevt:Device>

<halevt:Device match="hal.volume.disc.is_videodvd = true">
<halevt:Insertion exec="xine dvd://"/>
<halevt:Removal exec="killall xine"/>
</halevt:Device>

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_empty_cd_r">
<halevt:Insertion exec="gnomebaker"/>
</halevt:Device>

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_empty_cd_rw">
<halevt:Insertion exec="gnomebaker"/>
</halevt:Device>

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_empty_dvd">
<halevt:Insertion exec="gnomebaker"/>
</halevt:Device>

<halevt:Device match="hal.info.category = storage &amp; hal.storage.bus = usb">
            <halevt:Insertion exec="pcmanfm"/>
          </halevt:Device>

<halevt:Device match="hal.info.category = camera">
            <halevt:Insertion exec="gtkam"/>
          </halevt:Device>

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_AC">
            <halevt:Property name="hal.ac_adapter.present">
            <halevt:Action value="true" exec="notify-send -t 5000 -i /usr/share/icons/Tango/scalable/status/info.svg 'The AC adapter is connected now ...'"/>
           </halevt:Property>
          </halevt:Device>

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_AC">
            <halevt:Property name="hal.ac_adapter.present">
            <halevt:Action value="false" exec="notify-send -t 5000 -i /usr/share/icons/Tango/scalable/status/info.svg 'The AC adapter was removed ...'"/>
           </halevt:Property>
          </halevt:Device>

</halevt:Configuration>

Store the file as halevt.xml and move it in a root terminal to /etc/halevt/ ...

Then add the line

Code:
@halevt

to the file /etc/xdg/lxsession/LXDE/autostart and store it.

Then logout the current user and login again. The defined actions will perform if the hal-events will appear.

Change the /etc/halevt/halevt.xml to your needs, there are many other actions possible. I prefer to mount my plugged devices manually, therefore pcmanfm opens without mounting the device (I have several USB harddisks with more partitions and I want to decide which partition shall be mounted). You can edit the configuration file to open pcmanfm in the automounted partition too ...

Make sure to have a mountpoint /mnt/cdrom, if you want to play AudioCDS with xmms and my halevt.xml!
Remove all lines concerning CD/DVD/CDRW/DVDRW devices in your /etc/fstab, so that pcmanfm is allowed to mount CDs/DVDs with datas and or pictures using hal!
Make sure to install libnotify and notification-daemon to use the lines in my halevt.xml for the message "AC adapter ..." for note-/netbooks.

flux.
Logged
AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #1 on: July 31, 2010, 07:36:56 AM »

Thank You very much. I love it Smiley!

Now my LXDE is acting like KDE4 or even better Wink. I have no idea how to edit the HDDs to be automounted on plug-in even BUT I will get to this Cheesy!

Very very VERY useful stuff. Hope to see more howto's from You for LXDE in the future.

Cheers.

Andy
Logged

Neal ManBear
Administrator
Super Villain
*****
Offline Offline

Posts: 15189


LXDE! Coffee, Bacon and Cheesecake!


« Reply #2 on: July 31, 2010, 10:21:18 AM »

lxde-halevt-additions is in the repos. Smiley Once you have it installed, you can edit /etc/halevt/halevt.xml to add or make changes for your preferences. Smiley
Logged

AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #3 on: July 31, 2010, 10:28:26 AM »

AWESOME! I am on it! Cheesy! I think I am starting to like LXDE very much Wink!

Andy
Logged

Neal ManBear
Administrator
Super Villain
*****
Offline Offline

Posts: 15189


LXDE! Coffee, Bacon and Cheesecake!


« Reply #4 on: July 31, 2010, 10:33:44 AM »

 Smiley I believe that you are beginning to see what I see in LXDE. Smiley
Logged

AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #5 on: July 31, 2010, 12:25:21 PM »

Smiley I believe that you are beginning to see what I see in LXDE. Smiley

I do believe it too. Its amazing! Not sure would I drop my KDE4 laptop to LXDE yet but the Gnome laptop went to LXDE as soon as I fixed smplayer %20 issue. I started discovering it and I love it!

Andy
Logged

Neal ManBear
Administrator
Super Villain
*****
Offline Offline

Posts: 15189


LXDE! Coffee, Bacon and Cheesecake!


« Reply #6 on: July 31, 2010, 12:42:07 PM »

I have a KDE4, too (full monty). Otherwise everything is LXDE. Cheesy I sometimes have something else on a test partition, but the main install is LXDE. Cheesy
Logged

Leiche
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2702


God knows, i'm not an Angel!


WWW
« Reply #7 on: July 31, 2010, 02:15:50 PM »

welcome to LXDE, AndrzejL  Grin
Logged

AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #8 on: July 31, 2010, 04:39:58 PM »

I have a KDE4, too (full monty). Otherwise everything is LXDE. Cheesy I sometimes have something else on a test partition, but the main install is LXDE. Cheesy

I installed MiniMe 2010 KDE4 + all my apps + xfce + lxde + gnome on my oldie TPad 600E... I couldnt get the SMPlayer to work perfect with LXDE so I used gnome. It worked OK... Just OK. Today I found solution for SMPlayer %20 issue AND as soon as I realized I can use LXDE I started discovering it... Great stuff!

And You know what? Hootiegibbon who has exactly the same lappy is gonna use LXDE on it too Wink!

I hope You have a lot of answers COZ I have a lot of answers! Tongue

Andy

welcome to LXDE, AndrzejL  Grin

Thank You very much Cheesy! I intend to stay around! Cheesy

Andy
Logged

Hootiegibbon
Hero Member
*****
Offline Offline

Posts: 4206

Registered Linux User #421404


« Reply #9 on: July 31, 2010, 05:16:02 PM »


Quote
And You know what? Hootiegibbon who has exactly the same lappy is gonna use LXDE on it too Wink!

Yes i do and yes it will, I picked it up for £2 last week at a carboot sale, it came with no hard drive/caddy /cover and no charger (which I obtianed the day after for £4) I then was able to get given a 128meg stick of pc66 sodimm memory so with the onboard 32megs and the 64meg stick it came with it means that I have 224megs of ram (less 8megs ram for video) means that i have 216 usable megs of Ram, and no swap - I changed the optical driive to a dvd multiburner and had been using the smaller distros to test the hardware.

I cabn now confirm it is possible to run lxde-mini on this machine as a LiveCD (although its a little slow) as long as you dont try to launch Firefox its ok.

These older IBM's are great machines and LXDE is the way to go, I will be using a super-light browser with it, Xchat works just fine.

I cant wait to source the caddy and door for this thing as its fun

Jase
Logged

** FORUM SEARCH **

I am Hootiegibbon, undisputed champion fo the typo

My .dotfiles
silverbirch
Sr. Member
****
Offline Offline

Posts: 364



« Reply #10 on: September 20, 2010, 01:26:10 AM »

lxde-halevt-additions is in the repos. Smiley Once you have it installed, you can edit /etc/halevt/halevt.xml to add or make changes for your preferences. Smiley

Could you give an example of this please i.e. the edit and what it makes happen.   I haven't got my head around this and am trying to set up a laptop for a friend with only 256 memory.  The laptop only has 256 :-)

Many thanks
Logged

Pclinuxos 2010.1 KDE on AMD Athlon XP (runs as1.8 Ghz), 1 G memory, on board VIA graphics and sound
AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #11 on: September 20, 2010, 05:27:58 AM »

Install lxde-halevt-additions and reboot. Plug in pendrive or place a cd in the reader and depending on what is configured in the conf file LXDE will do it for You for example will open PCManFM or SMPlayer (or some other program)... There are some options pre-configured so standard conf file looks like the code placed in fluxes first post in this thread.

Regards.

Andy
Logged

Neal ManBear
Administrator
Super Villain
*****
Offline Offline

Posts: 15189


LXDE! Coffee, Bacon and Cheesecake!


« Reply #12 on: September 20, 2010, 09:21:50 AM »

As an example, if you prefer to use k3b as your CD/DVD burning software, you would need to edit line numbers 23 to 33 to set it:
Quote
<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_empty_cd_r">
<halevt:Insertion exec="k3b"/>
</halevt:Device>

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_empty_cd_rw">
<halevt:Insertion exec="k3b"/>
</halevt:Device>

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_empty_dvd">
<halevt:Insertion exec="k3b"/>
</halevt:Device>

Note that the k3b entry is in quotes (") after exec= . This is the place you need to make the changes.

Logged

AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #13 on: September 20, 2010, 09:41:09 AM »

As an example, if you prefer to use k3b as your CD/DVD burning software, you would need to edit line numbers 23 to 33 to set it:
Quote
<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_empty_cd_r">
<halevt:Insertion exec="k3b"/>
</halevt:Device>

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_empty_cd_rw">
<halevt:Insertion exec="k3b"/>
</halevt:Device>

<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_empty_dvd">
<halevt:Insertion exec="k3b"/>
</halevt:Device>

Note that the k3b entry is in quotes (") after exec= . This is the place you need to make the changes.

Thanks for that Smiley

Andy
Logged

michael.conner
Jr. Member
**
Offline Offline

Posts: 14


« Reply #14 on: October 07, 2010, 08:36:58 PM »

Excellent, thanks for this thread!
Logged

Registered Linux User #503121
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM