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

[Dolphin][Plasma5] Detect application type ran terminal

Tags: None
(comma "," separated)
Lachu
Registered Member
Posts
864
Karma
1
OS
Many DE allow to select "run in terminal" option or "simple run", when user click on executable (for example shell script).

On step forward is detecting app type. Currently, my solution, only detects console and wayland GUI apps, but not without problems. One problem is Dolphin, witch is detected as console and after some time, as GUI. X11 application is not detected well. I must work on this. If shell script ran GUI app, it will be detected as console app.

Many applications are detected correctly. For example, bash, cat, dolphin, konsole, etc. When user start app by my launcher, this app is running. And there is magic. After that, one button label is setting to "autoresolution([APP_TYPE])" (autoresolution(console)) for example. User still have an option to select GUI, console, others. In future I will add option to remember selection.

But I need suggestions. Currently, we display dialog either application is GUI. For user it is useless. In other hand, showing dialog as soon as possible is good, because user do not get panic by "this app would not wok think". Also, option to show console is always good thing/think.

What are your suggestions?

There you have link:
https://sourceforge.net/projects/wxconsolespawner/

It needs libgreattao (download sources from git). Currently, only one working backend is gtk+-2.0 . I am working for Gtk4 backend now. In future I will work on console and Qt5 or Qt6 backend.


Lachu, proud to be a member of KDE forums since 2008-Nov.
Lachu
Registered Member
Posts
864
Karma
1
OS

Motivation

Fri Jul 09, 2021 2:19 pm
Many years ago, I create cli2gui. Library, which will automatically spawning terminal window on startup (if program do not be ran in terminal). Everything developer must do is link one's program with my library. There is also option to load it dynamically. There exist also program, which load cli2gui library and run specified command. But nobody link program with my library.

So... I decided to made every console application work in way such like windows. But not always (only in cases, when user need this). So I decided to detect if application is gui/console. As I said, currently only console and partially wayland is supported. I will also extend this app in near future.


Lachu, proud to be a member of KDE forums since 2008-Nov.
Lachu
Registered Member
Posts
864
Karma
1
OS

Last edited by Lachu on Sun Jul 11, 2021 3:32 pm, edited 1 time in total.


Lachu, proud to be a member of KDE forums since 2008-Nov.
Lachu
Registered Member
Posts
864
Karma
1
OS
I need help with getting terminal emulator work better.
My solution uses proxy terminal program and I need forward change terminal attribute action to real terminal.


Lachu, proud to be a member of KDE forums since 2008-Nov.
Lachu
Registered Member
Posts
864
Karma
1
OS

Xlib/Xcb apps under Wayland

Sat Sep 18, 2021 7:41 pm
WXConsoleSpawner proper detects X11 application under Wayland. It reads /proc/%n/maps to detect if there is Xlib/Xcb loaded, so if application communicate with X server without using one of these libraries, it wont work. Do you known any of these applications?

Also, I need help with implementing console server.

EDIT: There is still some problems with applications without GUI, but spawning process creating GUI. I known, that if some application starts other application, which are GUI, parent should fork twice instead of one. Maybe this could be useful?


Lachu, proud to be a member of KDE forums since 2008-Nov.
Lachu
Registered Member
Posts
864
Karma
1
OS
I added dolphin service menu.
I updated Make install local target to install also this service menu.
I added global Make install target.

See MakeFile to check available target.
After install, right click on binary-executable file and select Actions/Run this app to detect it type (or something like that).


Lachu, proud to be a member of KDE forums since 2008-Nov.
Lachu
Registered Member
Posts
864
Karma
1
OS
I am working on KIO integration currently. One KDE developer give me green light to implement this functionality.

There is also an merge request: https://invent.kde.org/frameworks/kio/- ... quests/891


I tested and it works as WXConsoleSpawner (so do not working for some X applications and for scripts, which spawn GUI process, for example). I think I can address these problems. Code is a mesh. There is merge request: https://invent.kde.org/frameworks/kio/- ... quests/891 .


Lachu, proud to be a member of KDE forums since 2008-Nov.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]