Faxlist-viewer
Len Ovens (len@cbbs.org)
Sun, 10 Oct 1999 20:26:30 -0700
--Boundary-=_cVAlFicjDGEiGBLZjcvHUxXUqYkN
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
On Sat, 09 Oct 1999, Jens Rathmann wrote:
> I'm looking for a program (should run under X!) that shows me all faxes
> in the fax inbound directory (received with mgetty) sorted by date so
> that I can view/print/delete them just by clicking on a fax.
>
> I searched for about two weeks now, without success (I tried KVoice from
> KDE, but this tool is not what I want). I can't believe that there's
> really no such simple tool.
There is also kfax though it looks more complex than it needs to be
also. Here is a simple tcl/tk script that does about what you
want.... it does not list them in order of date but that is because
I just use ls... I am sure it could be changed to ls -t or ls -t -r
to fix that though. The line to change looks like:
eval .frame.left.file.list insert end [ split [ exec ls ] ]
Change it to:
eval .frame.left.file.list insert end [ split [ exec ls -t ] ]
It uses viewfax to display the fax and it uses a shell script called
printfax which on my machine has one line:
/usr/local/bin/g3tobj $1 $2 |lpr
in it. That only works if you have something that understands the
canon bubble jet (bj10e) stuff, you may have to use something
different to fit your printer.
The reverse byte stuff could really be taken out, I used it for fax
files imported off of a binkley/OS/2 machine which are reverse
byte. The same modem with mgetty doesn't need it.
--
Len Ovens
len@cbbs.org
--Boundary-=_cVAlFicjDGEiGBLZjcvHUxXUqYkN
Content-Type: text/english;
name="faxman"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="faxman"
#!/usr/bin/wish
#
# FaxMan
# Simple Fax managing tool in Tcl.
#
# by Len Ovens Aug 97
# exec_cmd fuction to run a program
#
proc exec_cmd {command } {
#execute the program in background ... this is for X
eval exec $command &
}
proc viewfax { } {
global rez
global rev
global faxfile
set faxfile [ .frame.left.file.list get active ]
exec_cmd "/usr/local/bin/viewfax $rev $rez $faxfile"
}
proc printfax { } {
global rez
if {$rez == " -n "} then { set prez " -l " }
if {$rez == " -f "} then { set prez "" }
global rev
global faxfile
if {$rev != " -r "} then {
set faxfile [ .frame.left.file.list get active ]
exec_cmd "/usr/local/bin/prinfax $prez $faxfile"
}
if {$rev == " -r "} then {
tk_dialog .faxerror "FaxMan Error" \
"Can't print reverse byte images, Sorry." \
"" 0 continue
}
}
proc delfax { } {
global faxfile
set faxfile [ .frame.left.file.list get active ]
exec rm $faxfile
eval .frame.left.file.list delete active
}
proc refresh { } {
eval .frame.left.file.list delete 0 end
eval .frame.left.file.list insert end [ split [ exec ls ] ]
}
#
# main program
#
cd /usr/spool/fax/incoming
#wm geometry . +210+100
wm title . "Fax Manager"
wm resizable . 0 0
# make frame to hold everything
set back #908090
set but #80b080
set rez " -n "
set rev ""
#frame .frame -relief raised -bd 2 -bg $back
frame .frame -relief raised -bd 2 -bg $back
.frame config -cursor top_left_arrow
# widgets
# line for put some list boxes in here
frame .frame.left -relief flat -bg $back
label .frame.left.label -text "Select fax with mouse" \
-relief flat -padx 8 -pady 5 -bg $back
frame .frame.left.file -relief flat -bg $back
listbox .frame.left.file.list -height 10 -selectmode browse \
-width 30 -bg #c0c0a0 -yscroll ".frame.left.file.scroll set"
eval .frame.left.file.list insert end [ split [ exec ls ] ]
set faxfile [ .frame.left.file.list get active ]
scrollbar .frame.left.file.scroll -command ".frame.left.file.list yview" \
-bg $back -activebackground #b0a0b0
pack .frame.left.file.scroll -side right -fill y
pack .frame.left.file.list -side left -fill both
frame .frame.left.radio -relief flat -bg $back
radiobutton .frame.left.radio.high -text "Hi-rez" -variable rez \
-relief flat -value " -f " -bg $back \
-activebackground $back -padx 8
radiobutton .frame.left.radio.low -text "Lo-rez" -variable rez \
-relief flat -value " -n " -state active -bg $back \
-activebackground $back -padx 8
frame .frame.left.rev -relief flat -bg $back
radiobutton .frame.left.rev.no -text "Normal" -variable rev \
-relief flat -value "" -state active -bg $back \
-activebackground $back -padx 8
radiobutton .frame.left.rev.yes -text "Rev. Bytes" -variable rev \
-relief flat -value " -r " -bg $back \
-activebackground $back -padx 8
frame .frame.right -relief flat -bg $back
button .frame.right.view -text "view fax" \
-command { viewfax } \
-padx 8 -bg $but
button .frame.right.print -text "print fax" \
-command { printfax } \
-padx 8 -bg $but
button .frame.right.del -text "delete fax" \
-command { delfax } \
-padx 8 -bg $but
button .frame.right.ref -text "check inb" \
-command { refresh } \
-padx 8 -bg $but
button .frame.right.exit -text "Exit" \
-command { exit } \
-padx 8 -bg #b08080
# pack all the buttons in order
pack .frame.left.radio.high .frame.left.radio.low \
-padx 5 -side left -fill y
pack .frame.left.rev.no .frame.left.rev.yes \
-padx 5 -side left -fill y
pack .frame.left.label .frame.left.file \
.frame.left.radio .frame.left.rev \
-padx 20 -pady 5 -side top -fill y
pack .frame.right.view .frame.right.print .frame.right.del \
.frame.right.ref .frame.right.exit \
-padx 20 -pady 14 -side top -fill y
pack .frame.left .frame.right -side left -fill y
# and the one I thought they had forgotten :-)
pack .frame
# the end
--Boundary-=_cVAlFicjDGEiGBLZjcvHUxXUqYkN--