I have two applications I need to switch between - a java GUI application (written with javafx) and a video player (mplayer).

My Linux distribution runs in shell (no X11, only terminal). I want to switch between the two applications without having to kill the process.

At the moment even if I start one of the applications as a background process, the GUI of that application is still visible and in the foreground.

  • 4
    If your Linux distribution has no X11, only terminal, where exactly are the GUI applications being displayed? – Celada Mar 12 '17 at 12:43
  • The Linux(Debian) does have x11 but it is configured to start in terminal and not the graphic environment. I am starting the applications from command line and separately they are working fine. But in order to switch from the java app to the video player app I have to kill the java process in order to hide the GUI shown from it. Moving the process to background via the "bg" command or similar approaches don't hide the UI unfortunately. – Aleksandar Dimitrov Mar 12 '17 at 13:08
  • 1
    I'm still confused about your use case. The terminal session from which you want to control these GUI apps is running on a separate machine I guess? Otherwise you'd have to unfocus one of the other 2 applications anyway in order to focus the terminal, right? Nevertheless, I sort of suspect that your question somehow revolves around programmatically focusing different X11 windows, so maybe you can get wmctrl to do what you want? – Celada Mar 12 '17 at 13:15
  • The machine is not remote. It is physically with me(raspberry pi). Yes, I have to somehow unfocus the java application and focus(bring to foreground the video player app). The case is the following - the user clicks on a button within the java gui, then the java application has to go to background, the mplayer(video player) has to start playing video in the foreground. In the meantime the java process must not be killed. Can the wmctrl command be used in such cases? – Aleksandar Dimitrov Mar 12 '17 at 13:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.