forked from Shinonome/dots-hyprland
fix #329
This commit is contained in:
@@ -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)
|
||||||
|
}),
|
||||||
|
})
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user