This forum has been archived. All content is frozen. Please use KDE Discuss instead.

autostart application on specific virtual desktop

Tags: None
(comma "," separated)
strycat
Registered Member
Posts
18
Karma
0
So I created an entry in Autostart to open an ssh session to one of my servers. However I'm not seeing any way to say I want this to appear on Desktop 2 instead of 1.

How do I specify that? Do I need to add something to the .desktop file it created?

Thanks in advance.
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
You can try kstart, e.g.
Code: Select all
kstart --desktop 2 konsole


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
I don't know kstart and it is probably much neater than the following:

Place the Konsole on your second desktop, open systemsettings - window behaviour - window rules - new - detect window properties - click on konsole - back in systemsettings click on size & position - select desktop and force desktop 2


Debian testing
strycat
Registered Member
Posts
18
Karma
0
Hans wrote:You can try kstart, e.g.
Code: Select all
kstart --desktop 2 konsole


Thanks but this doesn't seem to work on start up. It works if I do it on the command line, but not when KDE starts and restores my session.

toad wrote:I don't know kstart and it is probably much neater than the following:

Place the Konsole on your second desktop, open systemsettings - window behaviour - window rules - new - detect window properties - click on konsole - back in systemsettings click on size & position - select desktop and force desktop 2


This also isn't working on start up. When I create the rule it will move the window if it isn't on the correct desktop, but again when KDE first starts the window still appears on desktop 1.

What else can I try?
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
Hm, the above works for me. Have you tried a different option like "force"? I've got my desktop set up so that I've got social stuff on desktop 1, work on desktop 2, multimedia on desktop 3 and system related stuff on desktop 4 - and it plays nicely. Should work for you, too.


Debian testing
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
strycat wrote:
Hans wrote:You can try kstart, e.g.
Code: Select all
kstart --desktop 2 konsole


Thanks but this doesn't seem to work on start up. It works if I do it on the command line, but not when KDE starts and restores my session.


You want to add that to your autostart program or script and not include it in your session.

toad wrote:I don't know kstart and it is probably much neater than the following:

Place the Konsole on your second desktop, open systemsettings - window behaviour - window rules - new - detect window properties - click on konsole - back in systemsettings click on size & position - select desktop and force desktop 2


The problem with this approach is that it'll open all Konsole windows on desktop 2 (right?).


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
The problem with this approach is that it'll open all Konsole windows on desktop 2 (right?).
Right!


Debian testing
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You could set it to Force initially only, and also set Konsole to launch with a --title option - which will change the window title - and allow KWin something further to match on. That should avoid non-autostarted Konsole windows from being affected.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
strycat
Registered Member
Posts
18
Karma
0
So after playing with this a while, I had to delete the .desktop file that had been created for this. I then in the same autostart directory placed a .sh file with the relevant command in the file.

It seems to work now. The only problem is that when KDE now starts it starts on desktop 2 (where the window correctly opened) and I still want desktop 1 to be what I see first.

I looked through the kstart --help-all options but didn't see anything about not switching the active desktop. Did I miss something? Is there any way to do this?


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot]