Shortcut key to run script?

Problems with hardware & laptops not being detected or supported during or after install.
Locked
jlparsons
Posts: 3
Joined: Fri Mar 23, 2012 10:55 am

Shortcut key to run script?

Post by jlparsons »

Hi folks, I use a dual monitor setup on a laptop and have managed somehow to ham-fist my way to making a successful script that autodetects the best monitor and selects it at highest resolution. I've got this to work at startup and that's just dandy. Now I want to make it work on a hotkey. xev shows XF86Launch1 when the button is pressed.

tl;dr - how make lxde-rc.xml run script when press button?

This is what I've got so far:

Code: Select all

   <keybind key="XF86Launch1">
     <action name="Execute">
       <startupnotify>
         <enabled>true</enabled>
         <name>automonitor</name>
       </startupnotify>
       <command>/home/user/.monitorswitcher/automonitor.sh</command>
     </action>
   </keybind>
No worky. Obviously something stoopid I'm doing wrong... any ideas?
seppalta
Posts: 449
Joined: Tue Sep 20, 2011 6:09 am
Location: USA
Contact:

Re: Shortcut key to run script?

Post by seppalta »

I think the problem is in the first line of the code. You need to put dashes between the key symbols. Do you really want to use that many keys? For example,

Code: Select all

<keybind key="x-f">
,
if not already used, would do the job. Also, you should put it in the <!-- Keybindings for running applications --> section.
Locked