fix: prevent quickshell widget stealing focus (#296)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# cliamp quickshell widget
|
# cliamp quickshell widget
|
||||||
|
|
||||||
A compact "now playing" card for [Quickshell](https://quickshell.org) (300 x 72), centered along the bottom of every screen and driven by cliamp's MPRIS service (`org.mpris.MediaPlayer2.cliamp`). Two-row layout: title + time on top, artist + transport on the second row, a 10-band Winamp 2-style spectrum below, and a thin click-to-seek line at the bottom. Colors are picked up from the active Omarchy theme (`~/.config/omarchy/current/theme/colors.toml`) and update live when the theme changes. Hides itself when cliamp is not running. Click the card and press Esc or Q to quit the widget.
|
A compact "now playing" card for [Quickshell](https://quickshell.org) (300 x 72), centered along the bottom of every screen and driven by cliamp's MPRIS service (`org.mpris.MediaPlayer2.cliamp`). Two-row layout: title + time on top, artist + transport on the second row, a 10-band Winamp 2-style spectrum below, and a thin click-to-seek line at the bottom. Colors are picked up from the active Omarchy theme (`~/.config/omarchy/current/theme/colors.toml`) and update live when the theme changes. Hides itself when cliamp is not running. The card accepts mouse input for playback controls and seeking, but never takes keyboard focus from the active application.
|
||||||
|
|
||||||
Linux only. Requires Quickshell 0.2+ and cliamp running with its default MPRIS service enabled (it is by default on Linux).
|
Linux only. Requires Quickshell 0.2+ and cliamp running with its default MPRIS service enabled (it is by default on Linux).
|
||||||
|
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ Scope {
|
|||||||
|
|
||||||
exclusionMode: ExclusionMode.Ignore
|
exclusionMode: ExclusionMode.Ignore
|
||||||
|
|
||||||
// Take keyboard focus on demand so the user can press Esc/Q to
|
// A now-playing overlay must not steal keyboard focus from the
|
||||||
// dismiss the widget. Focus is acquired when the card is clicked.
|
// active application when it appears or is clicked.
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
||||||
|
|
||||||
implicitHeight: 72
|
implicitHeight: 72
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
@@ -54,10 +54,6 @@ Scope {
|
|||||||
height: parent.height
|
height: parent.height
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
player: root.cliampPlayer
|
player: root.cliampPlayer
|
||||||
focus: true
|
|
||||||
Keys.onPressed: (e) => {
|
|
||||||
if (e.key === Qt.Key_Escape || e.key === Qt.Key_Q) Qt.quit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user