diff options
Diffstat (limited to 'services')
| -rw-r--r-- | services/Colours.qml | 2 | ||||
| -rw-r--r-- | services/GameMode.qml | 76 | ||||
| -rw-r--r-- | services/Wallpapers.qml | 45 |
3 files changed, 1 insertions, 122 deletions
diff --git a/services/Colours.qml b/services/Colours.qml index d6f4812..cc07959 100644 --- a/services/Colours.qml +++ b/services/Colours.qml @@ -88,7 +88,7 @@ Singleton { ImageAnalyser { id: analyser - source: Wallpapers.current + source: Paths.wallpaper } component Transparency: QtObject { diff --git a/services/GameMode.qml b/services/GameMode.qml deleted file mode 100644 index 83770b7..0000000 --- a/services/GameMode.qml +++ /dev/null @@ -1,76 +0,0 @@ -pragma Singleton - -import qs.services -import qs.config -import Caelestia -import Quickshell -import Quickshell.Io -import QtQuick - -Singleton { - id: root - - property alias enabled: props.enabled - - function setDynamicConfs(): void { - Hypr.extras.applyOptions({ - "animations:enabled": 0, - "decoration:shadow:enabled": 0, - "decoration:blur:enabled": 0, - "general:gaps_in": 0, - "general:gaps_out": 0, - "general:border_size": 1, - "decoration:rounding": 0, - "general:allow_tearing": 1 - }); - } - - onEnabledChanged: { - if (enabled) { - setDynamicConfs(); - if (Config.utilities.toasts.gameModeChanged) - Toaster.toast(qsTr("Game mode enabled"), qsTr("Disabled Hyprland animations, blur, gaps and shadows"), "gamepad"); - } else { - Hypr.extras.message("reload"); - if (Config.utilities.toasts.gameModeChanged) - Toaster.toast(qsTr("Game mode disabled"), qsTr("Hyprland settings restored"), "gamepad"); - } - } - - PersistentProperties { - id: props - - property bool enabled: Hypr.options["animations:enabled"] === 0 - - reloadableId: "gameMode" - } - - Connections { - target: Hypr - - function onConfigReloaded(): void { - if (props.enabled) - root.setDynamicConfs(); - } - } - - IpcHandler { - target: "gameMode" - - function isEnabled(): bool { - return props.enabled; - } - - function toggle(): void { - props.enabled = !props.enabled; - } - - function enable(): void { - props.enabled = true; - } - - function disable(): void { - props.enabled = false; - } - } -} diff --git a/services/Wallpapers.qml b/services/Wallpapers.qml deleted file mode 100644 index 443b416..0000000 --- a/services/Wallpapers.qml +++ /dev/null @@ -1,45 +0,0 @@ -pragma Singleton - -import qs.config -import qs.utils -import Caelestia.Models -import Quickshell -import Quickshell.Io -import QtQuick - -Searcher { - id: root - - readonly property list<string> smartArg: Config.services.smartScheme ? [] : ["--no-smart"] - - property bool showPreview: false - readonly property string current: Paths.wallpaper - - function setWallpaper(path: string): void { - actualCurrent = path; - Quickshell.execDetached(["caelestia", "wallpaper", "-f", path, ...smartArg]); - } - - list: wallpapers.entries - key: "relativePath" - useFuzzy: Config.launcher.useFuzzy.wallpapers - extraOpts: useFuzzy ? ({}) : ({ - forward: false - }) - - IpcHandler { - target: "wallpaper" - - function get(): string { - return root.actualCurrent; - } - - function set(path: string): void { - root.setWallpaper(path); - } - - function list(): string { - return root.list.map(w => w.path).join("\n"); - } - } -} |