Programmatically launching standalone Adobe flashplayer on Linux/X11

Aaron picture Aaron · Oct 2, 2008 · Viewed 10k times · Source

The standalone flashplayer takes no arguments other than a .swf file when you launch it from the command line. I need the player to go full screen, no window borders and such. This can be accomplished by hitting ctrl+f once the program has started. I want to do this programmatically as I need it to launch into full screen without any human interaction.

My guess is that I need to some how get a handle to the window and then send it an event that looks like the "ctrl+f" keystroke.

If it makes any difference, it looks like flashplayer is a gtk application and I have python with pygtk installed.

UPDATE (the solution I used... thanks to ypnos' answer):

./flashplayer http://example.com/example.swf & sleep 3 && ~/xsendkey -window "Adobe Flash Player 10" Control+F

Answer

ypnos picture ypnos · Oct 3, 2008

You can use a dedicated application which sends the keystroke to the window manager, which should then pass it to flash, if the window starts as being the active window on the screen. This is quite error prone, though, due to delays between starting flash and when the window will show up.

For example, your script could do something like this: flashplayer *.swf sleep 3 && xsendkey Control+F

The application xsendkey can be found here: http://people.csail.mit.edu/adonovan/hacks/xsendkey.html Without given a specific window, it will send it to the root window, which is handled by your window manager. You could also try to figure out the Window id first, using xprop or something related to it.

Another option is a Window manager, which is able to remember your settings and automatically apply them. Fluxbos for example provides this feature. You could set fluxbox to make the Window decor-less and stretch it over the whole screen, if flashplayer supports being resized. This is also not-so-nice, as it would probably affect all the flashplayer windows you open ever.