mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
resolved a probleme between upower and quickshell
This commit is contained in:
@@ -2,34 +2,7 @@ pragma Singleton
|
|||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
/*readonly property var getThemeProc: Process {
|
|
||||||
running: true
|
|
||||||
command: ["gsettings", "get", "org.gnome.desktop.interface", "color-scheme"]
|
|
||||||
stdout: SplitParser {
|
|
||||||
onRead: data => root.isDarkTheme = data == "'prefer-dark'"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
property var isDarkTheme: false
|
|
||||||
readonly property var kittenThemeProc: Process {
|
|
||||||
command: ["kitten", "theme", "--reload-in=all", `"Gruvbox ${root.isDarkTheme ? "Dark" : "Light"} Soft"`]
|
|
||||||
}
|
|
||||||
readonly property var gtk4ThemeProc: Process {
|
|
||||||
command: ["gsettings", "set", "org.gnome.desktop.interface", "color-scheme", `"prefer-${root.isDarkTheme ? "dark" : "light"}"`]
|
|
||||||
}
|
|
||||||
readonly property var gtk3ThemeProc: Process {
|
|
||||||
command: ["gsettings", "set", "org.gnome.desktop.interface", "gtk-theme", `"Adwaita${root.isDarkTheme ? "-dark" : ""}"`]
|
|
||||||
}
|
|
||||||
onIsDarkThemeChanged: () => {
|
|
||||||
kittenThemeProc.command = ["kitten", "theme", "--reload-in=all", `Gruvbox ${root.isDarkTheme ? "Dark" : "Light"} Soft`];
|
|
||||||
kittenThemeProc.running = true;
|
|
||||||
gtk4ThemeProc.command = ["gsettings", "set", "org.gnome.desktop.interface", "color-scheme", `"prefer-${root.isDarkTheme ? "dark" : "light"}"`];
|
|
||||||
gtk4ThemeProc.running = true;
|
|
||||||
gtk3ThemeProc.command = ["gsettings", "set", "org.gnome.desktop.interface", "gtk-theme", `"Adwaita${root.isDarkTheme ? "-dark" : ""}"`];
|
|
||||||
gtk3ThemeProc.running = true;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Item {
|
|||||||
readonly property bool isPluggedIn: isCharging || chargeState == UPowerDeviceState.PendingCharge
|
readonly property bool isPluggedIn: isCharging || chargeState == UPowerDeviceState.PendingCharge
|
||||||
readonly property real percentage: UPower.displayDevice.percentage
|
readonly property real percentage: UPower.displayDevice.percentage
|
||||||
readonly property bool isLow: percentage <= 0.20
|
readonly property bool isLow: percentage <= 0.20
|
||||||
readonly property bool isLaptop: UPowerDevice.isLaptopBattery
|
readonly property bool isLaptop: true // hardcoded because this doesnt work UPowerDevice.isLaptopBattery
|
||||||
width: 32
|
width: 32
|
||||||
height: 32
|
height: 32
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import "../"
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
implicitWidth: 26
|
|
||||||
implicitHeight: 26
|
|
||||||
|
|
||||||
hoverEnabled: true
|
|
||||||
acceptedButtons: Qt.LeftButton
|
|
||||||
|
|
||||||
Image {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: `../assets/${Globals.isDarkTheme ? "sun" : "moon"}.png`
|
|
||||||
smooth: false
|
|
||||||
|
|
||||||
scale: root.containsMouse ? 0.9 : 1
|
|
||||||
Behavior on scale {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 70
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onPressed: () => {
|
|
||||||
Globals.isDarkTheme = !Globals.isDarkTheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user