Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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?

share|improve this question
    
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? –  bdowning Jan 26 '14 at 20:10

1 Answer 1

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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