From 2c51676436546ae4217ed023e97832c13db1d52e Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Thu, 7 Jul 2022 12:17:46 +0100 Subject: [PATCH] choose view by clicking it in overview --- rc.fnl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rc.fnl b/rc.fnl index a09b54d..c3cb478 100644 --- a/rc.fnl +++ b/rc.fnl @@ -110,6 +110,23 @@ } })) +(fn choose-view-at [x y] + (let [view (kiwmi:view_at x y)] + (tset app-state :focus-view view) + (tset app-state :in-overview false) + (hide-overview) + true)) + +(let [cursor (kiwmi:cursor)] + (cursor:on "button_up" + (fn [button-id] + (when app-state.in-overview + (let [geom (placements (kiwmi:active_output)) + (x y) (cursor:pos)] + (if (< y geom.application.h) + (choose-view-at x y) + false)))))) + (kiwmi:on "output" (fn [output]