Small Linux script pgn to clipboard

  

Back to forum


Matteo Tognela    (2008-12-25)
Small Linux script - pgn to clipboard

I know it's not of vital importance... but looking for some more automatic way to copy to clipboard the moves from a game window, say to be pasted into db software, I I've written this little bash script. (this requires xclip to be installed; for the rest I make reference to gnome&firefox, but it should work also in other environments)

#!/bin/bash
#content of grabpgn
xclip -i -selection clipboard $1
exit

...chmode +x grabpgn, and then associate the extension pgn to be opened with it (in gnome it's quite easy, but for sure there's some conf file where you can do it manually)
Then from a game window, click the "download" button, and in the dialog box, select "open" and check "always perform this action on similar files".
Done! now when you hit "Download" you end up with the game in your clipboard, ready to be pasted wherever you want.
(you can still download it with a right click on the link)


Matteo Tognela    (2008-12-25 17:01:11)
Small Linux script - pgn to clipboard

ps: this method obviously could be useful just if you don't need an automatic association of the pgn extension with other applications. [TODO: try to develop a firefox addon that does the same with a ToolbarButton.]