a computer scientist’s thoughts
RSS icon Email icon Home icon
  • An incomplete idea on Linux–stdctrl

    Posted on March 10th, 2009 Eric 1 comment

    Linux command line tools connected by pipes are cool. However, everything disappear on the X11 environment.

    We should have a stdin-like file descriptor for each X11 application such that we can pipe control operations to them. In this case, we can automate firefox or other stuff all in a transparent and de-coupled way. For instance, to visit google, we can pipe

    Ctrl L

    www.google.com

    Enter

    to firefox’s stdctl, and firefox will visit google.

    There are some command line tools like “expect” that can send applications input, but it is not general.

    On MacOS, applescript can sort of accomplish the same goal.

    My idea is to redesign the shell such that it supports the stdctrl syntax. The shell will create the process using popen and then send control signal to them. (replace expect). Hopefully we can finally control firefox without using any firefox API, we can just send Firefox X11 level control sequences.

     

    One response to “An incomplete idea on Linux–stdctrl”

    1. You may want to look into a program called “xdotool”. It doesn’t accept input from pipes, but a shell-script wrapper can handle that no problem.

    Leave a reply