Skip to content

Commit

Permalink
Merge pull request #2 from victorheld/patch-1
Browse files Browse the repository at this point in the history
Added random command
  • Loading branch information
Marco98 authored Apr 20, 2018
2 parents c59fd11 + 0ed006e commit fef5bd0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rofi-mpc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if not current:
current = "Nothing is currently Playing"
else:
current = "Currently Playing: "+current.rstrip()
commands = b"List\nPlay/Pause\nNext\nPrev\nVolume 25%\nVolume 35%\nVolume 50%\nVolume 75%\nVolume 100%"
commands = b"List\nPlay/Pause\nNext\nPrev\nRandom\nVolume 25%\nVolume 35%\nVolume 50%\nVolume 75%\nVolume 100%"
rofi = Popen(["rofi", "-selected-row", "1", "-mesg", current, "-i", "-dmenu", "-p", "MPC: "], stdout=PIPE, stdin=PIPE)
tmp = rofi.communicate(input=commands)[0].decode().rstrip()
if tmp == "Play/Pause":
Expand All @@ -19,6 +19,8 @@ if tmp == "Next":
check_call(["mpc", "next"])
if tmp == "Prev":
check_call(["mpc", "prev"])
if tmp == "Random":
check_call(["mpc", "random"])
if tmp == "Volume 25%":
check_call(["mpc", "volume", "25"])
if tmp == "Volume 35%":
Expand Down

0 comments on commit fef5bd0

Please sign in to comment.