Skip to content

Instantly share code, notes, and snippets.

@nogweii
Created December 9, 2008 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nogweii/34091 to your computer and use it in GitHub Desktop.
Save nogweii/34091 to your computer and use it in GitHub Desktop.
#!/bin/zsh
screens=($(screen -ls | head -n-2 | tail -n +2))
# Zero index of an array is empty. Start at index 1.
#count=$(($#screens+1))
#i=1
#while [[ $i < $count ]]; do
# echo $screens[$i] $screens[$(($i+1))]
# i=$((i + 2))
#done
tf=`mktemp`
dialog --menu "Please select a screen below: " 0 0 0 $screens[@] 2>$tf
clear
screen -R $(cat $tf | cut -d'.' -f2-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment