This is how to get the amount of remaining ink as reported by your Epson printer.
1
2
3
4
5
6
7
# For KDE:
$ kdialog --title "Ink levels" --msgbox "$(LANG=C escputil -qir /dev/usb/lp0 2>&1 | \
sed -re 's/.*remaining.*/Percent of ink remaining/;s/([0-9]+)$/\1%/')"
# For Gnome:
$ zenity --info --title "Ink Levels" --text "$(LANG=C escputil -qir /dev/usb/lp0 2>&1 | \
sed -re 's/.*remaining.*/Percent of ink remaining/;s/([0-9]+)$/\1%/')"
It may differ a bit if you’re using a newer/older Epson Printer. The above has been tested on an Epson Stylus C84 connected via USB.