From 1edd37c2cf6da0589f2dd76602aece695f414764 Mon Sep 17 00:00:00 2001 From: anakha Date: Fri, 9 Jul 2021 20:49:27 -0400 Subject: [PATCH] detach --- README.md | 6 ++++-- init.lua | 2 +- methods.lua | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 58b9aa7..1786ea8 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,11 @@ We now have tabs for tiled clients :) - [ ] Better keybindings (possibly emacs style, or vim style): an xcape key can be used to to initiate awm layer and enter can exit from it. - [X] Clickable tabs +- [X] Close tabs. (right click) +- [X] Allow detaching from floating tabs. (double click) +- [X] Move focus by index: focus_by_index() - [X] On focus of tiled clients, allow realigning visible floating windows to sides via shortcuts. -- [X] Add align to left or right for floating windows: this will allow the user to see either side of the layout. +- [X] Add align to left or right for floating windows: align_floats() - [X] Override cyclefocus for tabbed regions or bind alt-tab? - [ ] Merge Backham and Mouser (focus should stay client under mouse - sometimes?) - [X] Update tabs on tag change via signal @@ -47,7 +50,6 @@ We now have tabs for tiled clients :) - [ ] Client pull (pull a client from a direction onto the current deck) - [ ] Visual teleport (overlay with region numbers to choose from, possibly on all monitors, kind of like vimium) - [ ] Add tabbing for floating clients: drag and drop seems not so easy, using rofi could be fine too but it is another step. Focus and mark could work better. Execute the shourtcut and choose the window to be tabbed with mouse or possibly via keyboard. -- [ ] Allow detaching from floating tabs. Can be a right click to the tab. - [x] Allow expanding regions horizontally and vertically - [x] Auto resize all clients in the region when expanded - [x] Avoid machi's auto expansion on config reload diff --git a/init.lua b/init.lua index 95e0367..aadf1c2 100644 --- a/init.lua +++ b/init.lua @@ -44,7 +44,7 @@ local bindings = { awful.key({modkey}, ";", align_floats("right")), awful.key({modkey, "Shift"}, ";", align_floats("left")), - --▨ floating alignment + --▨ alignment awful.key({modkey}, "x", function () c = client.focus or nil diff --git a/methods.lua b/methods.lua index d66ef92..940ee02 100644 --- a/methods.lua +++ b/methods.lua @@ -18,6 +18,21 @@ local clear_tabbar = helpers.clear_tabbar local global_client_table = {} local global_widget_table = {} +function double_click_event_handler(double_click_event) + if double_click_timer then + double_click_timer:stop() + double_click_timer = nil + double_click_event() + return + end + beautiful.layout_machi = machi.get_icon() + double_click_timer = gears.timer.start_new(0.20, function() + double_click_timer = nil + return false + end) +end + + function get_global_clients() return global_client_table end @@ -1055,6 +1070,11 @@ function draw_tabbar(region_ix, s) for cc_ix, cc in ipairs(tablist) do local buttons = gears.table.join( awful.button({}, 1, function(_) + + double_click_event_handler(function() + cc.floating = not cc.floating + end) + gears.timer.delayed_call(function(p) client.emit_signal("riseup", p) end, cc)