You are not logged in.

#1 2010-07-17 20:40:07

dameunmate
Member
From: London
Registered: 2010-01-19
Posts: 85
Website

[SOLVED] Openbox: keybinding to nano a file

in /home/USERNAME/rc.xml is it possible to set a keybinding to open a file for editing in a terminal?

I'm using urxvt and nano, and I'm new to both Arch and Openbox so I'm configuring non-stop and spend an awful lot of time typing "nano .config/openbox/rc.xml over and over again! I've managed to set a keybinding to reconfigure Openbox, that has saved time but now I want to be able to open rc.xml for editing at the press of a button (or two).

Last edited by dameunmate (2010-07-17 21:27:58)

Offline

#2 2010-07-17 20:48:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Openbox: keybinding to nano a file

alias xx="nano ~/.config/openbox/rc.xml"

Put it in your .bashrc (if you use bash). If it doesn't work, try using full path.

Offline

#3 2010-07-17 21:22:11

munkyeetr
Member
From: Merritt, BC
Registered: 2008-08-07
Posts: 83

Re: [SOLVED] Openbox: keybinding to nano a file

        <action name="Execute">
            <command>urxvt -e nano /home/USER/.config/openbox/rc.xml</command>
        </action>

If the advice you're given in this forum solves your issue, please mark the post as [SOLVED] in consideration to others.

"More than any time in history mankind faces a crossroads. One path leads to despair and utter hopelessness, the other to total extinction.
Let us pray that we have the wisdom to choose correctly." -- Woody Allen

Offline

#4 2010-07-17 21:43:05

dameunmate
Member
From: London
Registered: 2010-01-19
Posts: 85
Website

Re: [SOLVED] Openbox: keybinding to nano a file

Thanks munkyeetr, that worked a treat! There's so many things I can do with that command...
And thanks karol I didn't try that but now I've learnt to use alias!

Well here's the code in rc.xml that works for me:

<keyboard>

  <keybind key="C-W-r">
    <action name="Reconfigure"/>
  </keybind>

  <keybind key="C-W-x">
     <action name="Execute">
        <command>urxvt -e nano .config/openbox/rc.xml</command>
      </action>
  </keybind>

</keyboard>

So right now I can simply press Ctrl + Super + x and rc.xml is open and ready for editing. And press Ctrl + Super + r to openbox --reconfigure. Saves a HUGE amount of time, seeing as I'm opening it every other minute, and I'm such a slow typer! I'm a right noob but I'm already loving this customisability...


keybinding open start nano vim edit editing text file console command terminal rc.xml keyboard shortcut filename

Offline

Board footer

Powered by FluxBB