fixed a small problem when mpd deamon gets lunched on first executin from i3blocks without any interaction
This commit is contained in:
parent
41c2b1c3bf
commit
f8707672a0
|
@ -31,13 +31,14 @@ def main():
|
||||||
client.connect("localhost", 6600)
|
client.connect("localhost", 6600)
|
||||||
except ConnectionRefusedError:
|
except ConnectionRefusedError:
|
||||||
# mpd is not connecting, try to start
|
# mpd is not connecting, try to start
|
||||||
output = subprocess.run(["mpd"], capture_output=True)
|
if mpc_command == 'toggle':
|
||||||
if output.returncode == 0:
|
output = subprocess.run(["mpd"], capture_output=True)
|
||||||
# connect
|
if output.returncode == 0:
|
||||||
client.connect("localhost", 6600)
|
# connect
|
||||||
else:
|
client.connect("localhost", 6600)
|
||||||
# that failed, all is lost
|
else:
|
||||||
return
|
# that failed, all is lost
|
||||||
|
return
|
||||||
# follow mpc_command
|
# follow mpc_command
|
||||||
if mpc_command == 'toggle':
|
if mpc_command == 'toggle':
|
||||||
mpd_playback.toggle(client, signal_id)
|
mpd_playback.toggle(client, signal_id)
|
||||||
|
|
Loading…
Reference in New Issue