25 [ $selitem = $nitems ]
28 header
="\e[1;44;30m[lpset]"
29 for hotkey
in Disable Enable Reject Accept LPRM Quit
31 header
="$header \e[1;44;33m${hotkey:0:1}\e[0;44;37m${hotkey:1} "
38 dflt_prn
=`LANG=C lpstat -d | sed -ne 's/.*\s\(\S\+\)/\1/p'`
39 printers
=(`LANG=C lpstat -p | sed -ne 's/^\S\+\s\+\(\S\+\).*/\1/p' | sed -e "s/^\($dflt_prn\)\$/*\1/"`)
40 output
="DefaultPrinter/Default Printer: ${printers[@]}$NL"
41 output
=$output`lpoptions -l`
49 while IFS
=: read -r key vals
63 echo -n "$label\e[m: "
69 if [ "${val:0:1}" = '*' ]
95 if lpstat
-o "$dflt_prn" |
read
101 echo " \e[44;37m$lpqline\e[m"
103 re
="[^ ]+ +[^ ]+ +([^ ]+)"
104 [[ "$lpqline" =~
$re ]]
105 jobs[$nitems]=${BASH_REMATCH[1]}
109 echo "> \e[1m$lpqline\e[m"
116 done < <(lpq |
sed -e 1d
)
118 echo "==================================="
119 n
=`LANG=C lpstat -l -p "$dflt_prn" | sed -ne '/^\s*After fault/='`
120 lpstat
-l -p "$dflt_prn" |
head -n ${n:-11}
136 A
) if [ $selitem -gt 0 ]
143 B
) if [ $selitem -lt $
[nitems-1
] ]
156 D
) if [ $optsetv -gt 0 ]
162 C
) if [ $optsetv -lt $max ]
169 newval
=${optvals[$newvaln]}
170 if [ "$optname" = DefaultPrinter
]
172 lpoptions
-d "$newval" >/dev
/null
174 lpoptions
-o "$optname=$newval"
179 *) clear_input_buffer
183 *) clear_input_buffer
195 l
) job
=${jobs[$selitem]}
205 command $cmd "${args[@]}"
216 # LANG=C lpstat -d -p -o