Launching a terminal app from command line
#1
Ok, I have been trying to launch a program from a desktop script file. This failed miserably until I wrote the code:


Code:
Version=1.0
Name=Manuskriptlauncher
mate=terminal -- working-directory= .. -e 'manuskript=develop/bin/manuskript'

Double-clicking on the icon for this file on the desktop results in a mate-terminal window. This first window complains:

"The child process exited normally with status 0"

Then application starts with a dialog window that asks for an output option, accepts "Terminal". The dialog then exits and a GUI window opens with the main program. The program outputs status messages to the second terminal window. No problems. But when I exit the program the second mate-terminal now complains of the same "The child process...". Both mate-terminal windows remain up.

Launching the program from a terminal window by hand results in the output option dialog, followed by the program. No "child..." messages in the mate-terminal window. Exiting the program collapses both windows without apparent warnings. Alternately, closing the mate-window kills off the main program. This is the preferred behavior.

So, I would like the behavior of the system when launching from the script to be the same as invoking the program from the command - one terminal and no silly "child..." messages. Am I right in thinking there a property of the desktop launch script that is set wrong?
"Get your facts straight first, then distort them as you wish." -- Mark Twain
#2
hi , typically there are at least two things going on;  1) a shell or program,  and 2) a terminal or gui.

Normally what folks want is a bash shell to run in a terminal ( notice the two things there , the shell and the terminal ).  There are usually two options that one specifies in this case:  1) do you want the shell or program to run in a terminal, and 2)  do you want to the terminal to close when the shell or program exits ?

So, you have two choices for Type:  Application   , or  Application in Terminal.

Then you have the name:   "Mate Terminal"

... then some comment like:   Use the Command Line

and then you have the name of the executable:   mate-terminal    or  /usr/bin/dash

------

For the Mate Terminal  folks usually specify type "Application" , name "Mate Terminal" , command  mate-terminal , and comment  "Use the Command Line"
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
#3
(09-22-2017, 03:32 PM)Siliconserf Wrote:
Code:
Version=1.0
Name=Manuskriptlauncher
mate=terminal -- working-directory= .. -e 'manuskript=develop/bin/manuskript'
this code doesn't make any sense.
please show us the complete content of the .desktop file in question.
#4
(09-28-2017, 01:14 AM)dahni Wrote:
(09-22-2017, 03:32 PM)Siliconserf Wrote:
Code:
Version=1.0
Name=Manuskriptlauncher
mate=terminal -- working-directory= .. -e 'manuskript=develop/bin/manuskript'
this code doesn't make any sense.
please show us the complete content of the .desktop file in question.

Thanks for posting. The only missing line is "exit" at the end. So, the code posted was it. However, I edited the file to be just this:

~/manuskript-develop/bin/manuskript

That works. I still get an exit status message I don't want to see, but it works.

Once I got to that point I added a line that mounts googledrive:

google-drive-ocamlfuse ~/googledrive
~/manuskript-develop/bin/manuskript

I tried putting the mounting command into system startup script, but that seems to cause a problem which I attribute to the wi-fi connection not being completed before the mount command is executed. In any event, my next adventure in command line programming will be to set up issuing a command mounting the googledrive only if it isn't already mounted (just to get rid of the pesky error messaging about needing to unmount a drive before trying to mount it. It would be simpler, I suppose, to put the google mount command in another desktop file and invoking it when I need to use a program that needs to look at files there, but that wouldn't be as much fun.
"Get your facts straight first, then distort them as you wish." -- Mark Twain
#5
i still don't get it.

i assume you are not talking about a gnu/linux .desktop file, which is a plain text file in a special format.
nothing that you posted adheres to that format.

so is it a shell script?
unfortunately the scattered snippets don't look like a shell script either.

if it works, fine, nevermind me.

if not, please post the complete content of the script (?) in question, and how you are invoking it, and what it is supposed to do.
#6
This whole exercise started from my desire to double-click an icon on the desktop and have the target application launch without jumping through hoops with the command line each time I wanted to run the program.

Putting a copy of the script file that actually launches the program I want to run, on the desktop, didn't work. Probably something subtle in the file. Creating a script file to launch that script file seemed the easier approach. After a few attempts I found a measure of success, but it was with one too many terminal windows. Further work yielded the working script I posted, but I'm still curious as to how to tell the terminal application to not post the exit codes. Probably I would get more success in that with the program writers, but I thought bash might let me get there.

In any event, the application is the swamp, the scripts are the alligators. As much fun as it has been to wrestle with them, I really need to get back to draining the swamp.

;-)

Oh, and thanks for taking the time to try to help with my puzzle.
"Get your facts straight first, then distort them as you wish." -- Mark Twain


Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] How to poweroff PBP from Linux terminal? mx43 1 3,712 03-21-2020, 12:49 PM
Last Post: tllim
  KNOWING how to properly use the "dd" command. chessie 5 5,993 04-29-2019, 12:59 AM
Last Post: erchache2000
Information i3wm xenial-i3 introduction -- mate terminal & battery monitor MarkHaysHarris777 4 6,851 08-31-2017, 04:47 AM
Last Post: shirman

Forum Jump:


Users browsing this thread: 1 Guest(s)