dotfiles/.bin/OLD/dswitcher

7 lines
263 B
Plaintext
Raw Normal View History

#!/bin/sh
date=$(date +"%a %d. %b %R")
num=$(wmctrl -l | awk '{$1="";$2="";$3="";gsub(/ /,"", $0);printf("%d - %s\n",NR,$0)}' | dmenu -b -i -p "$date" -l 30 | cut -d"-" -f1)
[ -z "$num" ] || wmctrl -l | awk -v n="$num" 'NR==n { print $1 }' | xargs wmctrl -i -a