I have an application in graphical interface that when I run it, it's not opened in full screen mode, but when I use the keyboard shortcut Alt+Ctrl+M , it becomes fullscreen, I want to change the default behavior of the app to be opened in fullscreen mode.

I want to write a shell script to send this shortcut keys when I open the application, can you help me?

  • Is this a proprietary app or public? Name of app? If there's a command line switch that you can use to start your app in full screen that would certainly be preferred over a script that sends key strokes to the app. Does the app have a man page or user manual? – bsd Jan 26 '14 at 20:10

You can find a small tool called sendxkeys here. Using this you should be able to inject key presses into your X server. After compiling it, I'm guessing that

./sendxkeys :0 64 37 58

would insert ALT+CTRL+M into your X server running on display :0 (I may be wrong about the exact keycodes though). This can then easily be used in a script, e.g. something like:

/path/to/your/application & # the & is to start in background
sleep 1 # wait a short while so that the application is running
/path/to/sendxkeys :0 64 37 58 # may need other keycodes
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.