OnBoard show and hide with Terminal
Hello,
is there a way to show and hide onBoard from Terminal?
Cause I want it to show from Programm and also Hide?
Something like "onBoard -show" and "onBoard-hide"?
Best Regards
Julian
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Onboard Edit question
- Assignee:
- No assignee Edit question
- Last query:
- 2016-10-06
- Last reply:
- 2016-10-08
Francesco Fumanti (frafu) said : | #1 |
Hi,
Thanks for your interest in Onboard.
It is possible to show and hide Onboard by using the terminal. You can find examples in the README:
http://
Have a nice day.
Francesco
Julian (7husky) said : | #3 |
Thanks Francesco Fumanti, that solved my question.
Julian (7husky) said : | #4 |
Thanks it solved my problem. I still have onBoard 1.2 but with the 1.3 extensions
Francesco Fumanti (frafu) said : | #5 |
Hi Julian,
Considering that you are running a system based on Ubuntu 16.04, you should be able to install Onboard 1.3 from our Stable PPA:
https:/
Cheers,
Francesco
Julian (7husky) said : | #6 |
Hi Francesco,
I get it worked with the terminal. But now I have another problem, when I tried to call it from C#.
I write
public static void ExecuteCommand(
{
Process proc = new System.
while (!proc.
{
}
}
int main(){
ExecuteCommand
}
And then an Error appeared:
org.freedesktop
Do you have any suggestions?
Best regards,
Julian
Francesco Fumanti (frafu) said : | #7 |
Hi marmuta,
I hope that everything is fine for you.
Could you please reply to this question? I guess that the problem is a file that is missing, but as I said, it is a guess.
Thanks in advance.
Francesco
On 2016-09-30 13:37, Julian wrote:
> Question #402422 on Onboard changed:
> https:/
>
> Status: Solved => Open
>
> Julian is still having a problem:
> Hi Francesco,
> I get it worked with the terminal. But now I have another problem, when I tried to call it from C#.
> I write
>
> public static void ExecuteCommand(
> {
> Process proc = new System.
> proc.StartInfo.
> proc.StartInfo.
> proc.StartInfo.
> proc.StartInfo.
> proc.Start();
>
> while (!proc.
> {
> Console.
> }
> }
>
> int main(){
> ExecuteCommand(
> }
>
> And then an Error appeared:
>
> org.freedesktop
> was not provided by any .service files
>
> Do you have any suggestions?
>
> Best regards,
>
> Julian
>
marmuta (marmuta) said : | #8 |
Julian, could you provide a complete example and build instructions? I tried
mcs onboard-dbus.cs
but that fails with
onboard-
Julian (7husky) said : | #9 |
you must open it with mono. But i get the same error if I want to send this command via c++ to commandline. Maybe my Code is wrong ist there an example to open this ommands with any programming language?
marmuta (marmuta) said : | #10 |
> you must open it with mono
mono onboard-dbus.cs
Cannot open assembly 'onboard-dbus.cs': File does not contain a valid CIL image.
I suppose it has to be built with mcs before. I'd appreciate detailed build instructions. Sorry, I don't know much about mono. There might be a problem with the environment of that particular ExecuteCommand call, but it's hard to tell if I can't even run it.
Usually programming languages don't need to launch dbus-send, since they have more direct support of D-Bus readily available. That's the benefit of having a D-Bus interface in Onboard after all. You're supposed to be able to use it from any language of your choosing. Don't know about mono/C#, though.
marmuta (marmuta) said : | #11 |
Python:
file: onboard-dbus.py
import dbus
bus = dbus.SessionBus()
proxy = bus.get_
keyboard = dbus.Interface(
keyboard.Show()
Run:
python3 onboard-dbus.py
marmuta (marmuta) said : | #12 |
C++ with Qt5:
file onboard-
TEMPLATE = app
TARGET = onboard-dbus-qt5
INCLUDEPATH += .
QT += dbus
# Input
SOURCES += onboard-dbus-qt.cpp
file onboard-
#include <QtCore>
#include <QDBusInterface>
int main() {
QDBusInterface iface( "org.onboard.
QDBusMessage reply = iface.call( "Show" );
return 0;
}
Build with:
export QT_SELECT=5
qmake
make
Run:
./onboard-dbus-qt5
marmuta (marmuta) said : | #13 |
C with GIO (GTK):
file onboard-dbus-gio.c:
#include <gio/gio.h>
int
main (int argc, char *argv[])
{
GError *error = NULL;
GDBusProxy *proxy = NULL;
proxy = g_dbus_
if (proxy)
{
}
if (proxy)
g_
if (error)
g_error_free (error);
return 0;
}
Build with:
gcc -o onboard-dbus-gio onboard-dbus-gio.c $(pkg-config --cflags --libs gtk+-3.0)
Run:
./onboard-dbus-gio
Julian (7husky) said : | #14 |
Thanks for this fast answers. I will try it Out tomorrow.
Julian (7husky) said : | #15 |
It works, thanks!
Julian (7husky) said : | #16 |
My Solution to run it in C# is. I create with Monodevelop a .so File in C. There I create a Function with the GTK C Code in it. And then I can import this C funktion in C# over this .so File. But now there is another Problem. I must run this Application as root. And then it doesn't work, cause of the Session Bus. I fixed this problem by replace "sudo *Applicationname*" with "sudo -u *username* *Applicationname*. But now there is my Question, is there another Way to manage this problem? I allready added "<allow user ="*"/> to the session.conf file in /usr/share/dbus-1, but it doesn't fix the Problem.
Do you have any suggestions?
Best regards
Julian
marmuta (marmuta) said : | #17 |
Don't know, sorry. I haven't tried to use a session bus as root yet. I'd imagine that would be possible somehow, but I haven't done it yet. Onboard is not prepared to be run as root, though, this much I can tell.
Can you help with this problem?
Provide an answer of your own, or ask Julian for more information if necessary.