mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
61 lines
1.3 KiB
QML
61 lines
1.3 KiB
QML
import qs.modules.common
|
|
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Io
|
|
import Quickshell.Services.Pipewire
|
|
pragma Singleton
|
|
pragma ComponentBehavior: Bound
|
|
|
|
/**
|
|
* Handles EasyEffects active state and presets.
|
|
*/
|
|
Singleton {
|
|
id: root
|
|
|
|
property bool available: false
|
|
property bool active: false
|
|
|
|
function fetchAvailability() {
|
|
fetchAvailabilityProc.running = true
|
|
}
|
|
|
|
function fetchActiveState() {
|
|
fetchActiveStateProc.running = true
|
|
}
|
|
|
|
function disable() {
|
|
root.active = false
|
|
Quickshell.execDetached(["pkill", "easyeffects"])
|
|
}
|
|
|
|
function enable() {
|
|
root.active = true
|
|
Quickshell.execDetached(["easyeffects", "--gapplication-service"])
|
|
}
|
|
|
|
function toggle() {
|
|
if (root.active) {
|
|
root.disable()
|
|
} else {
|
|
root.enable()
|
|
}
|
|
}
|
|
|
|
Process {
|
|
id: fetchAvailabilityProc
|
|
running: true
|
|
command: ["bash", "-c", "command -v easyeffects"]
|
|
onExited: (exitCode, exitStatus) => {
|
|
root.available = exitCode === 0
|
|
}
|
|
}
|
|
|
|
Process {
|
|
id: fetchActiveStateProc
|
|
running: true
|
|
command: ["pidof", "easyeffects"]
|
|
onExited: (exitCode, exitStatus) => {
|
|
root.active = exitCode === 0
|
|
}
|
|
}
|
|
}
|