Registered Member
|
Hi.
Many years ago I decided to create some functionality like in Windows. Allowing to add to executable information that this program is an interactive console program, so DE could automatically spawn a terminal, when user click on executable. This may help in many cases. Everybody known situation, where installer are offered as console program. User must run terminal manually, use cd (change current working directory) to that's program directory and run program. In case, when program is linked with library from my utility autodetection of current environment are processed. My library will check program isn't running in terminal already and check some environment variables, such like force spawn terminal, allow user to select terminal program, etc. Additionally, my solution supports many backends (currently only GTK+/GNOME and xdg-term). Backend are selected automatically based on environment variables (such like XDG_SESSION) and in ASK mode allowing user to select what to do (run program in background, select terminal to use to run program and automatically select terminal to run program). Currently it could cause some issues, when using in bad way. For example: Imagine bash developer link bash with my library and user create simple bash script to shutdown a computer. When user click on this bash script, terminal will spawn. I decided to solve the problem by creating two new modes: SILENT and DELAYED. Silent mode will create buffer for text, where messages are captured and scrolled. When program read from standard input, terminal will be spawn and buffer will be flush to newly-created terminal. Delayed mode is like silent, but additionally it spawn terminal, when program writes something. Additionally, bash could load this library only if it works in interactive mode. I create also cli2gui-exec, which loads library and perform exec on give arguments. Solution is still in pre-alpha. As I said, that's not new idea. It worked in similar way like console on MS Windows: it uses special server application. I try to create this project many years ago, but don't have a time. Yesterday I decided to work on it and thing matures. I asks for test it and (maybe in future) add it to Plasma. Additionally, I asks to port your program to my solution and help develop Qt backend. Fell free to download it: https://sourceforge.net/projects/cli2gui/
Lachu, proud to be a member of KDE forums since 2008-Nov.
|
Registered Member
|
So, there's already a partial solution/workaround for this. You can create a .desktop application shortcut for it and inside that file set Terminal=true (and optionally set TerminalOptions=\s--noclose).
Dolphin can help you create this application shortcut file: Right-click in the folder -> Create New -> Link to Application. In the dialog that pops up, fill in whatever details under General and Application (in particular setting the Application Command to the full path of the script), then in the Application tab hit Advanced Options. That pops up another dialog where you can check that you want it to Run in terminal (and Do not close when command exits; as well as any additional terminal options the script may need) Granted, this doesn't cover all of the described functionality, always opening a terminal regardless of if the script/app uses stdin/out/err at all; but at least it doesn't require linking the app/script to another library to activate.
airdrik, proud to be a member of KDE forums since 2008-Dec.
|
Registered users: Bing [Bot], blue_bullet, Google [Bot], Yahoo [Bot]