audacious-media-player / audacious

A lightweight and versatile audio player
https://audacious-media-player.org
Other
871 stars 115 forks source link

[4.3.1 GTK] Global hotkeys plugin crash on enable when using Wayland #1388

Closed FM33 closed 5 months ago

FM33 commented 5 months ago

Describe the bug Global hotkeys plugin crash on enable.

Steps to reproduce Open preferences, plugins, check global hotkeys

Additional information

radioactiveman commented 5 months ago

The Global Hotkeys plugin relies on X11. It does not and will not work with Wayland. You can start Audacious via XWayland with GDK_BACKEND=x11 audacious.

The plugin should not crash though. We should implement a check to avoid this.

FM33 commented 5 months ago

Thanks for your reply. Unfortunately, they work only when audacious has focus. I worked around some by assigning commands from audacious --help to gnome settings shortcuts, but it's missing seeking back/forward and volume.

radioactiveman commented 5 months ago

audtool supports more commands, also seeking and changing the volume.

FM33 commented 5 months ago

Perfect, many thanks. I wrote a few-line script to workaround the lack of relative volume setting:

#!/bin/bash

actualvol=$(audtool get-volume)
newvol=$actualvol

if [ "$1" = "up" ]; then
   newvol=$(($actualvol+5))
fi

if [ "$1" = "down" ]; then
   newvol=$(($actualvol-5))
fi

audtool set-volume $newvol
exit 0

If anyone is interested, I noticed that gnome shortcuts doesn't recognize "~" variable for home folder. It needs to be plain path:

/home/user/script_name up
/home/user/script_name down
radioactiveman commented 5 months ago

The Global Hotkeys plugin relies on X11. It does not and will not work with Wayland. You can start Audacious via XWayland with GDK_BACKEND=x11 audacious.

The plugin should not crash though. We should implement a check to avoid this.

Implemented with https://github.com/audacious-media-player/audacious-plugins/commit/08c2f6a8e6bd48eddecca914c5d063592519b642. Thanks for reporting.