Bug 2769 - temporarily chroot the keychain tree
Status: CLOSED FIXED
Alias: None
Product: Openbox
Classification: Unclassified
Component: general
Version: 3.3.1
Hardware: All All
: P1 enhancement
Assignee: Mikachu
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2006-07-01 06:01 EDT by Jonas Kölker
Modified: 2007-05-16 15:52:48 EDT
2 users (show)

See Also:


Attachments
implements temporary chrooting (10.54 KB, patch)
2007-01-23 23:38 EST, Jonas Kölker
Chrooting (again) (11.93 KB, patch)
2007-04-25 04:39 EDT, Jonas Kölker

Description Jonas Kölker 2006-07-01 06:01:18 EDT
Found this on the mailing list, at http://icculus.org/cgi-bin/ezmlm/ezmlm-cgi?24:mss:4088:200606:fdoclgfnfgmipgknmjdi

From: Clay Barnes <clay.barnes@gmail.com> 
Date: Sat, 24 Jun 2006 15:27:21 -0700

In relation to this thread, I see that OB3 supports Emacs-style
bindings.  I wonder how hard it would be to add a related bit of code
and some XML syntax.

My idea is a "locked into binding" mode.  There would be the possibility
of having a keybinding that starts like an Emacs binding (say Mod4+Scrol
Lock), but instead of terminating when the competing key combination is
pressed or with a timout, it would continue to parse keybindings until
ended by re-pressing the initiating combination.
Comment 1 Jonas Kölker 2006-07-01 06:09:25 EDT
One comment:  it would be useful to end the chroot with a key combination different from the one that started the chroot.  In that way, the chrooting can be used for quoting, including the start-chroot key combination.  See also the 'keymode' feature of fluxbox.
Comment 2 Jonas Kölker 2007-01-23 23:38:13 EST
Created attachment 1240 [details]
implements temporary chrooting
Comment 3 Ryan C. Gordon 2007-01-25 17:13:16 EST
Testing a bugzilla fix, please disregard this comment.

--icculus.org admin staff.

Comment 4 Mikachu 2007-01-25 17:30:36 EST
""
This patch implements temporary chrooting of the keychain tree.

Example config file snippetry:
<keybind key="C-A-v">
  <action name="chroot"/>
  <keybind key="C-A-r">
    <action name="unchroot"/>
  </keybind>
  <keybind key="C-A-x">
    <action name="toggledecor"/>
  </keybind>
</keybind>

The effect should be obvious: when you press C-A-v, until you press C-A-r, the only keybinding in effect is "C-A-x".

Previously, ob refused keybindings $x if it already knew of a keybinding $y such that $x was as prefix of $y or $y was a prefix of $x. Now, assuming $y=$x.$z, when you input $x, the action(s) of $x are performed.  If you then input $z (within the timeout), the actions of $y are performed.

In other words, ob traverses the tree, executing actions when it runs into them, and restarting the traversal when (and only when) it runs out of children.
""
Comment 5 Jonas Kölker 2007-01-26 10:12:56 EST
Testing a bugzilla fix, please disregard this comment.

--icculus.org user.
Comment 6 Jonas Kölker 2007-04-25 04:39:09 EDT
Created attachment 1316 [details]
Chrooting (again)

You broke my patch, I unbroke it.  Please apply it Real Soon Now :)
Comment 7 Dana Jansens 2007-04-25 22:16:08 EDT
I added chrooting to openbox. Hurrah. Thanks for your ideas !

syntax goes like:

  <keybind key="W-A-S-m" chroot="true">
  </keybind>
  <keybind key="W-A-m" chroot="true">
    <keybind key="W-A-m" chroot="true">
      <keybind key="Up"><action name="MaximizeVert"/></keybind>
      <keybind key="Down"><action name="UnmaximizeVert"/></keybind>
      <keybind key="Right"><action name="MaximizeHorz"/></keybind>
      <keybind key="Left"><action name="UnmaximizeHorz"/></keybind>
      <keybind key="Escape"><action name="BreakChroot"/></keybind>
    </keybind>
    <keybind key="Escape"><action name="BreakChroot"/></keybind>
  </keybind>

Use the BreakChroot action to break out of a chroot. Or the global quitChainKey to break out of everything.
Comment 8 Dana Jansens 2007-04-25 22:16:22 EDT
Closing