Score:1

Cant run curl with arguments from .desktop file

mm flag

I've been trying to get a .desktop file to open a new full screen terminal, run "curl wttr.in" (wttr.in is a weather forecast service that works well with the terminal) , and leave the window open. I have managed to get other commands to run in a new full screen terminal from a .desktop file, but "curl wttr.in" doesn't work. The closest I have gotten to making it work is a .sh script with the following contents, which (executed on its own) does exactly what I want perfectly:

#!/bin/bash
gnome-terminal --window --maximize -- ./wttr.sh
$SHELL

wttr.sh contains

curl wttr.in
sleep 60

But even putting the path to that script (which I did make executable) as the Exec of a .desktop opens a full screen terminal with the following message and nothing else:

"There was an error creating the child process for this terminal Failed to execute child process "./wttr.sh": Failed to execve: No such file or directory"

I've tried doing it the more normal ways, like putting the program right at the end of the gnome-terminal thing, but that hasnt worked either.

I am using Ubuntu 22.04.2 LTS

This is my first time making one of these posts, so if there's something I could do better, feel free to let me know.

guiverc avatar
cn flag
You've not told us your OS/release details, but why use a *relative* path (ie. `./wttr.sh` relies on $PWD being correct otherwise "No such file" errors are to be expected), why not define the path fully?
BeeEss avatar
mm flag
@guiverc originally I was doing that by just keeping them in the same directory because ./someotherdirectory wasn't working... I just realized the dot is part of the path. That's an embarrassing mistake. It works now! Thanks for pointing that out.
Score:1
mm flag

I had misunderstood what the dot in ./ did, writing out the full path in both the .sh and the desktop file fixed the issue.

Frobozz avatar
ng flag
Good Question. Good Answer. Welcome to AskUbuntu.
I sit in a Tesla and translated this thread with Ai:

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.