How to cause copies of executables to open as separate processes?











up vote
2
down vote

favorite












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?"










share|improve this question
























  • unix.stackexchange.com/a/407863/5132 unix.stackexchange.com/questions/201900
    – JdeBP
    Nov 26 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 at 14:00










  • alias xterm-left='xterm -T 'xterm-left' -geometry +0-0 -fa default -fs 12'
    – sudodus
    Nov 26 at 14:05










  • alias xterm-right='xterm -T 'xterm-right' -geometry -0-0 -fa default -fs 12'
    – sudodus
    Nov 26 at 14:05










  • alias gterm-left='gnome-terminal --geometry=+0-0'
    – sudodus
    Nov 26 at 14:22















up vote
2
down vote

favorite












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?"










share|improve this question
























  • unix.stackexchange.com/a/407863/5132 unix.stackexchange.com/questions/201900
    – JdeBP
    Nov 26 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 at 14:00










  • alias xterm-left='xterm -T 'xterm-left' -geometry +0-0 -fa default -fs 12'
    – sudodus
    Nov 26 at 14:05










  • alias xterm-right='xterm -T 'xterm-right' -geometry -0-0 -fa default -fs 12'
    – sudodus
    Nov 26 at 14:05










  • alias gterm-left='gnome-terminal --geometry=+0-0'
    – sudodus
    Nov 26 at 14:22













up vote
2
down vote

favorite









up vote
2
down vote

favorite











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?"










share|improve this question















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?"







linux process






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 at 18:33

























asked Nov 26 at 13:07









GaryH.

336




336












  • unix.stackexchange.com/a/407863/5132 unix.stackexchange.com/questions/201900
    – JdeBP
    Nov 26 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 at 14:00










  • alias xterm-left='xterm -T 'xterm-left' -geometry +0-0 -fa default -fs 12'
    – sudodus
    Nov 26 at 14:05










  • alias xterm-right='xterm -T 'xterm-right' -geometry -0-0 -fa default -fs 12'
    – sudodus
    Nov 26 at 14:05










  • alias gterm-left='gnome-terminal --geometry=+0-0'
    – sudodus
    Nov 26 at 14:22


















  • unix.stackexchange.com/a/407863/5132 unix.stackexchange.com/questions/201900
    – JdeBP
    Nov 26 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 at 14:00










  • alias xterm-left='xterm -T 'xterm-left' -geometry +0-0 -fa default -fs 12'
    – sudodus
    Nov 26 at 14:05










  • alias xterm-right='xterm -T 'xterm-right' -geometry -0-0 -fa default -fs 12'
    – sudodus
    Nov 26 at 14:05










  • alias gterm-left='gnome-terminal --geometry=+0-0'
    – sudodus
    Nov 26 at 14:22
















unix.stackexchange.com/a/407863/5132 unix.stackexchange.com/questions/201900
– JdeBP
Nov 26 at 13:44




unix.stackexchange.com/a/407863/5132 unix.stackexchange.com/questions/201900
– JdeBP
Nov 26 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 at 14:00




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 at 14:00












alias xterm-left='xterm -T 'xterm-left' -geometry +0-0 -fa default -fs 12'
– sudodus
Nov 26 at 14:05




alias xterm-left='xterm -T 'xterm-left' -geometry +0-0 -fa default -fs 12'
– sudodus
Nov 26 at 14:05












alias xterm-right='xterm -T 'xterm-right' -geometry -0-0 -fa default -fs 12'
– sudodus
Nov 26 at 14:05




alias xterm-right='xterm -T 'xterm-right' -geometry -0-0 -fa default -fs 12'
– sudodus
Nov 26 at 14:05












alias gterm-left='gnome-terminal --geometry=+0-0'
– sudodus
Nov 26 at 14:22




alias gterm-left='gnome-terminal --geometry=+0-0'
– sudodus
Nov 26 at 14:22










2 Answers
2






active

oldest

votes

















up vote
3
down vote



accepted










What you're seeing here is fairly specific to mate-terminal itself, though more generally using some shared GNOME/GTK+ infrastructure that you might also find in other applications (you mentioned pcmanfm as well.)



When you launch a new copy of mate-terminal, perhaps from a different binary, it does create a new process for it. But mate-terminal is programmed to connect to D-Bus and try to look up a "factory", in which case it will pass it the arguments for what to start in the terminal and have the "factory" manage it, then terminate the new process. (If there's no factory, it will register itself as the factory, that's why the first process started will end up managing all terminals.)



The "factory" is found through its D-Bus path, /org/mate/Terminal/Factory, which is hardcoded into the binary. (Thus, replicated into other copies of the binary.)



In the case of mate-terminal specifically, you can disable this behavior by passing it a --disable-factory command-line argument. (See the man page for more details.)



That's fairly unique to how mate-terminal works. In particular, pcmanfm doesn't really do this the same way. It's unclear whether pcmanfm supports a way to launch a separate process, or if the only way it works is by communicating through D-Bus with an existing instance. (You'd have to look into pcmanfm to see if it does.)






share|improve this answer

















  • 1




    Thank you for your explanation. This is exactly what I was looking for. I did not understand what a "factory" was before reading your information. I will mark your answer as being the solution.
    – GaryH.
    Nov 27 at 18:29


















up vote
0
down vote













Workaround: use a tool that creates separate processes



I have a shellscript, that creates three terminal windows on my main computer's desktop. With some ideas from my script I made the following attempt, which might work for you (or help you make what you need),



#!/bin/bash

vdockw=0 #68
hdockw=60

resol=$(xrandr|grep current|cut -d, -f2)
resol=$(<<< "$resol" sed 's/.*current //')
echo $resol
xres=${resol%% *}
yres=${resol##* }
echo $xres $yres
xmid=$(( (xres-vdockw)/2 ))
ymid=$((yres-hdockw))
echo $xmid $ymid

#xterm -title "term v" & pid=$!
sakura --title="term v" & pid=$!
sleep 0.5
wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
sleep 1
echo $pid $wid
wmctrl -i -r $wid -e 1,0,0,$xmid,$ymid

#xterm -title "term h" & pid=$!
sakura --title="term h" & pid=$!
sleep 0.5
wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
sleep 1
echo $pid $wid
wmctrl -i -r $wid -e 1,$((xmid+vdockw)),0,$xmid,$ymid


I tested that it works in two installed 18.04 LTS systems, Lubuntu (as it is) and in standard Ubuntu (with vdockw=68).



The shellscript uses the program packages sakura wmctrl and maybe xterm, which are available from the repository universe and can be installed with



sudo apt update
sudo apt install sakura wmctrl xterm





share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484204%2fhow-to-cause-copies-of-executables-to-open-as-separate-processes%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    What you're seeing here is fairly specific to mate-terminal itself, though more generally using some shared GNOME/GTK+ infrastructure that you might also find in other applications (you mentioned pcmanfm as well.)



    When you launch a new copy of mate-terminal, perhaps from a different binary, it does create a new process for it. But mate-terminal is programmed to connect to D-Bus and try to look up a "factory", in which case it will pass it the arguments for what to start in the terminal and have the "factory" manage it, then terminate the new process. (If there's no factory, it will register itself as the factory, that's why the first process started will end up managing all terminals.)



    The "factory" is found through its D-Bus path, /org/mate/Terminal/Factory, which is hardcoded into the binary. (Thus, replicated into other copies of the binary.)



    In the case of mate-terminal specifically, you can disable this behavior by passing it a --disable-factory command-line argument. (See the man page for more details.)



    That's fairly unique to how mate-terminal works. In particular, pcmanfm doesn't really do this the same way. It's unclear whether pcmanfm supports a way to launch a separate process, or if the only way it works is by communicating through D-Bus with an existing instance. (You'd have to look into pcmanfm to see if it does.)






    share|improve this answer

















    • 1




      Thank you for your explanation. This is exactly what I was looking for. I did not understand what a "factory" was before reading your information. I will mark your answer as being the solution.
      – GaryH.
      Nov 27 at 18:29















    up vote
    3
    down vote



    accepted










    What you're seeing here is fairly specific to mate-terminal itself, though more generally using some shared GNOME/GTK+ infrastructure that you might also find in other applications (you mentioned pcmanfm as well.)



    When you launch a new copy of mate-terminal, perhaps from a different binary, it does create a new process for it. But mate-terminal is programmed to connect to D-Bus and try to look up a "factory", in which case it will pass it the arguments for what to start in the terminal and have the "factory" manage it, then terminate the new process. (If there's no factory, it will register itself as the factory, that's why the first process started will end up managing all terminals.)



    The "factory" is found through its D-Bus path, /org/mate/Terminal/Factory, which is hardcoded into the binary. (Thus, replicated into other copies of the binary.)



    In the case of mate-terminal specifically, you can disable this behavior by passing it a --disable-factory command-line argument. (See the man page for more details.)



    That's fairly unique to how mate-terminal works. In particular, pcmanfm doesn't really do this the same way. It's unclear whether pcmanfm supports a way to launch a separate process, or if the only way it works is by communicating through D-Bus with an existing instance. (You'd have to look into pcmanfm to see if it does.)






    share|improve this answer

















    • 1




      Thank you for your explanation. This is exactly what I was looking for. I did not understand what a "factory" was before reading your information. I will mark your answer as being the solution.
      – GaryH.
      Nov 27 at 18:29













    up vote
    3
    down vote



    accepted







    up vote
    3
    down vote



    accepted






    What you're seeing here is fairly specific to mate-terminal itself, though more generally using some shared GNOME/GTK+ infrastructure that you might also find in other applications (you mentioned pcmanfm as well.)



    When you launch a new copy of mate-terminal, perhaps from a different binary, it does create a new process for it. But mate-terminal is programmed to connect to D-Bus and try to look up a "factory", in which case it will pass it the arguments for what to start in the terminal and have the "factory" manage it, then terminate the new process. (If there's no factory, it will register itself as the factory, that's why the first process started will end up managing all terminals.)



    The "factory" is found through its D-Bus path, /org/mate/Terminal/Factory, which is hardcoded into the binary. (Thus, replicated into other copies of the binary.)



    In the case of mate-terminal specifically, you can disable this behavior by passing it a --disable-factory command-line argument. (See the man page for more details.)



    That's fairly unique to how mate-terminal works. In particular, pcmanfm doesn't really do this the same way. It's unclear whether pcmanfm supports a way to launch a separate process, or if the only way it works is by communicating through D-Bus with an existing instance. (You'd have to look into pcmanfm to see if it does.)






    share|improve this answer












    What you're seeing here is fairly specific to mate-terminal itself, though more generally using some shared GNOME/GTK+ infrastructure that you might also find in other applications (you mentioned pcmanfm as well.)



    When you launch a new copy of mate-terminal, perhaps from a different binary, it does create a new process for it. But mate-terminal is programmed to connect to D-Bus and try to look up a "factory", in which case it will pass it the arguments for what to start in the terminal and have the "factory" manage it, then terminate the new process. (If there's no factory, it will register itself as the factory, that's why the first process started will end up managing all terminals.)



    The "factory" is found through its D-Bus path, /org/mate/Terminal/Factory, which is hardcoded into the binary. (Thus, replicated into other copies of the binary.)



    In the case of mate-terminal specifically, you can disable this behavior by passing it a --disable-factory command-line argument. (See the man page for more details.)



    That's fairly unique to how mate-terminal works. In particular, pcmanfm doesn't really do this the same way. It's unclear whether pcmanfm supports a way to launch a separate process, or if the only way it works is by communicating through D-Bus with an existing instance. (You'd have to look into pcmanfm to see if it does.)







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 27 at 7:35









    Filipe Brandenburger

    6,7451732




    6,7451732








    • 1




      Thank you for your explanation. This is exactly what I was looking for. I did not understand what a "factory" was before reading your information. I will mark your answer as being the solution.
      – GaryH.
      Nov 27 at 18:29














    • 1




      Thank you for your explanation. This is exactly what I was looking for. I did not understand what a "factory" was before reading your information. I will mark your answer as being the solution.
      – GaryH.
      Nov 27 at 18:29








    1




    1




    Thank you for your explanation. This is exactly what I was looking for. I did not understand what a "factory" was before reading your information. I will mark your answer as being the solution.
    – GaryH.
    Nov 27 at 18:29




    Thank you for your explanation. This is exactly what I was looking for. I did not understand what a "factory" was before reading your information. I will mark your answer as being the solution.
    – GaryH.
    Nov 27 at 18:29












    up vote
    0
    down vote













    Workaround: use a tool that creates separate processes



    I have a shellscript, that creates three terminal windows on my main computer's desktop. With some ideas from my script I made the following attempt, which might work for you (or help you make what you need),



    #!/bin/bash

    vdockw=0 #68
    hdockw=60

    resol=$(xrandr|grep current|cut -d, -f2)
    resol=$(<<< "$resol" sed 's/.*current //')
    echo $resol
    xres=${resol%% *}
    yres=${resol##* }
    echo $xres $yres
    xmid=$(( (xres-vdockw)/2 ))
    ymid=$((yres-hdockw))
    echo $xmid $ymid

    #xterm -title "term v" & pid=$!
    sakura --title="term v" & pid=$!
    sleep 0.5
    wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
    sleep 1
    echo $pid $wid
    wmctrl -i -r $wid -e 1,0,0,$xmid,$ymid

    #xterm -title "term h" & pid=$!
    sakura --title="term h" & pid=$!
    sleep 0.5
    wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
    sleep 1
    echo $pid $wid
    wmctrl -i -r $wid -e 1,$((xmid+vdockw)),0,$xmid,$ymid


    I tested that it works in two installed 18.04 LTS systems, Lubuntu (as it is) and in standard Ubuntu (with vdockw=68).



    The shellscript uses the program packages sakura wmctrl and maybe xterm, which are available from the repository universe and can be installed with



    sudo apt update
    sudo apt install sakura wmctrl xterm





    share|improve this answer



























      up vote
      0
      down vote













      Workaround: use a tool that creates separate processes



      I have a shellscript, that creates three terminal windows on my main computer's desktop. With some ideas from my script I made the following attempt, which might work for you (or help you make what you need),



      #!/bin/bash

      vdockw=0 #68
      hdockw=60

      resol=$(xrandr|grep current|cut -d, -f2)
      resol=$(<<< "$resol" sed 's/.*current //')
      echo $resol
      xres=${resol%% *}
      yres=${resol##* }
      echo $xres $yres
      xmid=$(( (xres-vdockw)/2 ))
      ymid=$((yres-hdockw))
      echo $xmid $ymid

      #xterm -title "term v" & pid=$!
      sakura --title="term v" & pid=$!
      sleep 0.5
      wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
      sleep 1
      echo $pid $wid
      wmctrl -i -r $wid -e 1,0,0,$xmid,$ymid

      #xterm -title "term h" & pid=$!
      sakura --title="term h" & pid=$!
      sleep 0.5
      wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
      sleep 1
      echo $pid $wid
      wmctrl -i -r $wid -e 1,$((xmid+vdockw)),0,$xmid,$ymid


      I tested that it works in two installed 18.04 LTS systems, Lubuntu (as it is) and in standard Ubuntu (with vdockw=68).



      The shellscript uses the program packages sakura wmctrl and maybe xterm, which are available from the repository universe and can be installed with



      sudo apt update
      sudo apt install sakura wmctrl xterm





      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        Workaround: use a tool that creates separate processes



        I have a shellscript, that creates three terminal windows on my main computer's desktop. With some ideas from my script I made the following attempt, which might work for you (or help you make what you need),



        #!/bin/bash

        vdockw=0 #68
        hdockw=60

        resol=$(xrandr|grep current|cut -d, -f2)
        resol=$(<<< "$resol" sed 's/.*current //')
        echo $resol
        xres=${resol%% *}
        yres=${resol##* }
        echo $xres $yres
        xmid=$(( (xres-vdockw)/2 ))
        ymid=$((yres-hdockw))
        echo $xmid $ymid

        #xterm -title "term v" & pid=$!
        sakura --title="term v" & pid=$!
        sleep 0.5
        wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
        sleep 1
        echo $pid $wid
        wmctrl -i -r $wid -e 1,0,0,$xmid,$ymid

        #xterm -title "term h" & pid=$!
        sakura --title="term h" & pid=$!
        sleep 0.5
        wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
        sleep 1
        echo $pid $wid
        wmctrl -i -r $wid -e 1,$((xmid+vdockw)),0,$xmid,$ymid


        I tested that it works in two installed 18.04 LTS systems, Lubuntu (as it is) and in standard Ubuntu (with vdockw=68).



        The shellscript uses the program packages sakura wmctrl and maybe xterm, which are available from the repository universe and can be installed with



        sudo apt update
        sudo apt install sakura wmctrl xterm





        share|improve this answer














        Workaround: use a tool that creates separate processes



        I have a shellscript, that creates three terminal windows on my main computer's desktop. With some ideas from my script I made the following attempt, which might work for you (or help you make what you need),



        #!/bin/bash

        vdockw=0 #68
        hdockw=60

        resol=$(xrandr|grep current|cut -d, -f2)
        resol=$(<<< "$resol" sed 's/.*current //')
        echo $resol
        xres=${resol%% *}
        yres=${resol##* }
        echo $xres $yres
        xmid=$(( (xres-vdockw)/2 ))
        ymid=$((yres-hdockw))
        echo $xmid $ymid

        #xterm -title "term v" & pid=$!
        sakura --title="term v" & pid=$!
        sleep 0.5
        wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
        sleep 1
        echo $pid $wid
        wmctrl -i -r $wid -e 1,0,0,$xmid,$ymid

        #xterm -title "term h" & pid=$!
        sakura --title="term h" & pid=$!
        sleep 0.5
        wid=$(wmctrl -lp | grep "$pid" | cut "-d " -f1)
        sleep 1
        echo $pid $wid
        wmctrl -i -r $wid -e 1,$((xmid+vdockw)),0,$xmid,$ymid


        I tested that it works in two installed 18.04 LTS systems, Lubuntu (as it is) and in standard Ubuntu (with vdockw=68).



        The shellscript uses the program packages sakura wmctrl and maybe xterm, which are available from the repository universe and can be installed with



        sudo apt update
        sudo apt install sakura wmctrl xterm






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 27 at 7:48

























        answered Nov 27 at 6:51









        sudodus

        58116




        58116






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484204%2fhow-to-cause-copies-of-executables-to-open-as-separate-processes%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre