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

How do I the color scheme in Konsole using dbus?

Tags: konsole konsole konsole
(comma "," separated)
CharlieW
Registered Member
Posts
1
Karma
0
I recently switched from kde3.5 to 4.4.5
In KDE3, when I would ssh to my production environment I changed the screen colors from Black on White to Green on Black. This gave me a very obvious visual warning that I needed to be careful. I had an alias for ssh that invoked the following script.

if [ "$KONSOLE_DCOP_SESSION" ]
then
#not entirely fool-proof, but it works well enough
if [[ $@ =~ "prod" ]]
then
dcop ${KONSOLE_DCOP_SESSION} setSchema "GreenOnBlack.schema"
ssh $@
dcop ${KONSOLE_DCOP_SESSION} setSchema "BlackOnWhite.schema"
else
ssh $@
fi
fi


I understand that dcop is not supported in KDE4 and that I should use dbus instead. I've spent some time trying to find documentation on dbus but have been marginally successful at best. Any suggestions on how to do this using dbus?

thanks
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
I have examined the D-Bus API for Konsole and it seems that this functionality is no longer present. It was replaced with Profiles, which cover more functionality - and which do provide for a workaround.

First, create a new profile using the profile configuration panel. Change the shell to be the ssh connection command for your production environment, then select the appearance you want for this profile. Once created, it will be accessible from the File > New Tab menu.

You can associate a shortcut to it using Settings > Configure Profiles as well, to make it convenient to access.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
Jekyll
KDE Developer
Posts
34
Karma
0
OS
Well, there is no dbus equivalence at the moment, but there is another handy way.

You can use the 'konsoleprofile' script to modify the profile options used in current tab on the fly. In this example, you can use "konsoleprofile ColorScheme=GreenOnBlack" and "konsoleprofile ColorScheme=BlackOnWhite".

Note, that script only applies to the current konsole tab.
kde-jlinkels
Registered Member
Posts
9
Karma
0
The script konsoleprofile does absolutely nothing. It only prints a message when the number of parameters is less than 1. But whatever parameter is entered, nothing is executed. This is the only [active] code in the konsoleprofile script on my system:
Code: Select all
printf "\033]50;%s\a" "$1"


My goal is to change the ColorScheme from the command line.

Debian Jessie
KDE 4.14.2

jlinkels
luebking
Karma
0
works perfectly here (konsole part 4.14 and 15.08.0

Enter
Code: Select all
konsoleprofile ColorScheme=GreenOnBlack


to select the "GreenOnBlack" colorscheme for the konsole terminal tab the call was made from.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]