Below is the listing of my bash script to copy the current lynx page text into vim. It requires xdotool and wmctrl installed. I use only a single invocation of lynx and vim, and the script relies on that fact. I don't know how wmctrl would react if asked to activate one of several apps with the same name. I run the script by pressing Mod4+p, a key mapping I have set in ~/.fluxbox/keys, rather than set a key mapping for it in vim, so I do not need to have vim active when I want to copy the page. To run it when vim is the active app, vim must be in Normal mode, in Insert mode it captures the keystroke before fluxbox can.
#!/bin/bash #set -xv # This script copies current lynx page text into vim at cursor rm -f ~/dump wmctrl -a lynx sleep 0.3 xdotool key p sleep .3 key Return sleep .3 key ctrl+u sleep .3 type /home/g/dump xdotool key Return wmctrl -a vim sleep 0.3 xdotool key Escape sleep .3 type :r ~/dump xdotool key Return On Mon, Oct 10, 2011 at 2:47 PM, Bela Lubkin <[email protected]> wrote: > Graham Lawrence wrote: > >> Bela, I received your response asking that I post my question to the >> list rather than to you personally. I took that as an indication that >> emailing you directly was undesirable. So I did not respond to it >> explicitly, only implicitly, by posting my question to the list as you >> requested. I received a reply from Thomas Dickey, for which I thanked >> him, and considering the issue closed, made no further post. Instead >> I wrote the bash script alternative I had alluded to in my reply to >> Thomas, and now dump lynx pages into vim with a single keystroke >> combination, or 2 keystrokes as you prefer to count it. > > I don't think I saw the repost; or maybe you posted in different wording > and I didn't recognize the congruence of the messages. As well, I don't > remember seeing a 1-2 key solution as you mention here. This could all > be because I failed to receive a message or two; or because I read them > inattentively and didn't gather the details. In any case I've already > deleted all of the past of this conversation, so I can't investigate :( > > Anyway, I'm not very interested in what/why that happened, I chalk it up > to the vagaries of asynchronous multi-way communications and don't worry > about it. > > What I *am* interested in is to hear the details of how you solved this > down to a 1-key action! > >>Bela< > > PS: I prefer not to receive direct copies of list postings. They > exacerbate the asyncronicity problem. Posts laundered through the list > are generally in correct perceptual order since each reply is not > provoked until the replier receives the message he's replying to. Mail > to my mailbox is more likely to be mis-ordered because the mail host's > connection is less reliable, leading the sending mail daemons to invoke > their delay algorithms -- which are different for every sending host. > Plus, I read the different mailboxes with different frequencies. > > _______________________________________________ > Lynx-dev mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/lynx-dev > _______________________________________________ Lynx-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lynx-dev
