X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=etc%2Fcfg_ioncore.lua;h=be393c9b1a75664e0b6a4f79493d999da77d9b4a;hp=acf7e947a36bc7b5726ebc8cfcde4382d2aab8a4;hb=ae4260bb64817c11f9a7140324cd3e3ba113e297;hpb=8366314611bf30a0f31d25bf5f5023186fa87692 diff --git a/etc/cfg_ioncore.lua b/etc/cfg_ioncore.lua index acf7e94..be393c9 100644 --- a/etc/cfg_ioncore.lua +++ b/etc/cfg_ioncore.lua @@ -36,10 +36,12 @@ defbindings("WScreen", { bdoc("Switch to next/previous object within current screen."), kpress(META.."comma", "WScreen.switch_prev(_)"), kpress(META.."period", "WScreen.switch_next(_)"), - + submap(META.."K", { bdoc("Go to first region demanding attention or previously active one."), - kpress("K", "ioncore.goto_activity() or ioncore.goto_previous()"), + kpress("K", "mod_menu.grabmenu(_, _sub, 'focuslist')"), + -- Alternative without (cyclable) menu + --kpress("K", "ioncore.goto_activity() or ioncore.goto_previous()"), --bdoc("Go to previous active object."), --kpress("K", "ioncore.goto_previous()"), @@ -63,7 +65,7 @@ defbindings("WScreen", { kpress(META.."F9", "ioncore.create_ws(_)"), bdoc("Display the main menu."), - kpress(ALTMETA.."F12", "mod_query.query_menu(_, 'mainmenu', 'Main menu:')"), + kpress(ALTMETA.."F12", "mod_query.query_menu(_, _sub, 'mainmenu', 'Main menu:')"), --kpress(ALTMETA.."F12", "mod_menu.menu(_, _sub, 'mainmenu', {big=true})"), mpress("Button3", "mod_menu.pmenu(_, _sub, 'mainmenu')"), @@ -115,21 +117,27 @@ defbindings("WClientWin", { defbindings("WGroupCW", { bdoc("Toggle client window group full-screen mode"), - kpress_wait(META.."Return", - "WClientWin.set_fullscreen(_:bottom(), 'toggle')"), + kpress_wait(META.."Return", "WGroup.set_fullscreen(_, 'toggle')"), }) -- 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.) +-- contexts/objects always gets to handle the key press. defbindings("WMPlex", { bdoc("Close current object."), kpress_wait(META.."C", "WRegion.rqclose_propagate(_, _sub)"), + + submap(META.."K", { + bdoc("Detach (float) or reattach an object to its previous location."), + -- By using _chld instead of _sub, we can detach/reattach queries + -- attached to a group. The detach code checks if the parameter + -- (_chld) is a group 'bottom' and detaches the whole group in that + -- case. + kpress("D", "ioncore.detach(_chld, 'toggle')", "_chld:non-nil"), + }), }) -- Frames for transient windows ignore this bindmap @@ -170,21 +178,16 @@ defbindings("WMPlex.toplevel", { bdoc("Query for a client window to go to."), kpress(META.."G", "mod_query.query_gotoclient(_)"), - bdoc("Query for a client window to attach."), - kpress(META.."A", "mod_query.query_attachclient(_)"), - bdoc("Display context menu."), --kpress(META.."M", "mod_menu.menu(_, _sub, 'ctxmenu')"), - kpress(META.."M", "mod_query.query_menu(_, 'ctxmenu', 'Context menu:')"), - + kpress(META.."M", "mod_query.query_menu(_, _sub, 'ctxmenu', 'Context menu:')"), }) -- 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. +-- These bindings are common to all types of frames. Some additional +-- frame bindings are found in some modules' configuration files. defbindings("WFrame", { submap(META.."K", { @@ -219,10 +222,13 @@ defbindings("WFrame", { -- Frames for transient windows ignore this bindmap defbindings("WFrame.toplevel", { - bdoc("Tag current object within the frame."), - kpress(META.."T", "WRegion.set_tagged(_sub, 'toggle')", "_sub:non-nil"), + bdoc("Query for a client window to attach."), + kpress(META.."A", "mod_query.query_attachclient(_)"), submap(META.."K", { + -- Display tab numbers when modifiers are released + submap_wait("ioncore.tabnum.show(_)"), + bdoc("Switch to n:th object within the frame."), kpress("1", "WFrame.switch_nth(_, 0)"), kpress("2", "WFrame.switch_nth(_, 1)"), @@ -248,7 +254,7 @@ defbindings("WFrame.toplevel", { kpress("V", "WFrame.maximize_vert(_)"), bdoc("Attach tagged objects to this frame."), - kpress("A", "WFrame.attach_tagged(_)"), + kpress("A", "ioncore.tagged_attach(_)"), }), }) @@ -323,7 +329,8 @@ defbindings("WMoveresMode", { -- Main menu defmenu("mainmenu", { - submenu("Programs", "appmenu"), + menuentry("Run...", "mod_query.query_exec(_)"), + menuentry("Terminal", "ioncore.exec_on(_, XTERM or 'xterm')"), menuentry("Lock screen", "ioncore.exec_on(_, 'xlock')"), menuentry("Help", "mod_query.query_man(_)"), menuentry("About Ion", "mod_query.show_about_ion(_)"), @@ -332,19 +339,6 @@ defmenu("mainmenu", { }) --- Application menu -defmenu("appmenu", { - menuentry("XTerm", "ioncore.exec_on(_, 'xterm')"), - menuentry("W3M", "ioncore.exec_on(_, ':w3m -v')"), - menuentry("Rxvt", "ioncore.exec_on(_, 'rxvt')"), - menuentry("Opera", "ioncore.exec_on(_, 'opera')"), - menuentry("Links", "ioncore.exec_on(_, ':links')"), - menuentry("Konqueror", "ioncore.exec_on(_, 'konqueror')"), - menuentry("Dillo", "ioncore.exec_on(_, 'dillo')"), - menuentry("Run...", "mod_query.query_exec(_)"), -}) - - -- Session control menu defmenu("sessionmenu", { menuentry("Save", "ioncore.snapshot()"), @@ -354,24 +348,35 @@ defmenu("sessionmenu", { }) --- Context menu (frame/client window actions) +-- Context menu (frame actions etc.) defctxmenu("WFrame", "Frame", { + -- Note: this propagates the close to any subwindows; it does not + -- destroy the frame itself, unless empty. An entry to destroy tiled + -- frames is configured in cfg_tiling.lua. menuentry("Close", "WRegion.rqclose_propagate(_, _sub)"), - menuentry("Kill", "WClientWin.kill(_sub)", - "_sub:WClientWin"), - menuentry("Toggle tag", "WRegion.set_tagged(_sub, 'toggle')", - "_sub:non-nil"), - menuentry("Attach tagged", "WFrame.attach_tagged(_)"), - menuentry("Clear tags", "ioncore.clear_tags()"), - menuentry("Window info", "mod_query.show_tree(_, _sub)"), + -- Low-priority entries + menuentry("Attach tagged", "ioncore.tagged_attach(_)", { priority = 0 }), + menuentry("Clear tags", "ioncore.clear_tags()", { priority = 0 }), + menuentry("Window info", "mod_query.show_tree(_, _sub)", { priority = 0 }), }) --- Context menu for screens -defctxmenu("WScreen", "Screen", { - menuentry("New workspace", "ioncore.create_ws(_)"), - menuentry("New empty workspace", - "ioncore.create_ws(_, nil, true)"), - menuentry("Close workspace","WRegion.rqclose(_sub)"), +-- Context menu for groups (workspaces, client windows) +defctxmenu("WGroup", "Group", { + menuentry("Toggle tag", "WRegion.set_tagged(_, 'toggle')"), + menuentry("De/reattach", "ioncore.detach(_, 'toggle')"), }) + +-- Context menu for workspaces +defctxmenu("WGroupWS", "Workspace", { + menuentry("Close", "WRegion.rqclose(_)"), + menuentry("Rename", "mod_query.query_renameworkspace(nil, _)"), + menuentry("Attach tagged", "ioncore.tagged_attach(_)"), +}) + + +-- Context menu for client windows +defctxmenu("WClientWin", "Client window", { + menuentry("Kill", "WClientWin.kill(_)"), +})