dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

text.sh (323B)


      1 #!/bin/sh
      2 set -e
      3 to="$(find "$HOME/.password-store/Telephone" -type f | \
      4       sed 's/.*\///;s/\.gpg$//' | \
      5       dmenu -i -p "to:")"
      6 if [ $# -eq 0 ]; then
      7 	msg="$(cat)"
      8 elif [ "$1" = "-i" ]; then
      9 	msg="$(echo | dmenu -p "message:")"
     10 else
     11 	echo "usage: ${0##/*} [-i]" >&2
     12 	exit 1
     13 fi
     14 printf '%s\n' "$msg" | sendtext "$to"