4

I'm writing a script which needs to open a terminal window with a specific geometry and window title. I'm having trouble setting these with KDE konsole.

According to its help output I need to do:

  konsole -p <property=value>  

and use

  konsole --list-profile-properties

to get a list of the available properties. So I did this and I found that the properties I want to change are:

   TerminalRows, TerminalColums, TerminalCenter and tabtitle. 

Great. So I tried:

   konsole -p "TerminalRows=8"

but it didn't do anything. I've tried putting in all the properties like this but nothing seems to work. Did I mess up the syntax somehow? I should also note that I've installed console in gnome-shell in ubuntu, could that be what's giving me trouble?

7
  • 2
    "Configure Konsole>General>Use current window size on next startup must be disabled for these entries to work"
    – jordanm
    Commented Apr 16, 2018 at 5:08
  • Ah, can that be disabled temporarily via terminal terminal or does it have to be unchecked by user? Commented Apr 16, 2018 at 6:48
  • Not sure, I just found that by looking at the option in the GUI.
    – jordanm
    Commented Apr 16, 2018 at 13:26
  • Gnome has a command line tool called gsettings that allows you to set most of shell's prefs from the terminal. Do you know if kde has something similar? (thanks for tip by the way). Commented Apr 16, 2018 at 15:37
  • Yeah, check out kwriteconfig. I am not sure if it works for konsole settings, though.
    – jordanm
    Commented Apr 16, 2018 at 17:08

2 Answers 2

2

Unfortunately the konsole command does not recognize the complete -geometry ... specification like xterm, e.g. xterm -geometry 100x44+0-30. You have to specify the window size separately. The following command is working:

konsole -p 'TerminalColumns=100' -p 'TerminalRows=42' -geometry +0-30

The additional parameter -p 'LocalTabTitleFormat=my_tab' gives you control over the tab title.

1
  • 1
    Copy-pasted that -- none of the switches did anything. Until I followed jordanm's comment, "Configure Konsole>General>Use current window size on next startup must be disabled for these entries to work".
    – goldilocks
    Commented Jul 25, 2019 at 20:58
0

I found that konsole --help-all gave some additional QT options, one of which was --qwindowgeometry which does work. However, the size params are pixel based, which is a bit less convenient.

It did allow setting of the window title with --qwindowtitle title; the -p option didn't work for the title property, maybe because it is focused on the tab.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .