2

I want to have renamed copies of some executables use different processes when executed.

System: Lubuntu 18.04 Desktop 64 bit.

For example:

$ sudo cp -a /usr/bin/mate-terminal  /usr/bin/mate-terminal-left
$ sudo cp -a /usr/bin/mate-terminal  /usr/bin/mate-terminal-right

From a launcher, I execute mate-terminal-left, which opens a terminal window on the left-half of the screen (due to my configuration settings for the OpenBox window manager).

Just for reference, I execute the following in that terminal:

$ ps -eo pid,command | grep -i 'terminal' | grep -ve 'grep'
19294 /usr/bin/mate-terminal-left

Now, with the left terminal still open, from another launcher, I execute mate-terminal-right, which should open a terminal window on the right-half of the screen. However, mate-terminal-right did not create a new process, but instead used the already active mate-terminal-left process, hence it opens on the left as well.

$ ps -eo pid,command | grep -i 'terminal' | grep -ve 'grep'
19294 /usr/bin/mate-terminal-left

When I open mate-terminal-right first, then it opens on the right, and then mate-terminal-left will also end up on the right.

I have found that some executables, such as Geany work well for my left and right renaming approach, but other executables such as mate-terminal and pcmanfm use the same process for all instances, even when started with different names.

My question is: How can I cause mate-terminal-left and mate-terminal-right to each open as separate processes?

In response to the comments below that suggest how to make a left and right terminal, thanks for your suggestions. However, that is not what my question asks. I only used the example to provide a concrete explanation of why someone might want the same executable running in multiple processes, rather than multiple instances running in the same process. I used mate-terminal only as an example, so I am not looking for another terminal.

The title of this question is what I am asking about: "How to cause copies of executables to open as separate processes?"

GaryH.
  • 83
  • https://unix.stackexchange.com/a/407863/5132 https://unix.stackexchange.com/questions/201900/ – JdeBP Nov 26 '18 at 13:44
  • I suggest that you try with another light-weight terminal emulator program, for example: sakura or xterm. It seems xterm starts a separate process for each instance. But you can also use the associated bash process to identify the window. It is possible to use aliases to start terminal windows at specified locations: – sudodus Nov 26 '18 at 14:00
  • alias xterm-left='xterm -T 'xterm-left' -geometry +0-0 -fa default -fs 12' – sudodus Nov 26 '18 at 14:05
  • alias xterm-right='xterm -T 'xterm-right' -geometry -0-0 -fa default -fs 12' – sudodus Nov 26 '18 at 14:05
  • alias gterm-left='gnome-terminal --geometry=+0-0' – sudodus Nov 26 '18 at 14:22
  • alias gterm-right='gnome-terminal --geometry=-0-0' – sudodus Nov 26 '18 at 14:23
  • Maybe these examples can help you create the terminal windows where you want them; 2. Not only xterm but also sakura starts a separate process for each instance.
  • – sudodus Nov 26 '18 at 16:15
  • Here is how to achieve left and right terminals using mate-terminal and Openbox. In the launcher for the right-hand terminal: Exec=/usr/bin/mate-terminal --role=mate-terminal-right In the Openbox configuration file: ~/.config/openbox/lubuntu-rc.xml 50% 0 50% 100% The left hand is similar. I place the two launchers in the top panel for convenience. – GaryH. Nov 26 '18 at 16:42
  • Maybe your concept works with sakura because it will run separate processes for each window. It can be installed from the repository universe. – sudodus Nov 26 '18 at 16:55
  • @GaryH. I understand from your edited question, that you are not interested in workarounds, but rather explanations and (if possible) solutions that make programs create separate processes for each instance. Tell me if you want me to remove my comments and my answer (in order to remove clutter). – sudodus Nov 27 '18 at 08:04
  • @sudous Thank you for your suggestions. As I mentioned in my comment above, I already have the example working with mate-terminal, and I was not looking for a workaround. The information below from Filipe Brandenburger is the exact type of information that I was seeking. I do not think you should remove your information, since it is useful information. – GaryH. Nov 27 '18 at 18:23
  • And https://unix.stackexchange.com/questions/226465/ – JdeBP Nov 29 '18 at 16:28