This commit is contained in:
end-4
2024-03-17 00:45:49 +07:00
parent 5c097812ad
commit 03d3d3ed8a
+10 -8
View File
@@ -208,18 +208,20 @@ export default () => {
return EventBox({ return EventBox({
onScrollUp: (self) => switchToRelativeWorkspace(self, -1), onScrollUp: (self) => switchToRelativeWorkspace(self, -1),
onScrollDown: (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({ child: Box({
className: 'spacing-h-4', className: 'spacing-h-4',
children: [ children: [
SystemResourcesOrCustomModule(), 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)
}),
})
] ]
}) })
}); });