Bug 373905 - dbus - can not refer to the current instance
Summary: dbus - can not refer to the current instance
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 16.12.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-19 18:53 UTC by Tomasz C.
Modified: 2017-01-28 17:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz C. 2016-12-19 18:53:03 UTC
In konsole version 16.08 in dbus you could refer to the current instance, for example:
qdbus org.kde.konsole $KONSOLE_DBUS_SESSION setTitle 1 'Title'

After upgrade konsole to version 16.12 this is not possible, you must specify the PID.
qdbus org.kde.konsole-28263 $KONSOLE_DBUS_SESSION org.kde.konsole.Session.setTitle 1 "Title2"

When there is more than one process konsole, you can not be determined automatically PID. This makes it impossible unambiguous reference to the current process of konsole.

I know that it is possible to run multiple windows in a single process konsole, but it has two problems:
- You have to remember to create a new window instead of the process,
- In the case of crash you lose all the windows - because they were in a single process,

If the PID option for some reason must stay, please add the reference to the current instance for example:

qdbus org.kde.konsole-current $KONSOLE_DBUS_SESSION org.kde.konsole.Session.setTitle 1 "Title2"

or system variable with current instance like KONSOLE_DBUS_SESSION, example:
#echo $KONSOLE_DBUS_INSTANCE
org.kde.konsole-28263

to make it possible:
qdbus $KONSOLE_DBUS_INSTANCE $KONSOLE_DBUS_SESSION org.kde.konsole.Session.setTitle 1 "Title2"
Comment 1 Kurt Hindenburg 2017-01-22 17:31:54 UTC
use

qdbus $KONSOLE_DBUS_SERVICE  $KONSOLE_DBUS_SESSION setTitle 1 'Title'


although I realize it is not obvious to use this
Comment 2 Tomasz C. 2017-01-24 01:42:44 UTC
Thank you for the information.

Please update the information on the page:
https://docs.kde.org/stable5/en/applications/konsole/scripting.html
Comment 3 Kurt Hindenburg 2017-01-28 17:45:22 UTC
Git commit 792eda569a4af1bec35864604846445513527101 by Kurt Hindenburg.
Committed on 28/01/2017 at 17:43.
Pushed by hindenburg into branch 'master'.

Update release/date, scripting and command line help

Add more info about using dbus with Konsole's envirnomental variables
and re-add --nofork help

M  +44   -11   doc/manual/index.docbook

https://commits.kde.org/konsole/792eda569a4af1bec35864604846445513527101