Support next/previous in audioPlayer
Signed-off-by: AKP <tom@tdpain.net>
This commit is contained in:
parent
b65a148b60
commit
5c7c87d911
1 changed files with 9 additions and 2 deletions
|
@ -154,10 +154,17 @@ func (g *AudioPlayer) GetNameAndInstance() (string, string) {
|
|||
}
|
||||
|
||||
func (g *AudioPlayer) OnClick(event *i3bar.ClickEvent) bool {
|
||||
if event.Button != i3bar.LeftMouseButton {
|
||||
switch event.Button {
|
||||
case i3bar.LeftMouseButton:
|
||||
_, _ = runCommand(playerctlExecutable, "play-pause")
|
||||
case i3bar.MouseWheelScrollUp:
|
||||
_, _ = runCommand(playerctlExecutable, "next")
|
||||
case i3bar.MouseWheelScrollDown:
|
||||
_, _ = runCommand(playerctlExecutable, "previous")
|
||||
default:
|
||||
return false
|
||||
}
|
||||
_, _ = runCommand(playerctlExecutable, "play-pause")
|
||||
|
||||
time.Sleep(time.Millisecond * 50)
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue