On Sat, 29 Oct 2005 17:09, Florian Weimer wrote:
> Is there an easy way to switch to a configuration which uses just a
> single prefix key? (Such a configuration would be as Emacs-friendly
> as possible, I think.)
>
> I'm using Debian's 20050820-5 package.
Your request spurred me into doing something I've been thinking about
for a while. I customised some config files and attached them. Chuck
them in your ~/.ion3/ directory (if you're using ion3) and have a play
around (after backing up what you've got in there already of course).
They are pretty different from the default stuff, but...you'll get used
to it.
Note: I did these quickly and there may be some conflicts (although I
don't think they are). There's also some hardwired keys, like Alt+F4
and Alt+Tab which isn't elegant but works. Modify cfg_ion.lua ION_KEY,
ION_COMBO and ION_MOD to your taste.
Byron
--
--
-- Ion bindings configuration file. Global bindings and bindings common
-- to screens and all types of frames only. See modules' configuration
-- files for other bindings.
--
-- This configuration has been heavily modified by Byron Hillis.
-- It encourages GNU Screen style interaction.
-- Define a default key to provide access to almost all other functions.
-- The bindings in this context are available all the time.
--
-- The variable MOD1 should contain a string of the form 'Mod1+'
-- where Mod1 maybe replaced with the modifier you want to use for most
-- of the bindings. Similarly MOD2 may be redefined to add a
-- modifier to some of the F-key bindings.
defbindings("WScreen", {
submap(ION_COMBO, {
bdoc("Switch to n:th object (workspace, full screen client window) "..
"within current screen."),
kpress("1", "WScreen.switch_nth(_, 0)"),
kpress("2", "WScreen.switch_nth(_, 1)"),
kpress("3", "WScreen.switch_nth(_, 2)"),
kpress("4", "WScreen.switch_nth(_, 3)"),
kpress("5", "WScreen.switch_nth(_, 4)"),
kpress("6", "WScreen.switch_nth(_, 5)"),
kpress("7", "WScreen.switch_nth(_, 6)"),
kpress("8", "WScreen.switch_nth(_, 7)"),
kpress("9", "WScreen.switch_nth(_, 8)"),
kpress("0", "WScreen.switch_nth(_, 9)"),
bdoc("Switch to next/previous object within current screen."),
kpress("P", "WScreen.switch_prev(_)"),
kpress("N", "WScreen.switch_next(_)"),
bdoc("Go to previous active object."),
kpress(ION_KEY, "ioncore.goto_previous()"),
bdoc("Clear all tags."),
kpress(ION_MOD.."T", "ioncore.clear_tags()"),
bdoc("Create a new workspace of chosen default type."),
kpress("F9", "ioncore.create_ws(_)"),
bdoc("Display the main menu."),
kpress("F12", "mod_menu.bigmenu(_, _sub, 'mainmenu')"),
bdoc("Display the window list menu."),
kpress("quotedbl", "mod_menu.pmenu(_, _sub, 'windowlist')"),
}),
mpress("Button3", "mod_menu.pmenu(_, _sub, 'mainmenu')"),
bdoc("Display the window list menu."),
mpress("Button2", "mod_menu.pmenu(_, _sub, 'windowlist')"),
-- Uncomment & Modify For Multihead
--
-- bdoc("Go to n:th screen on multihead setup."),
-- kpress(MOD1.."Shift+1", "ioncore.goto_nth_screen(0)"),
-- kpress(MOD1.."Shift+2", "ioncore.goto_nth_screen(1)"),
-- bdoc("Go to next/previous screen on multihead setup."),
-- kpress(MOD1.."Shift+Left", "ioncore.goto_next_screen()"),
-- kpress(MOD1.."Shift+Right", "ioncore.goto_prev_screen()"),
})
-- WMPlex context bindings
--
-- These bindings work in frames and on screens. The innermost of such
-- contexts/objects always gets to handle the key press. Most of these
-- bindings define actions on client windows. (Remember that client windows
-- can be put in fullscreen mode and therefore may not have a frame.)
--
-- The "_sub:WClientWin" guards are used to ensure that _sub is a client
-- window in order to stop Ion from executing the callback with an invalid
-- parameter if it is not and then complaining.
defbindings("WMPlex", {
bdoc("Kill client owning current client window."),
kpress_wait("Mod1+Shift+F4", "WClientWin.kill(_sub)", "_sub:WClientWin"),
bdoc("Close current object."),
kpress_wait("Mod1+F4", "WRegion.rqclose_propagate(_, _sub)"),
submap(ION_COMBO, {
bdoc("Nudge current client window. This might help with some "..
"programs' resizing problems."),
kpress_wait("L",
"WClientWin.nudge(_sub)", "_sub:WClientWin"),
bdoc("Toggle fullscreen mode of current client window."),
kpress_wait("Return",
"WClientWin.set_fullscreen(_sub, 'toggle')",
"_sub:WClientWin"),
-- bdoc("Send next key press to current client window. "..
-- "Some programs may not allow this by default."),
-- kpress("Q", "WClientWin.quote_next(_sub)", "_sub:WClientWin"),
bdoc("Query for manual page to be displayed."),
kpress("F1", "mod_query.query_man(_, ':man')"),
bdoc("Show the Ion manual page."),
kpress(ION_MOD.."F1", "ioncore.exec_on(_, ':man ion3')"),
bdoc("Run a terminal emulator."),
kpress("X", "ioncore.exec_on(_, 'x-terminal-emulator')"),
bdoc("Query for command line to execute."),
kpress("C", "mod_query.query_exec(_)"),
bdoc("Query for Lua code to execute."),
kpress(ION_MOD.."L", "mod_query.query_lua(_)"),
bdoc("Query for host to connect to with SSH."),
kpress("O", "mod_query.query_ssh(_, ':ssh')"),
bdoc("Query for file to edit."),
kpress("E",
"mod_query.query_editfile(_, 'run-mailcap --action=edit')"),
bdoc("Query for file to view."),
kpress(ION_MOD.."E",
"mod_query.query_runfile(_, 'run-mailcap --action=view')"),
bdoc("Query for workspace to go to or create a new one."),
kpress(ION_MOD.."F9", "mod_query.query_workspace(_)"),
bdoc("Query for a client window to go to."),
kpress("G", "mod_query.query_gotoclient(_)"),
})
})
-- WFrame context bindings
--
-- These bindings are common to all types of frames. The rest of frame
-- bindings that differ between frame types are defined in the modules'
-- configuration files.
defbindings("WFrame", {
submap(ION_COMBO, {
bdoc("Tag current object within the frame."),
kpress("T", "WRegion.set_tagged(_sub, 'toggle')", "_sub:non-nil"),
bdoc("Switch to n:th object within the frame."),
kpress(ION_MOD.."1", "WFrame.switch_nth(_, 0)"),
kpress(ION_MOD.."2", "WFrame.switch_nth(_, 1)"),
kpress(ION_MOD.."3", "WFrame.switch_nth(_, 2)"),
kpress(ION_MOD.."4", "WFrame.switch_nth(_, 3)"),
kpress(ION_MOD.."5", "WFrame.switch_nth(_, 4)"),
kpress(ION_MOD.."6", "WFrame.switch_nth(_, 5)"),
kpress(ION_MOD.."7", "WFrame.switch_nth(_, 6)"),
kpress(ION_MOD.."8", "WFrame.switch_nth(_, 7)"),
kpress(ION_MOD.."9", "WFrame.switch_nth(_, 8)"),
kpress(ION_MOD.."0", "WFrame.switch_nth(_, 9)"),
bdoc("Switch to next/previous object within the frame."),
kpress(ION_MOD.."N", "WFrame.switch_next(_)"),
kpress(ION_MOD.."P", "WFrame.switch_prev(_)"),
bdoc("Move current object within the frame left/right."),
kpress("bracketleft", "WFrame.dec_index(_, _sub)", "_sub:non-nil"),
kpress("bracketright", "WFrame.inc_index(_, _sub)", "_sub:non-nil"),
bdoc("Maximize the frame horizontally/vertically."),
kpress("H", "WFrame.maximize_horiz(_)"),
kpress("V", "WFrame.maximize_vert(_)"),
bdoc("Attach tagged objects to this frame."),
kpress("A", "WFrame.attach_tagged(_)"),
bdoc("Query for a client window to attach to active frame."),
kpress(ION_MOD.."A", "mod_query.query_attachclient(_)"),
bdoc("Begin move/resize mode."),
kpress("R", "WFrame.begin_kbresize(_)"),
bdoc("Display frame context menu."),
kpress("M", "mod_menu.menu(_, _sub, 'ctxmenu')"),
}),
bdoc("Display frame context menu."),
mpress("Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"),
bdoc("Switch the frame to display the object indicated by the tab."),
mclick("[EMAIL PROTECTED]", "WFrame.p_switch_tab(_)"),
mclick("[EMAIL PROTECTED]", "WFrame.p_switch_tab(_)"),
bdoc("Resize the frame."),
mdrag("[EMAIL PROTECTED]", "WFrame.p_resize(_)"),
mdrag(MOD1.."Button3", "WFrame.p_resize(_)"),
bdoc("Move the frame."),
mdrag(MOD1.."Button1", "WFrame.p_move(_)"),
bdoc("Move objects between frames by dragging and dropping the tab."),
mdrag("[EMAIL PROTECTED]", "WFrame.p_tabdrag(_)"),
mdrag("[EMAIL PROTECTED]", "WFrame.p_tabdrag(_)"),
})
-- WMoveresMode context bindings
--
-- These bindings are available keyboard move/resize mode. The mode
-- is activated on frames with the command begin_kbresize (bound to
-- MOD1.."R" above by default).
defbindings("WMoveresMode", {
bdoc("Cancel the resize mode."),
kpress("AnyModifier+Escape","WMoveresMode.cancel(_)"),
bdoc("End the resize mode."),
kpress("AnyModifier+Return","WMoveresMode.finish(_)"),
bdoc("Grow in specified direction."),
kpress("Left", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
kpress("Right", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
kpress("Up", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
kpress("Down", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
kpress("F", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
kpress("B", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
kpress("P", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
kpress("N", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
bdoc("Shrink in specified direction."),
kpress("Shift+Left", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
kpress("Shift+Right", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
kpress("Shift+Up", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
kpress("Shift+Down", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
kpress("Shift+F", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
kpress("Shift+B", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
kpress("Shift+P", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
kpress("Shift+N", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
bdoc("Move in specified direction."),
kpress(MOD1.."Left", "WMoveresMode.move(_,-1, 0)"),
kpress(MOD1.."Right", "WMoveresMode.move(_, 1, 0)"),
kpress(MOD1.."Up", "WMoveresMode.move(_, 0,-1)"),
kpress(MOD1.."Down", "WMoveresMode.move(_, 0, 1)"),
kpress(MOD1.."F", "WMoveresMode.move(_,-1, 0)"),
kpress(MOD1.."B", "WMoveresMode.move(_, 1, 0)"),
kpress(MOD1.."P", "WMoveresMode.move(_, 0,-1)"),
kpress(MOD1.."N", "WMoveresMode.move(_, 0, 1)"),
})
--
-- Ion ionws module configuration file
--
-- Bindings for the tiled workspaces (ionws). These should work on any
-- object on the workspace.
defbindings("WIonWS", {
kpress(MOD2.."Tab", "WIonWS.goto_dir(_, 'right')"),
kpress(MOD2.."Shift+Tab", "WIonWS.goto_dir(_, 'left')"),
submap(ION_COMBO, {
bdoc("Split current frame vertically."),
kpress("S", "WIonWS.split_at(_, _sub, 'bottom', true)"),
bdoc("Go to frame above/below/right/left of current frame."),
kpress("U", "WIonWS.goto_dir(_, 'above')"),
kpress("D", "WIonWS.goto_dir(_, 'below')"),
bdoc("Split current frame horizontally."),
kpress(ION_MOD.."S", "WIonWS.split_at(_, _sub, 'right', true)"),
bdoc("Destroy current frame."),
kpress("J", "WIonWS.unsplit_at(_, _sub)"),
}),
})
-- Frame bindings. These work in (Ion/tiled-style) frames. Some bindings
-- that are common to all frame types and multiplexes are defined in
-- ion-bindings.lua.
--defbindings("WFrame-on-WIonWS", {
--})
-- WFloatFrame context menu extras
if mod_menu then
defctxmenu("WIonWS", {
menuentry("Destroy frame",
"WIonWS.unsplit_at(_, _sub)"),
submenu("Flip&transpose", {
menuentry("Flip", "_:node_of(_sub):parent():flip()"),
menuentry("Transpose", "_:node_of(_sub):parent():transpose()"),
menuentry("Flip at root", "_:split_tree():flip()"),
menuentry("Transpose at root", "_:split_tree():transpose()"),
}),
submenu("Split", {
menuentry("Vertically",
"WIonWS.split_at(_, _sub, 'bottom', true)"),
menuentry("Horizontally",
"WIonWS.split_at(_, _sub, 'right', true)"),
menuentry("Vertically at root",
"WIonWS.split_top(_, 'bottom')"),
menuentry("Horizontally at root",
"WIonWS.split_top(_, 'right')"),
}),
submenu("Toggle floating", {
menuentry("Left",
"WIonWS.set_floating_at(_, _sub, 'toggle', 'left')"),
menuentry("Right",
"WIonWS.set_floating_at(_, _sub, 'toggle', 'right')"),
menuentry("Up",
"WIonWS.set_floating_at(_, _sub, 'toggle', 'up')"),
menuentry("Down",
"WIonWS.set_floating_at(_, _sub, 'toggle', 'down')"),
}),
})
end
--
-- Ion main configuration file
--
--
-- Some basic setup
--
-- Set default modifiers. Alt should usually be mapped to Mod1 on
-- XFree86-based systems. The flying window keys are probably Mod3
-- or Mod4; see the output of 'xmodmap'.
MOD1="Control+"
MOD2="Mod1+"
ION_KEY="K"
ION_MOD=MOD1
ION_COMBO=ION_MOD..ION_KEY
ioncore.set{
-- Maximum delay between clicks in milliseconds to be considered a
-- double click.
dblclick_delay=250,
-- For keyboard resize, time (in milliseconds) to wait after latest
-- key press before automatically leaving resize mode (and doing
-- the resize in case of non-opaque move).
kbresize_delay=1500,
-- Opaque resize?
opaque_resize=false,
-- Movement commands warp the pointer to frames instead of just
-- changing focus. Enabled by default.
warp=true,
-- Default workspace type.
default_ws_type="WIonWS",
framed_transients=true
}
--
-- Load some modules, extensions and other configuration files
--
-- Load some modules.
dopath("mod_query")
dopath("mod_menu")
dopath("mod_ionws")
dopath("mod_floatws")
dopath("mod_panews")
dopath("mod_statusbar")
dopath("mod_dock")
dopath("mod_sp")
-- Load some kludges to make apps behave better.
dopath("cfg_kludges")
-- Make some bindings.
dopath("cfg_bindings")
-- Define some menus (mod_menu required)
dopath("cfg_menus")
dopath("cfg_user", true)
-- Special Keybindings