feat: Add support for side buttons mouse navigation in handleToggle
mapped buttons config on-click-backward and on-click-forward on mpris module to previous/next handle GTK codes are 9 and 8
This commit is contained in:
@ -14,7 +14,7 @@ extern "C" {
|
||||
|
||||
#include <glib.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include <fstream> // <-- agrega esta línea
|
||||
namespace waybar::modules::mpris {
|
||||
|
||||
const std::string DEFAULT_FORMAT = "{player} ({status}): {dynamic}";
|
||||
@ -614,6 +614,18 @@ bool Mpris::handleToggle(GdkEventButton* const& e) {
|
||||
}
|
||||
playerctl_player_next(player, &error);
|
||||
break;
|
||||
case 8: // side button mouse back on browser
|
||||
if (config_["on-click-backward"].isString()) {
|
||||
return ALabel::handleToggle(e);
|
||||
}
|
||||
playerctl_player_previous(player, &error);
|
||||
break;
|
||||
case 9: // side button mouse forward on browser
|
||||
if (config_["on-click-forward"].isString()) {
|
||||
return ALabel::handleToggle(e);
|
||||
}
|
||||
playerctl_player_next(player, &error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
|
Reference in New Issue
Block a user