FiXato / tui_launcher

A proof of concept for a TUI-based launcher written in Python using urwid
MIT License
3 stars 1 forks source link

Labels that auto-update their text based on the output of a command #4

Open FiXato opened 3 years ago

FiXato commented 3 years ago

A nice addition would be to have labels that rather than have a fixed text, use the output of a specified command as their displayed text. This would allow for displaying for example the nowplaying track underneath media control buttons.

Attached diff has some proof of concept that would update the header widget whenever a button is clicked, with the output of a command specified in Config.header_cmd.

update_header_on_click.diff.txt

FiXato commented 3 years ago

See also https://github.com/FiXato/tui_launcher/tree/feature-widget-command-labels

klundry commented 3 years ago

For current song display just a simple loop that executes a command at a specified interval might work better?

FiXato commented 3 years ago

For current song display just a simple loop that executes a command at a specified interval might work better?

but I don't really know how to supply a running urwid session with external input. :) And urwid itself seems to have its own main loop I'd need to hook into.

FiXato commented 3 years ago

Preliminary support added in 1ee28e91eab3e6eba430d26a8844c04d6e0d324f