[SOLVED]How to use kstart properly

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED]How to use kstart properly

Postby davidmageia » Nov 5th, '15, 10:22

Hi,

I would like to write a very simple script which could launch my favorite software when I start to work like : firefox, dolphin, zim...
But I would like that each software open in the right virtual desktop.
But for example,
Code: Select all
kstart --desktop 2 chromium-browser &


does not open chromium in the desktop 2 but in the 1.
Ths is not the case with
Code: Select all
kstart --desktop 2 dolphin &

It opens in the desktop 2, even if I launch the command in the desktop 1.

It does not work also for firefox, birdie...

Do I need to add something in the kstart command ? I would like to launch simultaneously 4-5 software.
Last edited by davidmageia on Nov 25th, '15, 09:57, edited 1 time in total.
davidmageia
 
Posts: 21
Joined: Feb 16th, '14, 20:22

Re: How to use kstart properly

Postby doktor5000 » Nov 5th, '15, 19:56

the help seems to recommend providing either window title or class:
kstart --help wrote:
Code: Select all
  --window <regexp>         A regular expression matching the window title
  --windowclass <class>     A string matching the window class (WM_CLASS property)
                            The window class can be found out by running
                            'xprop | grep WM_CLASS' and clicking on a window
                            (use either both parts separated by a space or only the right part).
                            NOTE: If you specify neither window title nor window class,
                            then the very first window to appear will be taken;
                            omitting both options is NOT recommended.



That may be a dumb question, but why hardcode the desktop in the script? I usually do that via the kwin settings.
Right-click on the window title => advanced => special settings for this window (or program depending what you want)

See e.g. https://userbase.kde.org/KWin_Rules_Examples or https://userbase.kde.org/KWin_Rules for more details.

You could also try with wmctrl or this: http://kde-apps.org/content/show.php/WM ... tent=40425
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18058
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: How to use kstart properly

Postby alf » Nov 5th, '15, 20:36

davidmageia wrote:I would like to write a very simple script

Why writing a script, that can be done in KDE's autostart directly. See the screenshots.
davidmageia wrote:does not open chromium in the desktop 2 but in the 1.

You have at least to pass the window title like this example
Code: Select all
kstart  --desktop 2 --window "Mozilla Firefox" firefox


Bildschirmfoto2.png
Bildschirmfoto2.png (35.56 KiB) Viewed 1730 times

Bildschirmfoto3.png
Bildschirmfoto3.png (65.3 KiB) Viewed 1730 times
for windows problems reboot; for linux problems be root
alf
 
Posts: 326
Joined: Apr 1st, '11, 23:07
Location: DE Paderborn

Re: How to use kstart properly

Postby davidmageia » Nov 25th, '15, 09:57

Thank you.
It works by adding "--window "Name of the software"".
And thank you for the tips on Kde which I did not know (even I prefer to write my own script...).
davidmageia
 
Posts: 21
Joined: Feb 16th, '14, 20:22


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest