LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-19-2016, 09:53 AM   #1
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Trisquel-Mini 7.0, Lubuntu 14.04, Debian lxde 8.0
Posts: 311
Blog Entries: 2

Rep: Reputation: 16
Smile Use keybindings to launch programs


SEARCH
Can a keybinding in ~/.config/openbox/lubuntu-rc.xml be bound to a shellscript?
Use a keybinding to bound a shellscript
Link keybinding to a command

INTRO
In lubuntu 14.04, when one wants to change/add keybindings, you can open up ~/.config/openbox/lubuntu-rc.xml and add in your keybinding. Recently I have added a keybinding to vertically maximize the active window, by pasting the following code in between </keybind> and </keybind key = ...> in the <keyboard> section:
Code:
    <!--MAXIMIZE VERTICAL-->
    <!--Super+Alt+Enter: Maximize Vertically-->
    <keybind key="W-Return">
      <action name="ToggleMaximizeVert"/>
    </keybind>
MAIN QUESTION:
I have a shellscript that I would like to make a keybinding for. But when I write:
Code:
    <keybind key="W-Return">
      <action name="/home/${USER}/myshellscript.sh"/>
    </keybind>
in lubuntu-rc.xml it doesn't execute myshellscript.sh.

How can we use a key binding to launch a shell script?

Last edited by andrew.comly; 02-19-2016 at 10:09 AM. Reason: clarity
 
Old 02-19-2016, 10:00 AM   #2
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Trisquel-Mini 7.0, Lubuntu 14.04, Debian lxde 8.0
Posts: 311

Original Poster
Blog Entries: 2

Rep: Reputation: 16
Cool [solved]

Eureka!! I found it by randomly reading the file lubuntu-rc.xml, which is a bit strange since I never learned xml.

Solution
Code:
<keybind key="Keybinding Code Here">
	<action name="Execute">
		<command>YourCommandHere</command>
      </action>
e.g.
Code:
    <keybind key="S-A-Right">
	  <action name="Execute">
		<command>wmctrl -r :ACTIVE: -T "Active Window" -t 1</command>
      </action>
	  <action name="Execute">
		<command>/home/a/scripts/desktopA2.sh</command>
      </action>
    </keybind>

Last edited by andrew.comly; 02-19-2016 at 10:12 AM. Reason: formula
 
  


Reply

Tags
keybindings, shell script, xml



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "Permission denied" when Openbox tries to execute autostart.sh in ~/.config/openbox alarazr Linux - Software 4 10-04-2012 03:50 PM
[SOLVED] openbox- autostart.sh, rc.xml, menu.xml fail to load new-here Slackware 2 08-07-2012 07:15 PM
Cannot cp menu.xml, rc.xml, and autostart.sh (Openbox) oalicein Linux - Newbie 2 02-10-2011 05:52 PM
Lubuntu- Wireless works fine in LXDE, but not icewm or openbox FunkyPenguin Linux - Newbie 7 01-17-2011 06:11 PM
OpenBox menu.xml error Cmdr_K00n Linux - Newbie 1 06-22-2004 06:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration