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