From cff91628bc746b3f671cfc5afbd374d2254eeb79 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 17 Mar 2024 00:45:49 +0700 Subject: [PATCH] fix #329 --- .config/ags/modules/bar/normal/music.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.config/ags/modules/bar/normal/music.js b/.config/ags/modules/bar/normal/music.js index ea9c35404..3879fafd4 100644 --- a/.config/ags/modules/bar/normal/music.js +++ b/.config/ags/modules/bar/normal/music.js @@ -208,18 +208,20 @@ export default () => { return EventBox({ onScrollUp: (self) => switchToRelativeWorkspace(self, -1), onScrollDown: (self) => switchToRelativeWorkspace(self, +1), - onPrimaryClick: () => showMusicControls.setValue(!showMusicControls.value), - onSecondaryClick: () => execAsync(['bash', '-c', 'playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"` &']).catch(print), - onMiddleClick: () => execAsync('playerctl play-pause').catch(print), - setup: (self) => self.on('button-press-event', (self, event) => { - if (event.get_button()[1] === 8) // Side button - execAsync('playerctl previous').catch(print) - }), child: Box({ className: 'spacing-h-4', children: [ SystemResourcesOrCustomModule(), - BarGroup({ child: musicStuff }), + EventBox({ + child: BarGroup({ child: musicStuff }), + onPrimaryClick: () => showMusicControls.setValue(!showMusicControls.value), + onSecondaryClick: () => execAsync(['bash', '-c', 'playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"` &']).catch(print), + onMiddleClick: () => execAsync('playerctl play-pause').catch(print), + setup: (self) => self.on('button-press-event', (self, event) => { + if (event.get_button()[1] === 8) // Side button + execAsync('playerctl previous').catch(print) + }), + }) ] }) });