diff --git a/rofi_mpd/config.py b/rofi_mpd/config.py index eafb977..a2e74f0 100644 --- a/rofi_mpd/config.py +++ b/rofi_mpd/config.py @@ -11,6 +11,7 @@ def load_default(): enable_disc_names=True, tracks_keep_open=True, discs_keep_open=True, + play_on_add=False, hosts=[ dict( host='localhost', diff --git a/rofi_mpd/rofi_mpd.py b/rofi_mpd/rofi_mpd.py index 45fab79..8502eb1 100755 --- a/rofi_mpd/rofi_mpd.py +++ b/rofi_mpd/rofi_mpd.py @@ -220,3 +220,7 @@ def run(): else: client.add(track['file']) + + if 'play_on_add' in config and config['play_on_add']: + if client.status()['state'] != 'play': + client.play()