🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsHeader and Footer not showing in Excel(14.09.2026 um 22:43 Uhr)
🕵️ SicherheitslückenBurn Out, Or Fade Away(14.09.2026 um 14:25 Uhr)
🪟 Windows TippsKB5129194 Windows 11 26H1 Out of Band Update - Deskmodder.de(14.09.2026 um 19:25 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsHeader and Footer not showing in Excel(14.09.2026 um 22:43 Uhr)
🕵️ SicherheitslückenBurn Out, Or Fade Away(14.09.2026 um 14:25 Uhr)
🪟 Windows TippsKB5129194 Windows 11 26H1 Out of Band Update - Deskmodder.de(14.09.2026 um 19:25 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 3 Min Lesezeit
0

Displaying Python Script Outputs on Conky Panels

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

In this post, I'll demonstrate a simple way to display data from API requests directly on desktop panels using Python and Conky.






Objective



The goal is to fetch information from an API and show it on a desktop panel. For this example, I'll use Python for the API requests and Conky to create the panels.



We’ll fetch the Bitcoin exchange rates in USD and BRL using the









Python Script: btc_data.py



Below is the Python script that retrieves Bitcoin rates and formats the output for the Conky panel:




CODE
import requests

API_URL = "https://economia.awesomeapi.com.br/json/last/BTC-USD,BTC-BRL"

try:
response = requests.get(API_URL)
data = response.json()

btc_usd = data.get("BTCUSD", {})
btc_brl = data.get("BTCBRL", {})

usd_alta = f"$${float(btc_usd.get('high', 'N/A')):,.2f}"
usd_baixa = f"$${float(btc_usd.get('low', 'N/A')):,.2f}"

brl_alta = f"R$${float(btc_brl.get('high', 'N/A')):,.2f}"
brl_baixa = f"R$${float(btc_brl.get('low', 'N/A')):,.2f}"

formatted_data = (
"\n\n${color white}BTC - USD\n${color}${color green} High: ${color}${color white}"+usd_alta+"\n${color red} Low: ${color}${color white}"+usd_baixa+"\n\n"
"${color white}BTC - BRL\n${color}${color green} High: ${color}${color white}"+brl_alta+"\n${color red} Low: ${color}${color white}"+brl_baixa+"\n"
)

print(formatted_data)

except Exception as e:
print(e)













Conky Configuration: btc_ck.conf



Here’s the configuration file for Conky. It runs the Python script every hour (3600 seconds) and displays the formatted output:




CODE
conky.config = {
default_color = '#afafaf',
own_window = true,
own_window_type = 'normal',
own_window_transparent = true,
own_window_colour = '#000000',
own_window_hints = 'undecorated, skip_taskbar',
use_spacer = 'right',
border_inner_margin = 20,
alignment = 'middle_right',
use_xft = true,
double_buffer = true,
font = 'Monospace:size=8:style=semibold',
gap_x = 80,
update_interval = 1.0,
}

conky.text = [[
${image /home/.../bitcoin-btc-logo.png -n -p 50,1 -s 25x25}
${execpi 3600 python3 /home/.../btc_data.py}
]]










Key Points:




  • API Data: Fetching Bitcoin’s high and low prices in both USD and BRL.

  • Update Frequency: The panel updates every hour via the execpi function.

  • Styling: Some basic customization is applied to improve the panel’s appearance.









Running the Project




  • Save the Python script (btc_data.py) and the Conky configuration file (btc_ck.conf) in the desired directory.

  • Update the file paths in btc_ck.conf as needed (e.g., Python script location, Bitcoin logo image).

  • Start Conky with the configuration:




CODE
conky -c /path/to/btc_ck.conf


Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
The Gemini desktop app is now available for Windows
1 Quelle
Header and Footer not showing in Excel
1 Quelle
Burn Out, Or Fade Away
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Displaying Python Script Outputs on Conky Panels

Thematisch verwandte Begriffe: Displaying, Python, Script, Outputs · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...