SOLVED: Terminal Weather Forecast In Menu

I have added “Weather Forecast” to the “Accessories” menu in my setup. The issue is that it opens for about 1 second and then closes. I know something is wrong but, how do I fix it? I think it is an entry error but dont know how to fix it. Any help greatly appreciated! Below is the entry I put into the menu.

<menu id="Accessories" label="Accessories">
      <item label="Weather Forecast" icon="/usr/share/icons/hicolor/16x16/apps/org.xfce.terminal.png">
       <action name="Execute"><execute>xfce4-terminal -T "Forecast" --geometry=1280x800 -e "curl wttr.in/70531?u ; read"</execute></action>
     </item>

top of head, quickly, drinking:

runs underneath? like a terminal-only program?
require a .conf? or requires a chron? is there a gui?
“-T Forecast” doesn’t sound like an executable. Sounds like the reverse? Pacman info command to clarify?
terminal output?
that’s it, brain empty, can empty:)

You can try to launch a shell to keep the stdin open after the initial command finishes executing. Try to replace the command to launch xfce4-terminal to this:

On second thought, I think you should just pass the -H or --hold flag to xfce4-terminal to keep the terminal window open after the child process terminates. Try to replace the command to:

xfce4-terminal -T "Forecast" --hold --geometry=1280x800 -e "curl wttr.in/70531?u" 

I didn’t know the -H flag exists until I read through xfce4-terminal’s man page.

2 Likes

when I run your command in a terminal i get the same result as you. this is what it tells me at the command line

[Mon Feb 19 01:54:38]
This is the way
 thefrog@thepad:~🖝 xfce4-terminal -T “Forecast” --geometry=1280x800 -e “curl wttr.in/70531?u ; read”

(xfce4-terminal:16227): xfce4-terminal-WARNING **: 01:54:41.375: Failed to connect to session manager: Failed to connect to the session manager: SESSION_MANAGER environment variable not defined

I think you need to add in your command the shell
xfce4-terminal -T "Forecast" --geometry=1280x800 -x bash -c "curl wttr.in/70531?u ; read"
the above works fine at the command line

This works fine! I get the weather output and it and the terminal stays running until I close the terminal. Thanks so much, the hold flag was what was needed to make it stay running!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.