Run a predefined external command upon download completion.
setting | value | description | version |
---|---|---|---|
command | string | command to execute (passed to the shell) | git master branch |
One might want to run an external program on episode download (refresh a player’s database or enqueue the episode, flash a red lamp, etc.). This extension makes it possible to execute any command, providing episode’s details as environment variables.
extensions.command_on_download.command
entry to the command you want to run.I advise you to write a wrapper script if the command is a bit long. You can also directly edit
$GPODDER_HOME/Settings.json
to refine your command.
Check the extension’s code for the most up to date list, but there are curently:
YYYY-MM-DD HH:mm
formatEnvironment variables are accessed with a dollar sign ($filename
) on Linux, or two percent signs (%filename%
) on Windows.
zenity --info --width=600 --text="file=$filename podcast=$podcast title=$title published=$published section=$section playlist_title=$playlist_title"
displays all variables in a dialog window (requires zenity).
python -c "import os;import gi; gi.require_version('Gtk', '3.0'); from gi.repository import Gtk; win = Gtk.Window(); l = Gtk.Label(label='{filename} downloaded'.format(**os.environ)); win.add(l); win.connect('delete-event', Gtk.main_quit); win.show_all(); Gtk.main()"
opens a window with the download path.
mpc add "$filename"