FollieHiyuki-dotfiles/home/.local/bin/calcmenu
2021-02-13 19:28:59 +03:00

28 lines
458 B
Bash
Executable File

#!/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