[scripts/playerctl-simple-menu] add a button for playing the track from start

This commit is contained in:
Dmytro Meleshko 2020-10-22 19:46:01 +03:00
parent 7db0c34bca
commit 40dec8d6da

View file

@ -81,7 +81,7 @@ def iter_actions_for_player(player):
player.next, player.next,
) )
yield ( yield (
"_Previous", "P_revious",
"media-skip-backward", "media-skip-backward",
player.props.can_go_previous, player.props.can_go_previous,
player.previous, player.previous,
@ -101,16 +101,21 @@ def iter_actions_for_player(player):
("Loop _one", Playerctl.LoopStatus.TRACK), ("Loop _one", Playerctl.LoopStatus.TRACK),
("Loop _all", Playerctl.LoopStatus.PLAYLIST), ("Loop _all", Playerctl.LoopStatus.PLAYLIST),
]: ]:
if loop_action_status == loop_status:
continue
yield ( yield (
loop_action_name, loop_action_name,
"media-playlist-repeat", "media-playlist-repeat",
True, loop_action_status != loop_status,
lambda loop_action_status: player.set_loop_status(loop_action_status), lambda loop_action_status: player.set_loop_status(loop_action_status),
loop_action_status, loop_action_status,
) )
yield (
"Play a_gain",
"go-first",
player.props.can_seek,
lambda: player.set_position(0),
)
root_menu = Gtk.Menu() root_menu = Gtk.Menu()