How to start a new app in a new workspace on Xubuntu 16.04
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
2
down vote
favorite
Is there any way to open a new workspace whenever I open a new app?
For example, I have a terminal on workspace 1 and I want to open spotify but on workspace 2, and also when I open spotify I want to automatically move to workspace 2.
Is this possible?
xubuntu workspaces workspace-switcher
add a comment |Â
up vote
2
down vote
favorite
Is there any way to open a new workspace whenever I open a new app?
For example, I have a terminal on workspace 1 and I want to open spotify but on workspace 2, and also when I open spotify I want to automatically move to workspace 2.
Is this possible?
xubuntu workspaces workspace-switcher
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Is there any way to open a new workspace whenever I open a new app?
For example, I have a terminal on workspace 1 and I want to open spotify but on workspace 2, and also when I open spotify I want to automatically move to workspace 2.
Is this possible?
xubuntu workspaces workspace-switcher
Is there any way to open a new workspace whenever I open a new app?
For example, I have a terminal on workspace 1 and I want to open spotify but on workspace 2, and also when I open spotify I want to automatically move to workspace 2.
Is this possible?
xubuntu workspaces workspace-switcher
xubuntu workspaces workspace-switcher
edited Mar 14 at 20:59
![](https://i.stack.imgur.com/8CW8e.png?s=32&g=1)
![](https://i.stack.imgur.com/8CW8e.png?s=32&g=1)
Zanna
48.1k13120228
48.1k13120228
asked Mar 14 at 19:47
Mihai Temian
132
132
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
I haven't implemented this particular application, but it looks like xdotool
will do what you want.
Try launching your application with a wrapper script something like:
desktops=$(xdotool get_num_desktops)
desktops="$desktops"+1
xdotool set_num_desktops "$desktops"
xdotool set_desktop "$desktops"
run-my-application
I left out some details which are needed to make this more robust as they will vary a bit depending on what you are doing and would obscure the main idea:
Each xdotool
command returns a status which you should check. If a step fails, you don't want to proceed blindly.
You may want to set a maximum number of desktops which your script can create.
xdotool
can see if a window already exists and what desktop it is currently on. It can also move a window to another desktop. It can also activate a window, bringing it to the foreground and into focus.
You may need to add sleep
commands after certain operations to give the desktop and especially applications time to do their thing before you run the next step.
Since your script may be run from the desktop (and not just from a terminal), you may also want to log some messages to a file telling you what the script did to make debugging it easier.
The part where it gets a bit tricky is when an application has more than one window open. Then, you have to deal with a stack of instances and somehow find the right one or work on all of them. For instance, my Thunderbird
asks for a master password when it starts, so it has two windows open.
xdotool
also offers command chaining where you can run multiple actions from one xdotool
command. The results of the current action get pushed onto a stack read by the next action in the command. I have found this difficult to visualize and debug, but it's quite powerful if you can get it to work.
While xdotool
is the best fit for this particular issue, you may also want to take a look at AutoKey which can help you automate all sorts of desktop/GUI actions by issuing keypresses and mouse events that look just like you were doing them manually so they will work on most application and desktop features.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
I haven't implemented this particular application, but it looks like xdotool
will do what you want.
Try launching your application with a wrapper script something like:
desktops=$(xdotool get_num_desktops)
desktops="$desktops"+1
xdotool set_num_desktops "$desktops"
xdotool set_desktop "$desktops"
run-my-application
I left out some details which are needed to make this more robust as they will vary a bit depending on what you are doing and would obscure the main idea:
Each xdotool
command returns a status which you should check. If a step fails, you don't want to proceed blindly.
You may want to set a maximum number of desktops which your script can create.
xdotool
can see if a window already exists and what desktop it is currently on. It can also move a window to another desktop. It can also activate a window, bringing it to the foreground and into focus.
You may need to add sleep
commands after certain operations to give the desktop and especially applications time to do their thing before you run the next step.
Since your script may be run from the desktop (and not just from a terminal), you may also want to log some messages to a file telling you what the script did to make debugging it easier.
The part where it gets a bit tricky is when an application has more than one window open. Then, you have to deal with a stack of instances and somehow find the right one or work on all of them. For instance, my Thunderbird
asks for a master password when it starts, so it has two windows open.
xdotool
also offers command chaining where you can run multiple actions from one xdotool
command. The results of the current action get pushed onto a stack read by the next action in the command. I have found this difficult to visualize and debug, but it's quite powerful if you can get it to work.
While xdotool
is the best fit for this particular issue, you may also want to take a look at AutoKey which can help you automate all sorts of desktop/GUI actions by issuing keypresses and mouse events that look just like you were doing them manually so they will work on most application and desktop features.
add a comment |Â
up vote
0
down vote
accepted
I haven't implemented this particular application, but it looks like xdotool
will do what you want.
Try launching your application with a wrapper script something like:
desktops=$(xdotool get_num_desktops)
desktops="$desktops"+1
xdotool set_num_desktops "$desktops"
xdotool set_desktop "$desktops"
run-my-application
I left out some details which are needed to make this more robust as they will vary a bit depending on what you are doing and would obscure the main idea:
Each xdotool
command returns a status which you should check. If a step fails, you don't want to proceed blindly.
You may want to set a maximum number of desktops which your script can create.
xdotool
can see if a window already exists and what desktop it is currently on. It can also move a window to another desktop. It can also activate a window, bringing it to the foreground and into focus.
You may need to add sleep
commands after certain operations to give the desktop and especially applications time to do their thing before you run the next step.
Since your script may be run from the desktop (and not just from a terminal), you may also want to log some messages to a file telling you what the script did to make debugging it easier.
The part where it gets a bit tricky is when an application has more than one window open. Then, you have to deal with a stack of instances and somehow find the right one or work on all of them. For instance, my Thunderbird
asks for a master password when it starts, so it has two windows open.
xdotool
also offers command chaining where you can run multiple actions from one xdotool
command. The results of the current action get pushed onto a stack read by the next action in the command. I have found this difficult to visualize and debug, but it's quite powerful if you can get it to work.
While xdotool
is the best fit for this particular issue, you may also want to take a look at AutoKey which can help you automate all sorts of desktop/GUI actions by issuing keypresses and mouse events that look just like you were doing them manually so they will work on most application and desktop features.
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
I haven't implemented this particular application, but it looks like xdotool
will do what you want.
Try launching your application with a wrapper script something like:
desktops=$(xdotool get_num_desktops)
desktops="$desktops"+1
xdotool set_num_desktops "$desktops"
xdotool set_desktop "$desktops"
run-my-application
I left out some details which are needed to make this more robust as they will vary a bit depending on what you are doing and would obscure the main idea:
Each xdotool
command returns a status which you should check. If a step fails, you don't want to proceed blindly.
You may want to set a maximum number of desktops which your script can create.
xdotool
can see if a window already exists and what desktop it is currently on. It can also move a window to another desktop. It can also activate a window, bringing it to the foreground and into focus.
You may need to add sleep
commands after certain operations to give the desktop and especially applications time to do their thing before you run the next step.
Since your script may be run from the desktop (and not just from a terminal), you may also want to log some messages to a file telling you what the script did to make debugging it easier.
The part where it gets a bit tricky is when an application has more than one window open. Then, you have to deal with a stack of instances and somehow find the right one or work on all of them. For instance, my Thunderbird
asks for a master password when it starts, so it has two windows open.
xdotool
also offers command chaining where you can run multiple actions from one xdotool
command. The results of the current action get pushed onto a stack read by the next action in the command. I have found this difficult to visualize and debug, but it's quite powerful if you can get it to work.
While xdotool
is the best fit for this particular issue, you may also want to take a look at AutoKey which can help you automate all sorts of desktop/GUI actions by issuing keypresses and mouse events that look just like you were doing them manually so they will work on most application and desktop features.
I haven't implemented this particular application, but it looks like xdotool
will do what you want.
Try launching your application with a wrapper script something like:
desktops=$(xdotool get_num_desktops)
desktops="$desktops"+1
xdotool set_num_desktops "$desktops"
xdotool set_desktop "$desktops"
run-my-application
I left out some details which are needed to make this more robust as they will vary a bit depending on what you are doing and would obscure the main idea:
Each xdotool
command returns a status which you should check. If a step fails, you don't want to proceed blindly.
You may want to set a maximum number of desktops which your script can create.
xdotool
can see if a window already exists and what desktop it is currently on. It can also move a window to another desktop. It can also activate a window, bringing it to the foreground and into focus.
You may need to add sleep
commands after certain operations to give the desktop and especially applications time to do their thing before you run the next step.
Since your script may be run from the desktop (and not just from a terminal), you may also want to log some messages to a file telling you what the script did to make debugging it easier.
The part where it gets a bit tricky is when an application has more than one window open. Then, you have to deal with a stack of instances and somehow find the right one or work on all of them. For instance, my Thunderbird
asks for a master password when it starts, so it has two windows open.
xdotool
also offers command chaining where you can run multiple actions from one xdotool
command. The results of the current action get pushed onto a stack read by the next action in the command. I have found this difficult to visualize and debug, but it's quite powerful if you can get it to work.
While xdotool
is the best fit for this particular issue, you may also want to take a look at AutoKey which can help you automate all sorts of desktop/GUI actions by issuing keypresses and mouse events that look just like you were doing them manually so they will work on most application and desktop features.
answered Mar 22 at 7:13
Joe
1,171721
1,171721
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1014977%2fhow-to-start-a-new-app-in-a-new-workspace-on-xubuntu-16-04%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password