Hide Onboard with shell command

Asked by V F on 2012-08-01

Hi,
Trying to show/hide Onboard keyboard from c++ code on linux. I can start it by executing "onboard" asynchronously (system("onboard &");).
Is there a similar way to hide it? Would be nice to spare that extra click on "hide onboard" when the user clearly finished typing.
If it is possible to move/resize Onboard by similar means please also let me know.
Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
Onboard Edit question
Assignee:
No assignee Edit question
Solved by:
V F
Solved:
2012-08-03
Last query:
2012-08-03
Last reply:
2012-08-01

This question was reopened

  • 2012-08-02 by V F
marmuta (marmuta) said : #1

Question: why doesn't auto-show work for you? Despite the name it auto-hides Onboard too when an editable text field goes out of focus.

IIRC, there is no official way to hide Onboard from the outside. However, if you are starting it with the onboard command already, you could as well kill it again, like 'killall onboard'. Make sure to just send SIGTERM and not SIGKILL though, as the latter may lead to stuck keys.

Moving/resizing should work by directly writing values to gsettings. You can do this from you program or from the command line with (for example):
gsettings set apps.onboard.window.landscape height 252
gsettings set apps.onboard.window.landscape width 864
gsettings set apps.onboard.window.landscape x 2
gsettings set apps.onboard.window.landscape y 592
and
gsettings set apps.onboard.window.portrait height 308
gsettings set apps.onboard.window.portrait width 959
gsettings set apps.onboard.window.portrait x 65
gsettings set apps.onboard.window.portrait y 971

As you see, there are two sets of positions/sizes. Wether Onboard uses the landscape or portrait set, depends on your screen's aspect ratio. Usually this will be landscape, but rotated (touch) screens may have a portrait aspect.

V F (trivia21) said : #2

Thanks marmuta, that solved my question.

V F (trivia21) said : #3

I have already used pidof + kill, just wanted to know if there was an official way (that avoids reloading Onboard).
Thanks for the size/position settings I somehow missed them as they weren't listed by gsettings list-recursively apps.onboard.

marmuta (marmuta) said : #4

> Thanks for the size/position settings I somehow missed them as they weren't listed by
> gsettings list-recursively apps.onboard.
Yes I was wondering myself why the recursion stops early there. You can catch all the keys with this though:
gsettings list-recursively | grep apps.onboard.

I'll see that I get some hide function into Onboard, maybe a command line option. That one wouldn't save state to disk on every show/hide action like a gsettings key would.

V F (trivia21) said : #5

Just checked, "killall onboard" (or "killall -s TERM onboard") doesn't really release the currently pressed keys. Am I missing some steps? Unity seems to do the trick on the login screen.

marmuta (marmuta) said : #6

SIGTERM handling is relatively fresh, it's only in Onboard 0.97.1. Quantal has it, Precise is stuck with 0.97.0 unfortunately.
I've checked, unity-greeter in Quantal still kills Onboard with SIGKILL, the bug report is still open there:.
https://bugs.launchpad.net/unity-greeter/+bug/978430

V F (trivia21) said : #7

Thanks. I used to have 0.97.0, now everything works as expected.