display weather info / arbitrary bash cmd via conky

Message
Author
fluxboxplus
Posts: 13
Joined: Tue Feb 25, 2025 7:42 am

display weather info / arbitrary bash cmd via conky

#1 Post by fluxboxplus »

Hi guys i was confronted with the problem of displaying the output of arbitrary bash commands in conky that is also commands with escape sequences in them like colored output.
After a lot of trying to get it running dynamically without a background tint (by trying to get alpha blending of the actual terminal content to work) i gave up on that and came up with a solution that at least works statically. The way it works is it takes a "screen shot" of the command output and then applies alpha-blending to the resulting image. That process is hidden by applying 100% alpha to the terminal window that captures the image via xwinwrap. That captured image is then displayed via conky (because feh, imagemagick's display etc did all fail to blend correctly).

TLDR: Bash-command -> image -> alpha blend -> conky.

For me it is usefull to display weather information fetched via curl from http://wttr.in/.

What to change / How to use:
You can change the "TERMINAL_SIZE" (screenshot size) in the file "display_conky_bash.sh" so it fits the output of your command.
You should change "SCRIPTDIR" to the location where you put the script in the file "display_conky_bash.sh".
You can change the command that is to be executed in the file command.sh.


Download:
link to example image: https://ibb.co/FQdBQZh
link to script: https://limewire.com/d/f66455b8-2d20-47 ... Fss4yqoQrs (will expire in 1 week)

Download via curl (supposedly no expiration upload service):

Code: Select all

curl -fsLS -o conky-bash.tar.gz --compressed https://summer-host-storage.yoursunny.dev/20c5d/219cb/conky-bash.tar.gz
In fluxbox startup file i run it like this:

Code: Select all

$HOME/.fluxbox/scripts/conky-bash/display_conky_bash.sh &
Maybe it is useful for some of you guys.
You do not have the required permissions to view the files attached to this post.
Last edited by fluxboxplus on Sat Mar 01, 2025 5:50 am, edited 5 times in total.

User avatar
DukeComposed
Posts: 1504
Joined: Thu Mar 16, 2023 1:57 pm

Re: display weather info / arbitrary bash cmd via conky

#2 Post by DukeComposed »

fluxboxplus wrote: Sat Mar 01, 2025 3:26 am For me it is usefull to display weather information fetched via curl from http://wttr.in/.
For minimalists, one can usually get a one-line weather summary from the same API with:

Code: Select all

curl "wttr.in/London?format=3"

Post Reply

Return to “Software / Configuration”