Is there a way to force xdvi to open dvi files in the same window everytime?
February 2, 2005 9:50 AM Subscribe
is there a way to force xdvi to open dvi files in the same window everytime? (Red Hat Enterprise Server, fvwm window manager). man page and google no help...
Response by poster: This works for anyone else who was wondering... (for files named p###)
#!/usr/bin/perl
$TRUE=1;
$FALSE=0;
$debug=$FALSE;
$name=$0;
# print $name,"\n";
if($name =~ /^(.*)\/([^\/]*)$/){
chdir($1);
$copy = "cp ../../$2.dvi /tmp/p.dvi";
} elsif ($TRUE) {
$copy = "cp ../../$name.dvi /tmp/p.dvi";
}
&run_command($copy);
@processes = &run_command("ps -x");
if (! grep( /xdvi .*p\.dvi/, @processes) ) {
# $xdvi = "xdvi -geometry 1182x853 -s 6 /tmp/p.dvi";
# $xdvi = "xdvi -geometry 1275x897 -s 4 /tmp/p.dvi";
$xdvi = "xdvi -geometry 1040x750 -s 3 /tmp/p.dvi";
&run_command($xdvi);
} else {
%kill
}
# *** END OF MAIN PROGRAM ***
#========================================================================
# *** SUBROUTIN(S) ***
sub run_command {
open(COMMAND,"($_[0]) |") || die("$name: Cannot run '$_[0]': $!.\n");
local(@results)=;
close COMMAND;
return @results;
}
posted by pissfactory at 1:11 PM on February 2, 2005
#!/usr/bin/perl
$TRUE=1;
$FALSE=0;
$debug=$FALSE;
$name=$0;
# print $name,"\n";
if($name =~ /^(.*)\/([^\/]*)$/){
chdir($1);
$copy = "cp ../../$2.dvi /tmp/p.dvi";
} elsif ($TRUE) {
$copy = "cp ../../$name.dvi /tmp/p.dvi";
}
&run_command($copy);
@processes = &run_command("ps -x");
if (! grep( /xdvi .*p\.dvi/, @processes) ) {
# $xdvi = "xdvi -geometry 1182x853 -s 6 /tmp/p.dvi";
# $xdvi = "xdvi -geometry 1275x897 -s 4 /tmp/p.dvi";
$xdvi = "xdvi -geometry 1040x750 -s 3 /tmp/p.dvi";
&run_command($xdvi);
} else {
%kill
}
# *** END OF MAIN PROGRAM ***
#========================================================================
# *** SUBROUTIN(S) ***
sub run_command {
open(COMMAND,"($_[0]) |") || die("$name: Cannot run '$_[0]': $!.\n");
local(@results)=
close COMMAND;
return @results;
}
posted by pissfactory at 1:11 PM on February 2, 2005
This thread is closed to new comments.
posted by fvw at 10:38 AM on February 2, 2005