nt

simple note taker
git clone git://edryd.org/nt
Log | Files | Refs | LICENSE

dmenu_nt (519B)


      1 #!/usr/bin/env bash
      2 # dmenu_nt - dmenu interface for nt
      3 # See LICENSE file for copyright and license details
      4 
      5 prompt="nt"
      6 cmd="nt $1"
      7 height=$($cmd -l | wc -l)
      8 maxheight=20
      9 
     10 while
     11 	if [ "$height" -gt "$maxheight" ]; then height="$maxheight"; fi;
     12 	note=$($cmd -l | dmenu $2 -l "$height" -p "$prompt:" );
     13 [ -n "$note" ]; do
     14 	$cmd -l | grep -q "^$note"
     15 	if [ $? = 0 ]; then
     16 		$cmd -dy "$note"
     17 		if [ "$height" -lt "$maxheight" ]; then height=$((height-1)); fi;
     18 	else
     19 		$cmd "$note"
     20 		height=$((height+1))
     21 	fi
     22 done
     23 
     24 exit 0