quickshell: auto expand some monitorItem on value changes (just being too lazy to write a popup : )

This commit is contained in:
2025-10-14 21:06:45 +02:00
parent fcf2dea615
commit c543ede263
6 changed files with 50 additions and 14 deletions

View File

@@ -36,29 +36,33 @@ Based on an old version of [end-4/dots-hyprland](https://github.com/end-4/dots-h
## Niri
Ported from Hyprland, and shares some of the desktop components such as hyprlock & hypridle & mako, but uses quickshell as bar and desktop-widgets instead of the combination of waybar and eww.
Ported from Hyprland, and shares some of the desktop components such as hyprlock & hypridle, but uses quickshell as bar / desktop widgets / notification daemon / ...
## Quickshell
Not based on, but heavily depends on modules from [noctalia-shell](https://github.com/noctalia-dev/noctalia-shell). This setup is currently only adapted for Niri.
Not based on, but heavily depends on many modules from [noctalia-shell](https://github.com/noctalia-dev/noctalia-shell). A thousand thanks to their great work.
This setup is currently only adapted for Niri.
## Eww
- `main`, main dashboard, modified from [syndrizzle/hotfiles](https://github.com/syndrizzle/hotfiles/tree/bspwm) without notification center.
- `lyrics`, scrolling lyrics player, depends on [a small program](https://github.com/Uyanide/spotify-lyrics) from myself <small>(which also happens to be my frist Golang program :D)</small>.
- `main`, main dashboard, modified from [syndrizzle/hotfiles](https://github.com/syndrizzle/hotfiles/tree/bspwm) but without notification center.
- `lyrics`, scrolling lyrics player, depends on [a small utility](https://github.com/Uyanide/spotify-lyrics) from myself <small>(which also happens to be my frist Golang program :D)</small>.
- `lyrics-single`, similar to `lyrics`, but only with a single line and can be easily embeded into the status bar.
## Swww
In Niri, the wallpaper will be automatically blurred when there are windows in focus. And the backdrop also has a blurred wallpaper applied to it. These are implemented in [wallpaper-daemon](https://github.com/Uyanide/dotfiles/blob/main/.scripts/wallpaper-daemon).
The wallpaper will be automatically blurred when there are windows in focus. And the backdrop (overview) also has a blurred version of the wallpaper applied to its background. These are implemented in [wallpaper-daemon](https://github.com/Uyanide/dotfiles/blob/main/.scripts/wallpaper-daemon).
This feature is only enabled in Niri. Swww also manages the wallpaper of the Hyprland setup, yet only in the regular way.
## Rofi
Based on [codeopshq/dotfiles](https://github.com/codeopshq/dotfiles), also serves as cliphist browser and emojis picker.
Based on [codeopshq/dotfiles](https://github.com/codeopshq/dotfiles), also serves as clipboard history browser and emoji picker.
## Grub theme
Based on [vinceliuice/Elegant-grub2-themes](https://github.com/vinceliuice/Elegant-grub2-themes) with the [illustration from 紺屋鴉江](https://www.pixiv.net/artworks/119683453).
Based on [vinceliuice/Elegant-grub2-themes](https://github.com/vinceliuice/Elegant-grub2-themes) with [illustration from 紺屋鴉江](https://www.pixiv.net/artworks/119683453).
## MPV

View File

@@ -2,8 +2,8 @@
"location": "Munich",
"notifications": {
"doNotDisturb": false,
"lastSeenTs": 1760397059000
"lastSeenTs": 1760464428000
},
"primaryColor": "#89b4fa",
"showLyricsBar": false
"showLyricsBar": true
}

View File

@@ -19,6 +19,7 @@ MonitorItem {
}
maxValue: 100
textSuffix: "%"
expandOnValueChange: true
onWheelUp: {
const monitor = getMonitor();
if (monitor)

View File

@@ -10,6 +10,7 @@ MonitorItem {
value: Math.round(AudioService.volume * 100)
maxValue: 100
textSuffix: "%"
expandOnValueChange: true
onWheelUp: {
AudioService.increaseVolume();
}

View File

@@ -14,7 +14,10 @@ Item {
property color fillColor: Colors.primary
property string textSuffix: ""
property bool pointerCursor: true
property alias hovered: mouseArea.containsMouse
property bool expandOnValueChange: false
property real hideTimeOut: 2000 // ms
property bool forceExpand: false
property bool _expand: forceExpand || mouseArea.containsMouse
property bool disableHover: false
property bool critical: false
property color criticalColor: Colors.red
@@ -27,7 +30,34 @@ Item {
signal rightClicked()
implicitHeight: parent.height - 5
implicitWidth: parent.height + (hovered ? textDisplay.width : 0)
implicitWidth: parent.height + (_expand ? textDisplay.width : 0)
Loader {
id: connectionLoader
active: expandOnValueChange
sourceComponent: Connections {
function onValueChanged() {
root.forceExpand = true;
hideTimer.restart();
}
target: root
}
}
Timer {
id: hideTimer
interval: parent.hideTimeOut
running: false
repeat: false
onTriggered: {
root.forceExpand = false;
}
}
MouseArea {
id: mouseArea
@@ -114,7 +144,7 @@ Item {
id: textDisplay
implicitHeight: parent.height
implicitWidth: root.hovered ? textLabel.implicitWidth + 10 : 0
implicitWidth: root._expand ? textLabel.implicitWidth + 10 : 0
clip: true
Text {
@@ -127,7 +157,7 @@ Item {
font.pointSize: Fonts.small
font.family: Fonts.primary
color: root.realColor
opacity: root.hovered ? 1 : 0
opacity: root._expand ? 1 : 0
}
Behavior on implicitWidth {

View File

@@ -11,7 +11,7 @@ Singleton {
id: process
running: true
command: ["sh", "-c", "kquitapp6 kded6"]
command: ["kquitapp6", "kded6"]
onExited: (code, status) => {
if (code !== 0)
Logger.warn("NukeKded6", `Failed to kill kded6: ${code}`);