Regenerated
This commit is contained in:
+503
-420
File diff suppressed because it is too large
Load Diff
+99
-16
@@ -3709,7 +3709,8 @@ ShellRoot {
|
|||||||
|
|
||||||
// ── State ──────────────────────────────────────────────────────────────
|
// ── State ──────────────────────────────────────────────────────────────
|
||||||
property string activeProfile: "balanced" // performance | balanced | powersave
|
property string activeProfile: "balanced" // performance | balanced | powersave
|
||||||
property bool lidClose: true
|
// lid mode: "suspend" | "ignore_external" | "ignore"
|
||||||
|
property string lidMode: "suspend"
|
||||||
property bool wifiPower: true
|
property bool wifiPower: true
|
||||||
property bool bluetoothOff: false
|
property bool bluetoothOff: false
|
||||||
property string statusMsg: ""
|
property string statusMsg: ""
|
||||||
@@ -3833,11 +3834,30 @@ ShellRoot {
|
|||||||
showStatus("Bluetooth " + (v ? "disabled" : "enabled"), true)
|
showStatus("Bluetooth " + (v ? "disabled" : "enabled"), true)
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleLid(v) {
|
function setLidMode(mode) {
|
||||||
lidClose = v
|
lidMode = mode
|
||||||
run(["bash", "-c",
|
// "suspend" = always suspend on lid close
|
||||||
"loginctl set-handle-lid-switch " + (v ? "suspend" : "ignore")])
|
// "ignore_external" = suspend normally, but ignore when ext monitor attached
|
||||||
showStatus("Lid close → " + (v ? "suspend" : "ignore"), true)
|
// "ignore" = never suspend on lid close
|
||||||
|
if (mode === "suspend") {
|
||||||
|
run(["bash", "-c",
|
||||||
|
"loginctl set-handle-lid-switch suspend && " +
|
||||||
|
"loginctl set-handle-lid-switch-external-power suspend"])
|
||||||
|
} else if (mode === "ignore_external") {
|
||||||
|
run(["bash", "-c",
|
||||||
|
"loginctl set-handle-lid-switch suspend && " +
|
||||||
|
"loginctl set-handle-lid-switch-external-power ignore"])
|
||||||
|
} else {
|
||||||
|
run(["bash", "-c",
|
||||||
|
"loginctl set-handle-lid-switch ignore && " +
|
||||||
|
"loginctl set-handle-lid-switch-external-power ignore"])
|
||||||
|
}
|
||||||
|
var labels = {
|
||||||
|
"suspend": "always suspend",
|
||||||
|
"ignore_external": "ignore when monitor attached",
|
||||||
|
"ignore": "never suspend"
|
||||||
|
}
|
||||||
|
showStatus("Lid close → " + labels[mode], true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Processes ──────────────────────────────────────────────────────────
|
// ── Processes ──────────────────────────────────────────────────────────
|
||||||
@@ -4042,11 +4062,9 @@ ShellRoot {
|
|||||||
// ── Toggles ─────────────────────────────────────────────
|
// ── Toggles ─────────────────────────────────────────────
|
||||||
SectionLabel { label: "Settings" }
|
SectionLabel { label: "Settings" }
|
||||||
|
|
||||||
ToggleRow {
|
LidModeRow {
|
||||||
label: "Suspend on lid close"
|
value: lidMode
|
||||||
icon: "💻"
|
onPicked: (m) => setLidMode(m)
|
||||||
checked: lidClose
|
|
||||||
onToggled: (v) => toggleLid(v)
|
|
||||||
}
|
}
|
||||||
ToggleRow {
|
ToggleRow {
|
||||||
label: "WiFi power saving"
|
label: "WiFi power saving"
|
||||||
@@ -4100,11 +4118,11 @@ ShellRoot {
|
|||||||
|
|
||||||
component SectionLabel: Text {
|
component SectionLabel: Text {
|
||||||
required property string label
|
required property string label
|
||||||
text: label.toUpperCase()
|
text: label.toUpperCase()
|
||||||
color: colors.overlay0
|
color: colors.overlay0
|
||||||
font.pixelSize: 10
|
font.pixelSize: 10
|
||||||
font.bold: true
|
font.bold: true
|
||||||
letterSpacing: 1.2
|
font.letterSpacing: 1.2
|
||||||
}
|
}
|
||||||
|
|
||||||
component ProfileButton: Rectangle {
|
component ProfileButton: Rectangle {
|
||||||
@@ -4289,6 +4307,71 @@ ShellRoot {
|
|||||||
onClicked: parent.clicked()
|
onClicked: parent.clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
component LidModeRow: ColumnLayout {
|
||||||
|
required property string value
|
||||||
|
signal picked(string m)
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: 6
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
spacing: 8
|
||||||
|
Text { text: "💻"; font.pixelSize: 14 }
|
||||||
|
Text {
|
||||||
|
text: "Lid close behaviour"
|
||||||
|
color: colors.subtext1
|
||||||
|
font.pixelSize: 12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: 6
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: [
|
||||||
|
{ key: "suspend", label: "Always suspend", icon: "💤" },
|
||||||
|
{ key: "ignore_external", label: "Ignore w/ monitor", icon: "🖥" },
|
||||||
|
{ key: "ignore", label: "Never suspend", icon: "🚫" }
|
||||||
|
]
|
||||||
|
delegate: Rectangle {
|
||||||
|
readonly property bool sel: value === modelData.key
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 44
|
||||||
|
radius: 8
|
||||||
|
color: sel ? Qt.rgba(colors.teal.r, colors.teal.g, colors.teal.b, 0.15) : colors.surface0
|
||||||
|
border.color: sel ? colors.teal : "transparent"
|
||||||
|
border.width: 1
|
||||||
|
|
||||||
|
Behavior on color { ColorAnimation { duration: 120 } }
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 1
|
||||||
|
Text {
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
text: modelData.icon
|
||||||
|
font.pixelSize: 14
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
text: modelData.label
|
||||||
|
color: sel ? colors.teal : colors.subtext0
|
||||||
|
font.pixelSize: 9
|
||||||
|
font.bold: sel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: picked(modelData.key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ ShellRoot {
|
|||||||
|
|
||||||
// ── State ──────────────────────────────────────────────────────────────
|
// ── State ──────────────────────────────────────────────────────────────
|
||||||
property string activeProfile: "balanced" // performance | balanced | powersave
|
property string activeProfile: "balanced" // performance | balanced | powersave
|
||||||
property bool lidClose: true
|
// lid mode: "suspend" | "ignore_external" | "ignore"
|
||||||
|
property string lidMode: "suspend"
|
||||||
property bool wifiPower: true
|
property bool wifiPower: true
|
||||||
property bool bluetoothOff: false
|
property bool bluetoothOff: false
|
||||||
property string statusMsg: ""
|
property string statusMsg: ""
|
||||||
@@ -171,11 +172,30 @@ ShellRoot {
|
|||||||
showStatus("Bluetooth " + (v ? "disabled" : "enabled"), true)
|
showStatus("Bluetooth " + (v ? "disabled" : "enabled"), true)
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleLid(v) {
|
function setLidMode(mode) {
|
||||||
lidClose = v
|
lidMode = mode
|
||||||
run(["bash", "-c",
|
// "suspend" = always suspend on lid close
|
||||||
"loginctl set-handle-lid-switch " + (v ? "suspend" : "ignore")])
|
// "ignore_external" = suspend normally, but ignore when ext monitor attached
|
||||||
showStatus("Lid close → " + (v ? "suspend" : "ignore"), true)
|
// "ignore" = never suspend on lid close
|
||||||
|
if (mode === "suspend") {
|
||||||
|
run(["bash", "-c",
|
||||||
|
"loginctl set-handle-lid-switch suspend && " +
|
||||||
|
"loginctl set-handle-lid-switch-external-power suspend"])
|
||||||
|
} else if (mode === "ignore_external") {
|
||||||
|
run(["bash", "-c",
|
||||||
|
"loginctl set-handle-lid-switch suspend && " +
|
||||||
|
"loginctl set-handle-lid-switch-external-power ignore"])
|
||||||
|
} else {
|
||||||
|
run(["bash", "-c",
|
||||||
|
"loginctl set-handle-lid-switch ignore && " +
|
||||||
|
"loginctl set-handle-lid-switch-external-power ignore"])
|
||||||
|
}
|
||||||
|
var labels = {
|
||||||
|
"suspend": "always suspend",
|
||||||
|
"ignore_external": "ignore when monitor attached",
|
||||||
|
"ignore": "never suspend"
|
||||||
|
}
|
||||||
|
showStatus("Lid close → " + labels[mode], true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Processes ──────────────────────────────────────────────────────────
|
// ── Processes ──────────────────────────────────────────────────────────
|
||||||
@@ -380,11 +400,9 @@ ShellRoot {
|
|||||||
// ── Toggles ─────────────────────────────────────────────
|
// ── Toggles ─────────────────────────────────────────────
|
||||||
SectionLabel { label: "Settings" }
|
SectionLabel { label: "Settings" }
|
||||||
|
|
||||||
ToggleRow {
|
LidModeRow {
|
||||||
label: "Suspend on lid close"
|
value: lidMode
|
||||||
icon: "💻"
|
onPicked: (m) => setLidMode(m)
|
||||||
checked: lidClose
|
|
||||||
onToggled: (v) => toggleLid(v)
|
|
||||||
}
|
}
|
||||||
ToggleRow {
|
ToggleRow {
|
||||||
label: "WiFi power saving"
|
label: "WiFi power saving"
|
||||||
@@ -438,11 +456,11 @@ ShellRoot {
|
|||||||
|
|
||||||
component SectionLabel: Text {
|
component SectionLabel: Text {
|
||||||
required property string label
|
required property string label
|
||||||
text: label.toUpperCase()
|
text: label.toUpperCase()
|
||||||
color: colors.overlay0
|
color: colors.overlay0
|
||||||
font.pixelSize: 10
|
font.pixelSize: 10
|
||||||
font.bold: true
|
font.bold: true
|
||||||
letterSpacing: 1.2
|
font.letterSpacing: 1.2
|
||||||
}
|
}
|
||||||
|
|
||||||
component ProfileButton: Rectangle {
|
component ProfileButton: Rectangle {
|
||||||
@@ -627,4 +645,69 @@ ShellRoot {
|
|||||||
onClicked: parent.clicked()
|
onClicked: parent.clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
component LidModeRow: ColumnLayout {
|
||||||
|
required property string value
|
||||||
|
signal picked(string m)
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: 6
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
spacing: 8
|
||||||
|
Text { text: "💻"; font.pixelSize: 14 }
|
||||||
|
Text {
|
||||||
|
text: "Lid close behaviour"
|
||||||
|
color: colors.subtext1
|
||||||
|
font.pixelSize: 12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: 6
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: [
|
||||||
|
{ key: "suspend", label: "Always suspend", icon: "💤" },
|
||||||
|
{ key: "ignore_external", label: "Ignore w/ monitor", icon: "🖥" },
|
||||||
|
{ key: "ignore", label: "Never suspend", icon: "🚫" }
|
||||||
|
]
|
||||||
|
delegate: Rectangle {
|
||||||
|
readonly property bool sel: value === modelData.key
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 44
|
||||||
|
radius: 8
|
||||||
|
color: sel ? Qt.rgba(colors.teal.r, colors.teal.g, colors.teal.b, 0.15) : colors.surface0
|
||||||
|
border.color: sel ? colors.teal : "transparent"
|
||||||
|
border.width: 1
|
||||||
|
|
||||||
|
Behavior on color { ColorAnimation { duration: 120 } }
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 1
|
||||||
|
Text {
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
text: modelData.icon
|
||||||
|
font.pixelSize: 14
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
text: modelData.label
|
||||||
|
color: sel ? colors.teal : colors.subtext0
|
||||||
|
font.pixelSize: 9
|
||||||
|
font.bold: sel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: picked(modelData.key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user