Re: [9fans] use of plumber for new rule
Hi again Umbraticus, Sorry for spamming you today. But I wanted to let you know your command works and I had made a typo implementing it. > > This solution has acme load up the dvi file to edit. I want to > display the image rendered by page, but after it has been passed > through dvips. So either > > plumb start window kertex/dvips $wdir/$0 '|' page > > or > > plumb start window kertex/dvips $wdir/$0 '|' page -w > > or > > plumb start window kertex/dvips $wdir/$0 '|' plumb -id image > > have this work for me. The first one opens a small window, rather > than the full page that is loaded once I have converted the file to a > postscript file. This can be adjusted to the full window rendering > with the use of page -w, but I can see the initial window that dvips > loaded in the background. The plumb -id image solution loads up the > initial window, runs dvips and then resizes the window with the output > from the repiping. Not too sure which solution is the ideal one, but > it's currently working with the pipe to plumb -id. I'm probably not > explaining myself well enough. I ideally want the result from > running. > > kertex/dvips | page -w > > which I think I should get running 'plumb start rc -c 'kertex/dvips > '$wdir'/'$0' | page -w', but for some reason it doesn't work. :( The final plumb command became, data matches '([a-zA-Z¡-�0-9_\-.,/]+)\.(dvi|DVI)' arg isfile $0 plumb start rc -c 'kertex/dvips -q '$wdir'/'$0' | page -w' My only addition to what you suggested was to run dvips with -q to suppress the stdout output. Thanks for the help today. Take care, Chris -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tce7385fe52c532d6-M89d36b357efea549a8b62c02 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
Re: [9fans] use of plumber for new rule
Hello again Umbraticus, Thanks for your email. On Thu, Oct 20, 2022 at 1:01 PM wrote: > > I think you probably want: > > plumb start rc -c 'kertex/divps '$wdir'/'$0' | page -w' This solution has acme load up the dvi file to edit. I want to display the image rendered by page, but after it has been passed through dvips. So either plumb start window kertex/dvips $wdir/$0 '|' page or plumb start window kertex/dvips $wdir/$0 '|' page -w or plumb start window kertex/dvips $wdir/$0 '|' plumb -id image have this work for me. The first one opens a small window, rather than the full page that is loaded once I have converted the file to a postscript file. This can be adjusted to the full window rendering with the use of page -w, but I can see the initial window that dvips loaded in the background. The plumb -id image solution loads up the initial window, runs dvips and then resizes the window with the output from the repiping. Not too sure which solution is the ideal one, but it's currently working with the pipe to plumb -id. I'm probably not explaining myself well enough. I ideally want the result from running. kertex/dvips | page -w which I think I should get running 'plumb start rc -c 'kertex/dvips '$wdir'/'$0' | page -w', but for some reason it doesn't work. :( Best, Chris > > umbraticus -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tce7385fe52c532d6-Mcd186ac9d272297cc3db913f Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
Re: [9fans] use of plumber for new rule
I think you probably want: plumb start rc -c 'kertex/divps '$wdir'/'$0' | page -w' umbraticus -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tce7385fe52c532d6-M95c2618ac3b3dd2f17c75c24 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
Re: [9fans] use of plumber for new rule
A small improvement on the last solution to my problem. > data matches '([a-zA-Z¡-�0-9_\-.,/]+)\.(dvi|DVI)' > arg isfile $0 > plumb start window kertex/dvips $wdir/$0 '|' page > This solution opens a default sized window and I need to resize it to see the .dvi. Instead of a pipe to page, I now use a pipe to plumb -id image. This makes a full sized window. The last line becomes plumb start window kertex/dvips $wdir/$0 '|' plumb -id image Chris -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tce7385fe52c532d6-Mc29d1e5d7b39cd973f7d33eb Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
Re: [9fans] use of plumber for new rule
Thank you Umbraticus! On Thu, Oct 20, 2022 at 4:56 AM wrote: > > Here's my rule for manpages: > > data matches (.+)\(([0-9])\) > arg isfile /sys/man/$2/$1 > plumb start rc -c 'man -t '$2' '$1' | plumb -id image' > > which replumbs the cmd output to the image port; then: > > dst is image > plumb to image > plumb client rc -c 'window -r 380 0 1600 900 ''echo -n page >/dev/label; bind > /dev/mordor /dev/label; page -i -p180 -m64''' > > either sends it to any existing page instance > or else starts a new one to send it to. > Worth noting I am using 9front's version of page, > which listens on the image port; can't recall if the original > listens on the postscript port in a similar way: probably. > If you just want to pop open a new window with > your dvi each time you can use a plumb start rule > that does whatever you want; something like: > > data matches '([a-zA-Z¡-�0-9_\-.,/]+)\.(dvi|DVI)' > arg isfile $0 > plumb start window kertex/dvips $0 '|' page > This solution works near perfectly for me. I needed to add a $wdir before the filename, but otherwise it works! To be clear, my rule is now... data matches '([a-zA-Z¡-�0-9_\-.,/]+)\.(dvi|DVI)' arg isfile $0 plumb start window kertex/dvips $wdir/$0 '|' page > There are other workflows too, if what you want is a tight > loop for editing a document and seeing the new version. > Some people use a watch(1) program that runs a command > whenever a given file changes. I prefer to tie the file write > and doc gen to a single command using (9front) sam's ^ cmd, > which sends its output to sam's command window: > > ^echo w; window troff $% '|' page > > The last shell command is remembered, so subsequent > write'n'reviews are a simple ^ thereafter. Very nice suggestion. I will try to put this one in my bag of tricks. > > umbraticus Thank you again. Take care, Chris -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tce7385fe52c532d6-M62d39a71195ef5c3462e8b42 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
Re: [9fans] use of plumber for new rule
Here's my rule for manpages: data matches (.+)\(([0-9])\) arg isfile /sys/man/$2/$1 plumb start rc -c 'man -t '$2' '$1' | plumb -id image' which replumbs the cmd output to the image port; then: dst is image plumb to image plumb client rc -c 'window -r 380 0 1600 900 ''echo -n page >/dev/label; bind /dev/mordor /dev/label; page -i -p180 -m64''' either sends it to any existing page instance or else starts a new one to send it to. Worth noting I am using 9front's version of page, which listens on the image port; can't recall if the original listens on the postscript port in a similar way: probably. If you just want to pop open a new window with your dvi each time you can use a plumb start rule that does whatever you want; something like: data matches '([a-zA-Z¡-�0-9_\-.,/]+)\.(dvi|DVI)' arg isfile $0 plumb start window kertex/dvips $0 '|' page There are other workflows too, if what you want is a tight loop for editing a document and seeing the new version. Some people use a watch(1) program that runs a command whenever a given file changes. I prefer to tie the file write and doc gen to a single command using (9front) sam's ^ cmd, which sends its output to sam's command window: ^echo w; window troff $% '|' page The last shell command is remembered, so subsequent write'n'reviews are a simple ^ thereafter. umbraticus -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tce7385fe52c532d6-Me347adb350456cff65756620 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription