Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dmenu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ALL=`cat`

# number the lines
SPLITTED=$( echo $ALL | sed 's/ /\n/g' | awk -- '{print NR, $0 }' )
SPLITTED=$( echo $ALL | tr ' ' '\n' | awk -- '{print NR, $0 }' )

# prompt via dialog (output-fd=1 is so that dialog gui doesn't go to subshell)
OUT=$( dialog --output-fd 1 --ok-label Select --menu Choose 0 50 22 $SPLITTED )
Expand All @@ -26,7 +26,7 @@ if [ "1" = "$EXIT_CODE" ] ; then exit 1 ; fi
if [ "255" = "$EXIT_CODE" ] ; then exit 1 ; fi

# extract text corresponding to numeric selection
CHOSEN=$( echo $ALL | sed 's/ /\n/g' | awk -- "NR==$OUT {print \$0 }" )
CHOSEN=$( echo $ALL | tr ' ' '\n' | awk -- "NR==$OUT {print \$0 }" )

# print result
echo $CHOSEN
Expand Down