#!/bin/bash
# ---------------------------------------------------------------------
# An Openbox pipemenu for configuring printing under CrunchBang Linux.
# Written for CrunchBang Linux
# by Philip Newborough (aka corenominal)
# Ported to #!++
# by Ben Young
# Ported to Manjaro
# by Daniel Napora
# ---------------------------------------------------------------------
if ! . mabox-include.cfg 2> /dev/null; then
echo ' Failed to locate mabox-include.cfg in PATH' >&2
exit 1
fi
if [[ $1 = '--install' ]]; then
terminator --title='Install Printer Support' --command='mabox-printing-pipemenu --install-printing'
elif [[ $1 = '--install-printing' ]]; then
promptInstall 'PRINTING SUPPORT' 'printing support' 'manjaro-printer'
else
# Pipemenu
menuStart
if type 'system-config-printer' &> /dev/null; then
menuItem 'Configure Printers' 'gksudo system-config-printer'
else
menuItem 'Install Printing Support' 'mabox-printing-pipemenu --install'
fi
menuEnd
fi
exit 0