From 47120bb34192786a461270de437b9704d725f492 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 8 Jul 2017 10:20:40 +0800 Subject: add MRU and select-window for alt-tab --- scripts/x-window-select | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/x-window-select (limited to 'scripts') diff --git a/scripts/x-window-select b/scripts/x-window-select new file mode 100755 index 0000000..41d8c15 --- /dev/null +++ b/scripts/x-window-select @@ -0,0 +1,17 @@ +#!/bin/bash + +wids() { x-window-list | sed 1d | awk '$2 == "M" { print $0 }'; } +cnt=$( wids | wc -l ) +case "$cnt" in + 0) + echo "no windows?!?, exiting..." | dmenu + exit 0;; + 1) + w_id=$( wids | awk '{ print $1 }' );; + *) + [[ "$cnt" -gt 5 ]] && cnt=5 + w_id=$( wids | dmenu -l $cnt | awk '{print $1}' );; +esac + +xdotool windowraise $w_id +xdotool windowfocus $w_id -- cgit v1.2.3