[Konsole-devel] DCOP to DBUS migration - issues

Robert Knight robertknight at gmail.com
Tue Nov 10 02:41:13 UTC 2009


Hi Marian,

Thank-you for the feedback.

>$ session=$(qdbus org.kde.konsole /Konsole org.kde.konsole.Konsole.newSession "Shell" "/home")
> Invalid number of parameters

Ah, there are two newSession() methods, one with parameters and one
without.  It seems that qdbus does not support overloading and only
allows the first to be picked based on the name.  That's pretty stupid
on Konsole's part - it can be fixed by changing the method name of one
of the instances or removing one of them.  Otherwise it might be
possible using a different command-line tool.  I'm not sure if
dbus-send supports this.

> * For each character set I need a different profile
> * For each color schema I need a different profile (test, production)
> * If I want to have a different font size for some specific server(s) - I need another profiles

> It means I need to create a profile for each possible combination.
> (utf8-test-standard_font, utf8-prod-standard_font, iso8899-2-test...)

There is a 'hidden' konsoleprofile command-line tool to set per-tab
properties.  This tool echoes a "profile-property=string" message to
Konsole
preceeded by a special escape code (open konsole-profile in a text
editor to see).  You can invoke this from DBus using:

qdbus org.kde.konsole /Sessions/$sessionId
org.kde.konsole.Session.sendText "echo -e
'\033]50;colorscheme=WhiteOnBlack\a'
"

This can be used to set (almost) any profile property per-tab.
Multiple profile=value assignments can be put in the same command
separated by semi-colons.  The tab title can be set using a
combination of "LocalTabTitleFormat" and "RemoteTabTitleFormat"
properties, the tab title update will happen after a short delay.  The
font can be set using the "Font" property, eg. "font=Monospace,12"
The possible property names and values are the same as those used in
the .profile files created in ~/.kde/share/apps/konsole when you
create
profiles in the GUI.

You can set the codec using the setCodec() DBus method.  It would be
useful to have explicit methods for things like the color scheme to
make the interface easier to figure out though.

> 3) There is not a possibility to copy/clone actual profile. I have to create each from default.

Pressing the 'New' button creates a copy of the selected profile.  I
think this is not obvious enough from the UI though.

Regards,
Robert.

2009/11/2 Marián Kyral <mkyral at email.cz>:
> Hi all,
> this weekend I finale migrated my script from DCOP to DBUS to fully switch to a new Konsole (2.3.3 - KDE 4.3.2).
>
> The script is simple, just get a server alias as a parameter, find out stored parameters (simple
> configuration file), starts a new konsole tab, setup it (rename tab, set correct character set...)
> and call ssh to the server.
>
> After migration I have this (core):
> -----------------------------------------------
>  function sendCommand
>  {
>    qdbus org.kde.konsole /Sessions/${session} org.kde.konsole.Session.sendText "$(echo $1 $'\r')" 1>/dev/null 2>/dev/null
>  }
>
>  # create new session
>    session=$(dbus-send --session --dest=org.kde.konsole --type=method_call --print-reply=number /Konsole org.kde.konsole.Konsole.newSession string:"ssh-$SSH_CHARSET" string:"~" |cut -c 10-)
>
>    sendCommand "clear"
>    sendCommand "export TERM=$SSH_TERM"
>    sendCommand "ssh ${SSH_USER}@${SSH_IP} -p ${SSH_PORT}"
>    qdbus org.kde.konsole /Sessions/${session} org.kde.konsole.Session.setTitle 1 ${SSH_USER}@${SSH_LABEL}
> ----------------------------------------------
>
> There are a lot of servers, usually I need up to 10 servers, but are changing and sometime
> I need to connect to production (a lot of shops). Some servers are linux and have UTF-8 encoding,
> but mostly there are AIX servers with ISO-8859-2 set.
>
> Now the issues I found:
>
> 1) Probably a qdbus bug
>
> $ session=$(qdbus org.kde.konsole /Konsole org.kde.konsole.Konsole.newSession "Shell" "/home")
> Invalid number of parameters
>
> 2)
>  * For each character set I need a different profile
>  * For each color schema I need a different profile (test, production)
>  * If I want to have a different font size for some specific server(s) - I need another profiles
>
>  It means I need to create a profile for each possible combination.
>  (utf8-test-standard_font, utf8-prod-standard_font, iso8899-2-test...)
>
> 3) There is not a possibility to copy/clone actual profile. I have to create each from default.
>
> 4) There is no information which profile is used.
>
> 5) The biggest problem for me: I want to permanent rename the tab. It though
>  "org.kde.konsole.Session.setTitle()" will do it and it does. But only for a while. Then is renamed back.
>  And I did not found a way how to prevent it. Even with blank format for remote connection it is
>  replaced after a while (by session name).
>
>  I really want to see my aliases as a tab name. Now I have IP or some cryptic name set by unix admins
>  and I'm totally lost and sometimes I'm not sure on which server I'm working now.
>  Especially if there is only "SQL>" (the oracle sqlplus prompt).
>
> Some ideas:
> 1) Allow to set character set via DBUS - It is already available under the View menu.
> 2) Allow to increase/decrease font size via DBUS
> 3) Add possibility to permanent rename of tab. E.g. option "Don't update tab name" under tab setting.
>
> Regards,
> Marian Kyral
> _______________________________________________
> konsole-devel mailing list
> konsole-devel at kde.org
> https://mail.kde.org/mailman/listinfo/konsole-devel
>



More information about the konsole-devel mailing list