forked from Shinonome/dots-hyprland
music controls: fix synced controls for different instances (#243)
This commit is contained in:
@@ -198,7 +198,7 @@ const TrackControls = ({ player, ...rest }) => Widget.Revealer({
|
|||||||
children: [
|
children: [
|
||||||
Button({
|
Button({
|
||||||
className: 'osd-music-controlbtn',
|
className: 'osd-music-controlbtn',
|
||||||
onClicked: () => execAsync('playerctl previous').catch(print),
|
onClicked: () => player.previous(),
|
||||||
child: Label({
|
child: Label({
|
||||||
className: 'icon-material osd-music-controlbtn-txt',
|
className: 'icon-material osd-music-controlbtn-txt',
|
||||||
label: 'skip_previous',
|
label: 'skip_previous',
|
||||||
@@ -206,9 +206,7 @@ const TrackControls = ({ player, ...rest }) => Widget.Revealer({
|
|||||||
}),
|
}),
|
||||||
Button({
|
Button({
|
||||||
className: 'osd-music-controlbtn',
|
className: 'osd-music-controlbtn',
|
||||||
onClicked: () => execAsync(['bash', '-c', 'playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"`'])
|
onClicked: () => player.next(),
|
||||||
.catch(print)
|
|
||||||
,
|
|
||||||
child: Label({
|
child: Label({
|
||||||
className: 'icon-material osd-music-controlbtn-txt',
|
className: 'icon-material osd-music-controlbtn-txt',
|
||||||
label: 'skip_next',
|
label: 'skip_next',
|
||||||
@@ -297,7 +295,7 @@ const PlayState = ({ player }) => {
|
|||||||
overlays: [
|
overlays: [
|
||||||
Widget.Button({
|
Widget.Button({
|
||||||
className: 'osd-music-playstate-btn',
|
className: 'osd-music-playstate-btn',
|
||||||
onClicked: () => execAsync('playerctl play-pause').catch(print),
|
onClicked: () => player.playPause(),
|
||||||
child: Widget.Label({
|
child: Widget.Label({
|
||||||
justification: 'center',
|
justification: 'center',
|
||||||
hpack: 'fill',
|
hpack: 'fill',
|
||||||
|
|||||||
Reference in New Issue
Block a user