Reply to topic

autostart application on specific virtual desktop

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
3254
Karma
20
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.

Image
10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
User avatar toad
Global Moderator
Posts
1000
Karma
6
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
1000
Karma
6
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
3254
Karma
20
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.

Image
10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
User avatar toad
Global Moderator
Posts
1000
Karma
6
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
19743
Karma
84
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.


System Settings and Device Actions KCM maintainer
Image
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?

 
Reply to topic

Bookmarks



Who is online

Registered users: Andreas Mair, andreas_k, Baidu [Spider], Bing [Bot], capslock, dimitr, einar, Google [Bot], kamathraghavendra, koriun, Majestic-12 [Bot], metzman, paulus3005, rv8ter, sredna, veqz, YaCy [Bot], Yahoo [Bot], zekthedeadcow