From dadff33db868c2986c0db3c27f5dbb5babb529af Mon Sep 17 00:00:00 2001 From: "Suraj N. Kurapati" Date: Sat, 17 Oct 2009 18:33:59 -0700 Subject: [PATCH] add shortcut to switch to last focused view --- config.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config.yaml b/config.yaml index 8f377a4..c297e48 100644 --- a/config.yaml +++ b/config.yaml @@ -254,6 +254,9 @@ control: ${mod}-${next}: | # focus next view next_view.focus + ${mod}-o: | # focus most recently focused view + $last_view.focus if $last_view + # focus the view whose index or name equals the pressed number ${mod}-1: focus_view tags[0] || 1 ${mod}-2: focus_view tags[1] || 2 @@ -781,6 +784,18 @@ script: DETACHED_TAG = '|' ZOOMED_SUFFIX = /~(\d+)$/ + # keep track of most recently focused view + $last_view = nil + + class Rumai::View + alias __focus__ focus + + def focus + $last_view = View.curr + __focus__ + end + end + after: | # desktop wallpaper system 'test -f ~/.fehbg && sh ~/.fehbg'