Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Press and hold the play-pause key to go back to the beginning of the song #5

Open
tkna91 opened this issue Feb 19, 2023 · 3 comments
Open

Comments

@tkna91
Copy link

tkna91 commented Feb 19, 2023

Sorry if this is my mistake.

The following settings are made on sway.

~/.config/sway/config

bindsym XF86AudioPlay exec playerctl play-pause

When I press and hold the XF86AudioPlay key, it takes me back to the beginning of the song.
When I am transcribing text with the footswitch, I tend to press and hold the key, so is there any way to stop this behavior of going back to the beginning of the song?

(Screencast with audio)

20230219-174545_screencast-audioin.mp4

OS,Version:

  • OS: Arch Linux x86_64
  • Kernel: 6.1.10-arch1-1
  • WM: sway
$ paru -Qs deadbeef
local/deadbeef-git r11279.81150a9d4-1
    A GTK+ audio player for GNU/Linux (devel branch)
local/deadbeef-jack-git 10.62d1e6a-1
    jack plugin for the DeaDBeeF music player
local/deadbeef-mpris2-plugin 1.16-1
    MPRISv2 plugin for the DeaDBeeF music player
local/deadbeef-plugin-fb-gtk3-git r166.g355e614-3
    A filebrowser plugin for the DeaDBeeF audio player
local/deadbeef-plugin-waveform-gtk3-git 0.5.r91.g4afd845-1
    Waveform Seekbar plugin for DeaDBeeF audio player GTK3
$
@Oleksiy-Yakovenko
Copy link
Member

What behavior do you expect when you press and hold this key?

@Oleksiy-Yakovenko
Copy link
Member

You can insert a delay after the "playerctl play-pause", e.g. by calling sleep.
This would reduce the chance of race condition happening. But I'm not sure whether it would give you the result that you want.

@tkna91
Copy link
Author

tkna91 commented Feb 21, 2023

You can insert a delay after the "playerctl play-pause", e.g. by calling sleep.

I was able to make it work that way by doing the following settings. Thanks.

bindsym XF86AudioPlay exec flock --nonblock /run/user/$UID/playerctl-play-pause.lock --command "playerctl play-pause ; sleep 0.1"

(screencast with audio)

20230221-105927_screencast-audioin.mp4

What behavior do you expect when you press and hold this key?

It seems to me that you are probably correct that it just repeats play-pause and does not go back to the beginning of the song.

https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Method:PlayPause

I repeated play-pause against the YouTube player in the browser and that seems to be the behavior.

(screencast with audio)

20230221-110657_screencast-audioin.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants