Skip to content

run a program over the XWindow selection and display the result

License

Notifications You must be signed in to change notification settings

sgerwk/xselectionrun

Repository files navigation

xselectionrun

Run a program on the X11 selection on F1 and display the result. Pressing F1 again removes the result from the screen.

examples

Can be used to display a sort of inline help that is independent on the application, or to help filling web forms.

  • xselectionrun 'man -f %s | head -1'; selecting a word in whichever program and pressing F1 shows its short description from the man page of the word, if any; for example, if the word printf is selected in an xterm, the following is displayed: printf (1) - format and print data

  • xselectionrun 'grep -i "^%s " /etc/services'; if the selection is a tcp protocol name, display its port

  • xselectionrun 'grep "^%s" data.txt'; selecting a word and pressing F1 shows the line of the data.txt file that begins with the word

  • xselectionrun -q "echo '%s' >> file.txt"; appends the selection to the file each time F1 is pressed

screenshots

xselectionrun running man

xselectionrun running grep

About

run a program over the XWindow selection and display the result

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published