forked from Shinonome/dots-hyprland
right sidebar: add easyeffects toggle
This commit is contained in:
@@ -16,7 +16,7 @@ import Quickshell.Hyprland
|
|||||||
Scope {
|
Scope {
|
||||||
id: root
|
id: root
|
||||||
property int sidebarWidth: Appearance.sizes.sidebarWidth
|
property int sidebarWidth: Appearance.sizes.sidebarWidth
|
||||||
property int sidebarPadding: 15
|
property int sidebarPadding: 12
|
||||||
property string settingsQmlPath: Quickshell.configPath("settings.qml")
|
property string settingsQmlPath: Quickshell.configPath("settings.qml")
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
@@ -91,9 +91,9 @@ Scope {
|
|||||||
radius: Appearance.rounding.screenRounding - Appearance.sizes.hyprlandGapsOut + 1
|
radius: Appearance.rounding.screenRounding - Appearance.sizes.hyprlandGapsOut + 1
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: sidebarPadding
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: sidebarPadding
|
anchors.margins: sidebarPadding
|
||||||
|
spacing: sidebarPadding
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillHeight: false
|
Layout.fillHeight: false
|
||||||
@@ -177,6 +177,7 @@ Scope {
|
|||||||
GameMode {}
|
GameMode {}
|
||||||
IdleInhibitor {}
|
IdleInhibitor {}
|
||||||
CloudflareWarp {}
|
CloudflareWarp {}
|
||||||
|
EasyEffectsToggle {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Center widget group
|
// Center widget group
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ QuickToggleButton {
|
|||||||
source: 'cloudflare-dns-symbolic'
|
source: 'cloudflare-dns-symbolic'
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
width: 16
|
||||||
height: 16
|
height: 16
|
||||||
colorize: true
|
colorize: true
|
||||||
color: root.toggled ? Appearance.m3colors.m3onPrimary : Appearance.colors.colOnLayer1
|
color: root.toggled ? Appearance.m3colors.m3onPrimary : Appearance.colors.colOnLayer1
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
import qs.modules.common
|
||||||
|
import qs.modules.common.widgets
|
||||||
|
import qs
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
|
QuickToggleButton {
|
||||||
|
id: root
|
||||||
|
toggled: false
|
||||||
|
visible: false
|
||||||
|
buttonIcon: "instant_mix"
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if (toggled) {
|
||||||
|
root.toggled = false
|
||||||
|
Quickshell.execDetached(["pkill", "easyeffects"])
|
||||||
|
} else {
|
||||||
|
root.toggled = true
|
||||||
|
Quickshell.execDetached(["easyeffects", "--gapplication-service"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
altAction: () => {
|
||||||
|
Quickshell.execDetached(["easyeffects"])
|
||||||
|
Hyprland.dispatch("global quickshell:sidebarRightClose")
|
||||||
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: fetchAvailability
|
||||||
|
running: true
|
||||||
|
command: ["bash", "-c", "command -v easyeffects"]
|
||||||
|
onExited: (exitCode, exitStatus) => {
|
||||||
|
root.visible = exitCode === 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: fetchActiveState
|
||||||
|
running: true
|
||||||
|
command: ["pidof", "easyeffects"]
|
||||||
|
onExited: (exitCode, exitStatus) => {
|
||||||
|
root.toggled = exitCode === 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledToolTip {
|
||||||
|
content: Translation.tr("EasyEffects | Right-click to configure")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,7 +20,7 @@ QuickToggleButton {
|
|||||||
Process {
|
Process {
|
||||||
id: fetchActiveState
|
id: fetchActiveState
|
||||||
running: true
|
running: true
|
||||||
command: ["bash", "-c", "pidof wayland-idle-inhibitor.py"]
|
command: ["pidof", "wayland-idle-inhibitor.py"]
|
||||||
onExited: (exitCode, exitStatus) => {
|
onExited: (exitCode, exitStatus) => {
|
||||||
root.toggled = exitCode === 0
|
root.toggled = exitCode === 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import QtQuick
|
|||||||
GroupButton {
|
GroupButton {
|
||||||
id: button
|
id: button
|
||||||
property string buttonIcon
|
property string buttonIcon
|
||||||
baseWidth: altAction ? 60 : 40
|
baseWidth: 40
|
||||||
baseHeight: 40
|
baseHeight: 40
|
||||||
clickedWidth: baseWidth + 20
|
clickedWidth: baseWidth + 20
|
||||||
toggled: false
|
toggled: false
|
||||||
@@ -14,7 +14,7 @@ GroupButton {
|
|||||||
|
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
iconSize: Appearance.font.pixelSize.larger
|
iconSize: 20
|
||||||
fill: toggled ? 1 : 0
|
fill: toggled ? 1 : 0
|
||||||
color: toggled ? Appearance.m3colors.m3onPrimary : Appearance.colors.colOnLayer1
|
color: toggled ? Appearance.m3colors.m3onPrimary : Appearance.colors.colOnLayer1
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|||||||
Reference in New Issue
Block a user