FollieHiyuki-dotfiles/home/.local/bin/calcmenu

28 lines
458 B
Plaintext
Raw Normal View History

2021-02-13 11:28:59 -05:00
#!/bin/bash
case $1 in
--bemenu)
menu="bemenu -p calculate -l 5"
clip="wl-copy -p"
;;
--dmenu)
menu="dmenu -p calculate -l 5"
clip="xsel -i -l $HOME/.cache/xsel.log"
;;
--wofi)
menu="wofi -d -p calculate -O default"
clip="wl-copy -p"
;;
*)
exit
;;
esac
while inp=$(echo -e "$oup" | ${menu} )
do
if oup2=$(calc -pd "$inp"); then
echo -n "$oup2" | ${clip}
oup="$oup2\n$oup"
fi
done