#!/bin/sh EXPRESSION=$(printf "" | dmenu -b -w $(xdotool getactivewindow) -p "calculator") RESULT=$(qalc $EXPRESSION) printf "" | dmenu -b -w $(xdotool getactivewindow) -p "$RESULT" echo $RESULT | sed 's/^[^=≈]*[=≈]//' | xclip -selection clipboard