mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Hooks/CustomButton: switch back to sh -lc
This commit is contained in:
@@ -460,7 +460,7 @@ Item {
|
||||
|
||||
function clicked() {
|
||||
if (leftClickExec) {
|
||||
Quickshell.execDetached(["sh", "-c", leftClickExec]);
|
||||
Quickshell.execDetached(["sh", "-lc", leftClickExec]);
|
||||
Logger.i("CustomButton", `Executing command: ${leftClickExec}`);
|
||||
} else if (!leftClickUpdateText) {
|
||||
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
|
||||
@@ -473,7 +473,7 @@ Item {
|
||||
|
||||
function rightClicked() {
|
||||
if (rightClickExec) {
|
||||
Quickshell.execDetached(["sh", "-c", rightClickExec]);
|
||||
Quickshell.execDetached(["sh", "-lc", rightClickExec]);
|
||||
Logger.i("CustomButton", `Executing command: ${rightClickExec}`);
|
||||
}
|
||||
if (!textStream && rightClickUpdateText) {
|
||||
@@ -483,7 +483,7 @@ Item {
|
||||
|
||||
function middleClicked() {
|
||||
if (middleClickExec) {
|
||||
Quickshell.execDetached(["sh", "-c", middleClickExec]);
|
||||
Quickshell.execDetached(["sh", "-lc", middleClickExec]);
|
||||
Logger.i("CustomButton", `Executing command: ${middleClickExec}`);
|
||||
}
|
||||
if (!textStream && middleClickUpdateText) {
|
||||
@@ -512,7 +512,7 @@ Item {
|
||||
return;
|
||||
if (textProc.running)
|
||||
return;
|
||||
textProc.command = ["sh", "-c", textCommand];
|
||||
textProc.command = ["sh", "-lc", textCommand];
|
||||
textProc.running = true;
|
||||
}
|
||||
|
||||
@@ -554,7 +554,7 @@ Item {
|
||||
}
|
||||
});
|
||||
|
||||
Quickshell.execDetached(["sh", "-c", command]);
|
||||
Quickshell.execDetached(["sh", "-lc", command]);
|
||||
Logger.i("CustomButton", `Executing command: ${command}`);
|
||||
} else if (wheelMode === "separate") {
|
||||
if ((delta > 0 && wheelUpExec) || (delta < 0 && wheelDownExec)) {
|
||||
@@ -595,7 +595,7 @@ Item {
|
||||
}
|
||||
});
|
||||
|
||||
Quickshell.execDetached(["sh", "-c", command]);
|
||||
Quickshell.execDetached(["sh", "-lc", command]);
|
||||
Logger.i("CustomButton", `Executing command: ${command}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ Item {
|
||||
Process {
|
||||
id: stateCheckProcessExecutor
|
||||
running: false
|
||||
command: _currentStateCheckIndex !== -1 && _parsedStateChecks.length > _currentStateCheckIndex ? ["sh", "-c", _parsedStateChecks[_currentStateCheckIndex].command] : []
|
||||
command: _currentStateCheckIndex !== -1 && _parsedStateChecks.length > _currentStateCheckIndex ? ["sh", "-lc", _parsedStateChecks[_currentStateCheckIndex].command] : []
|
||||
onExited: function (exitCode, stdout, stderr) {
|
||||
var currentCheckItem = _parsedStateChecks[_currentStateCheckIndex];
|
||||
var currentCommand = currentCheckItem.command;
|
||||
@@ -141,19 +141,19 @@ Item {
|
||||
tooltipText: _buildTooltipText()
|
||||
onClicked: {
|
||||
if (onClickedCommand) {
|
||||
Quickshell.execDetached(["sh", "-c", onClickedCommand]);
|
||||
Quickshell.execDetached(["sh", "-lc", onClickedCommand]);
|
||||
updateState();
|
||||
}
|
||||
}
|
||||
onRightClicked: {
|
||||
if (onRightClickedCommand) {
|
||||
Quickshell.execDetached(["sh", "-c", onRightClickedCommand]);
|
||||
Quickshell.execDetached(["sh", "-lc", onRightClickedCommand]);
|
||||
updateState();
|
||||
}
|
||||
}
|
||||
onMiddleClicked: {
|
||||
if (onMiddleClickedCommand) {
|
||||
Quickshell.execDetached(["sh", "-c", onMiddleClickedCommand]);
|
||||
Quickshell.execDetached(["sh", "-lc", onMiddleClickedCommand]);
|
||||
updateState();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ ColumnLayout {
|
||||
Settings.saveImmediate();
|
||||
}, val => {
|
||||
if (val)
|
||||
Quickshell.execDetached(["sh", "-c", val.replace("$1", "test_wallpaper_path").replace("$2", "test_screen")]);
|
||||
Quickshell.execDetached(["sh", "-lc", val.replace("$1", "test_wallpaper_path").replace("$2", "test_screen")]);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ ColumnLayout {
|
||||
Settings.saveImmediate();
|
||||
}, val => {
|
||||
if (val)
|
||||
Quickshell.execDetached(["sh", "-c", val.replace("$1", "true")]);
|
||||
Quickshell.execDetached(["sh", "-lc", val.replace("$1", "true")]);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ ColumnLayout {
|
||||
Settings.saveImmediate();
|
||||
}, val => {
|
||||
if (val)
|
||||
Quickshell.execDetached(["sh", "-c", val]);
|
||||
Quickshell.execDetached(["sh", "-lc", val]);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ ColumnLayout {
|
||||
Settings.saveImmediate();
|
||||
}, val => {
|
||||
if (val)
|
||||
Quickshell.execDetached(["sh", "-c", val]);
|
||||
Quickshell.execDetached(["sh", "-lc", val]);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ ColumnLayout {
|
||||
Settings.saveImmediate();
|
||||
}, val => {
|
||||
if (val)
|
||||
Quickshell.execDetached(["sh", "-c", val]);
|
||||
Quickshell.execDetached(["sh", "-lc", val]);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ ColumnLayout {
|
||||
Settings.saveImmediate();
|
||||
}, val => {
|
||||
if (val)
|
||||
Quickshell.execDetached(["sh", "-c", val]);
|
||||
Quickshell.execDetached(["sh", "-lc", val]);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ ColumnLayout {
|
||||
Settings.saveImmediate();
|
||||
}, val => {
|
||||
if (val)
|
||||
Quickshell.execDetached(["sh", "-c", val + " test"]);
|
||||
Quickshell.execDetached(["sh", "-lc", val + " test"]);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ Singleton {
|
||||
try {
|
||||
let command = script.replace(/\$1/g, wallpaperPath);
|
||||
command = command.replace(/\$2/g, screenName || "");
|
||||
Quickshell.execDetached(["sh", "-c", command]);
|
||||
Quickshell.execDetached(["sh", "-lc", command]);
|
||||
Logger.d("HooksService", `Executed wallpaper hook: ${command}`);
|
||||
} catch (e) {
|
||||
Logger.e("HooksService", `Failed to execute wallpaper hook: ${e}`);
|
||||
@@ -140,7 +140,7 @@ Singleton {
|
||||
|
||||
try {
|
||||
const command = script.replace(/\$1/g, isDarkMode ? "true" : "false");
|
||||
Quickshell.execDetached(["sh", "-c", command]);
|
||||
Quickshell.execDetached(["sh", "-lc", command]);
|
||||
Logger.d("HooksService", `Executed dark mode hook: ${command}`);
|
||||
} catch (e) {
|
||||
Logger.e("HooksService", `Failed to execute dark mode hook: ${e}`);
|
||||
@@ -159,7 +159,7 @@ Singleton {
|
||||
}
|
||||
|
||||
try {
|
||||
Quickshell.execDetached(["sh", "-c", script]);
|
||||
Quickshell.execDetached(["sh", "-lc", script]);
|
||||
Logger.d("HooksService", `Executed screen lock hook: ${script}`);
|
||||
} catch (e) {
|
||||
Logger.e("HooksService", `Failed to execute screen lock hook: ${e}`);
|
||||
@@ -178,7 +178,7 @@ Singleton {
|
||||
}
|
||||
|
||||
try {
|
||||
Quickshell.execDetached(["sh", "-c", script]);
|
||||
Quickshell.execDetached(["sh", "-lc", script]);
|
||||
Logger.d("HooksService", `Executed screen unlock hook: ${script}`);
|
||||
} catch (e) {
|
||||
Logger.e("HooksService", `Failed to execute screen unlock hook: ${e}`);
|
||||
@@ -197,7 +197,7 @@ Singleton {
|
||||
}
|
||||
|
||||
try {
|
||||
Quickshell.execDetached(["sh", "-c", script]);
|
||||
Quickshell.execDetached(["sh", "-lc", script]);
|
||||
} catch (e) {
|
||||
Logger.e("HooksService", `Failed to execute performance mode enabled hook: ${e}`);
|
||||
}
|
||||
@@ -215,7 +215,7 @@ Singleton {
|
||||
}
|
||||
|
||||
try {
|
||||
Quickshell.execDetached(["sh", "-c", script]);
|
||||
Quickshell.execDetached(["sh", "-lc", script]);
|
||||
} catch (e) {
|
||||
Logger.e("HooksService", `Failed to execute performance mode disabled hook: ${e}`);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ Singleton {
|
||||
|
||||
function runPowerHook(script, callback) {
|
||||
pendingPowerCallback = callback;
|
||||
powerHookProcess.command = ["sh", "-c", script];
|
||||
powerHookProcess.command = ["sh", "-lc", script];
|
||||
powerHookProcess.running = true;
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ Singleton {
|
||||
}
|
||||
|
||||
try {
|
||||
Quickshell.execDetached(["sh", "-c", script]);
|
||||
Quickshell.execDetached(["sh", "-lc", script]);
|
||||
Logger.d("HooksService", `Executed startup hook: ${script}`);
|
||||
} catch (e) {
|
||||
Logger.e("HooksService", `Failed to execute startup hook: ${e}`);
|
||||
|
||||
Reference in New Issue
Block a user