Score:1

using a tee inside a .desktop file for debug logging

br flag

How do I write a .desktop file that includes a tee?

Normally I start my debug logging from terminal, using a .sh like the below:

sudo ./start-ds.sh 2>&1 | tee output.log

I have to go into hospital and I want to continue the testing whilst I am in so I want my partner to simply double click the desktop icon to start it.

How do I write a .desktop file that will start the app and also have it start a debug log file?

current start-ds.desktop file is:

[Desktop Entry]
Type=Application
Terminal=true
Name=Start ds
Exec=/home/agx/ds/start-ds.sh

current .sh file is:

#!/bin/bash

export gst_debug=3

$(/home/agx/ds/ds-app -c /home/agx/ds/app-config.txt)

exit 0

Many thanks for your help

hr flag
Why are you wrapping the command inside a command substitution `$(...)`? Do you want the output to be tee'd only when run from the .desktop file, or when the shell script is run directly as well? Do you want errors to be tee'd to the log file, or just standard output?
cdevd avatar
br flag
HI, I was told to wrap it in $(....) by an "expert" I noticed that I missed out the export debug line also, sorry - it must the the stress. The "export gst_debug=3" should log all of the error messages so I think this means I just want the standard output. thanks
Score:0
br flag

I simply created a second .sh

#!/bin/bash
$(sudo ./start-ds.sh 2>&1 | tee output.log)
exit 0

then modified the .desktop to run that one and it, in turn, starts the original .sh with logging

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.