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 <glib.h>
|
||||||
#include <spdlog/spdlog.h>
|
#include <spdlog/spdlog.h>
|
||||||
|
#include <fstream> // <-- agrega esta línea
|
||||||
namespace waybar::modules::mpris {
|
namespace waybar::modules::mpris {
|
||||||
|
|
||||||
const std::string DEFAULT_FORMAT = "{player} ({status}): {dynamic}";
|
const std::string DEFAULT_FORMAT = "{player} ({status}): {dynamic}";
|
||||||
@ -614,6 +614,18 @@ bool Mpris::handleToggle(GdkEventButton* const& e) {
|
|||||||
}
|
}
|
||||||
playerctl_player_next(player, &error);
|
playerctl_player_next(player, &error);
|
||||||
break;
|
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) {
|
if (error) {
|
||||||
|
Reference in New Issue
Block a user