Bash vs sh: phase 1 - uniformization to sh. Always use sh, use "-lc" for all user defined commands

This commit is contained in:
Lemmy
2026-01-09 15:00:57 -05:00
parent 1712ed135b
commit 5251a22d20
24 changed files with 45 additions and 45 deletions
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Bildschirmecken"
},
"hooks": {
"info-command-info-description": "• Befehle werden über Shell ausgeführt (sh -c)<br>• Befehle laufen im Hintergrund (getrennt)<br>• Test-Buttons führen mit aktuellen Werten aus",
"info-command-info-description": "• Befehle werden über Shell ausgeführt (sh -lc)<br>• Befehle laufen im Hintergrund (getrennt)<br>• Test-Buttons führen mit aktuellen Werten aus",
"info-command-info-label": "Hook-Befehl-Informationen",
"info-parameters-description": "• Hintergrundbild-Hook: $1 = Hintergrundbild-Pfad, $2 = Bildschirmname<br>• Theme-Wechsel-Hook: $1 = true/false (Dunkelmodus-Status)",
"info-parameters-label": "Verfügbare Parameter",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Screen corners"
},
"hooks": {
"info-command-info-description": "• Commands are executed via shell (sh -c)<br>• Commands run in background (detached)<br>• Test buttons execute with current values",
"info-command-info-description": "• Commands are executed via shell (sh -lc)<br>• Commands run in background (detached)<br>• Test buttons execute with current values",
"info-command-info-label": "Hook command information",
"info-parameters-description": "• Wallpaper hook: $1 = wallpaper path, $2 = screen name<br>• Theme toggle hook: $1 = true/false (Dark Mode state)<br>• Screen lock/unlock hooks: No parameters<br>• Performance mode hooks: No parameters",
"info-parameters-label": "Available parameters",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Esquinas de la pantalla"
},
"hooks": {
"info-command-info-description": "• Los comandos se ejecutan a través de shell (sh -c)<br>• Los comandos se ejecutan en segundo plano (desvinculados)<br>• Los botones de prueba se ejecutan con los valores actuales",
"info-command-info-description": "• Los comandos se ejecutan a través de shell (sh -lc)<br>• Los comandos se ejecutan en segundo plano (desvinculados)<br>• Los botones de prueba se ejecutan con los valores actuales",
"info-command-info-label": "Información de comandos de Hook",
"info-parameters-description": "• Hook de fondo de pantalla: $1 = ruta del fondo de pantalla, $2 = nombre de la pantalla<br>• Hook de cambio de tema: $1 = true/false (estado del modo oscuro)",
"info-parameters-label": "Parámetros disponibles",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Coins de l'écran"
},
"hooks": {
"info-command-info-description": "• Les commandes sont exécutées via le shell (sh -c)<br>• Les commandes s'exécutent en arrière-plan (détachées)<br>• Les boutons de test s'exécutent avec les valeurs actuelles",
"info-command-info-description": "• Les commandes sont exécutées via le shell (sh -lc)<br>• Les commandes s'exécutent en arrière-plan (détachées)<br>• Les boutons de test s'exécutent avec les valeurs actuelles",
"info-command-info-label": "Informations sur la commande de hook",
"info-parameters-description": "• Hook Fond d'écran : $1 = chemin du fond d'écran, $2 = nom de l'écran<br>• Hook de bascule de thème : $1 = true/false (état du mode sombre)",
"info-parameters-label": "Paramètres disponibles",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Képernyősarkok"
},
"hooks": {
"info-command-info-description": "• A parancsok shellen keresztül futnak (sh -c)<br>• A parancsok a háttérben futnak (leválasztva)<br>• A tesztgombok az aktuális értékekkel futnak le",
"info-command-info-description": "• A parancsok shellen keresztül futnak (sh -lc)<br>• A parancsok a háttérben futnak (leválasztva)<br>• A tesztgombok az aktuális értékekkel futnak le",
"info-command-info-label": "Horog parancsinformációk",
"info-parameters-description": "• Háttérkép horog: $1 = háttérkép elérési útja, $2 = képernyő neve<br>• Témaváltó horog: $1 = igaz/hamis (sötét mód állapota)<br>• Képernyőzár/feloldás horgok: Nincsenek paraméterek<br>• Teljesítmény mód horgok: Nincsenek paraméterek",
"info-parameters-label": "Elérhető paraméterek",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "画面の角"
},
"hooks": {
"info-command-info-description": "• コマンドはシェル (sh -c) 経由で実行されます<br>• コマンドはバックグラウンドで実行されます<br>• テストボタンは現在の設定値を使って実行されます",
"info-command-info-description": "• コマンドはシェル (sh -lc) 経由で実行されます<br>• コマンドはバックグラウンドで実行されます<br>• テストボタンは現在の設定値を使って実行されます",
"info-command-info-label": "コマンド実行に関する情報",
"info-parameters-description": "• 壁紙フック: $1 = 壁紙のパス, $2 = 画面名<br>• テーマ切替フック: $1 = true/false(ダークモードの状態)",
"info-parameters-label": "利用可能なパラメータ(引数)",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Quncikên dîmenderê"
},
"hooks": {
"info-command-info-description": "• Ferman bi rêya shellê (sh -c) tên meşandin<br>• Ferman di paşperdeyê de dimeşin (veqetandî)<br>• Bişkokên ceribandinê bi nirxên heyî dimeşin",
"info-command-info-description": "• Ferman bi rêya shellê (sh -lc) tên meşandin<br>• Ferman di paşperdeyê de dimeşin (veqetandî)<br>• Bişkokên ceribandinê bi nirxên heyî dimeşin",
"info-command-info-label": "Agahiyên fermana hookê",
"info-parameters-description": "• Hookê dîwarê: $1 = riya dîwarê, $2 = navê ekranê<br>• Hookê guhertina mijarê: $1 = rast/derew (Rewşa Moda Tarî)<br>• Hookên kilîtkirin/vekirina ekranê: Parametre tune<br>• Hookên moda performansê: Parametre tune",
"info-parameters-label": "Parametreyên berdest",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Schermhoeken"
},
"hooks": {
"info-command-info-description": "• Commando's worden uitgevoerd via shell (sh -c)<br>• Commando's draaien op de achtergrond (losgekoppeld)<br>• Testknoppen worden uitgevoerd met de huidige waarden",
"info-command-info-description": "• Commando's worden uitgevoerd via shell (sh -lc)<br>• Commando's draaien op de achtergrond (losgekoppeld)<br>• Testknoppen worden uitgevoerd met de huidige waarden",
"info-command-info-label": "Informatie over hook-commando's",
"info-parameters-description": "• Wallpaper-hook: $1 = pad naar achtergrond, $2 = schermnaam<br>• Theme Toggle-hook: $1 = true/false (status donkere modus)",
"info-parameters-label": "Beschikbare parameters",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Narożniki ekranu"
},
"hooks": {
"info-command-info-description": "• Polecenia są wykonywane przez powłokę (sh -c)<br>• Polecenia działają w tle (detached)<br>• Przyciski testowe wykonują się z aktualnymi wartościami",
"info-command-info-description": "• Polecenia są wykonywane przez powłokę (sh -lc)<br>• Polecenia działają w tle (detached)<br>• Przyciski testowe wykonują się z aktualnymi wartościami",
"info-command-info-label": "Informacje o poleceniach Hook",
"info-parameters-description": "• Hook tapety: $1 = ścieżka tapety, $2 = nazwa ekranu<br>• Hook zmiany motywu: $1 = true/false (stan trybu ciemnego)<br>• Hooki blokady: Brak parametrów",
"info-parameters-label": "Dostępne parametry",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Cantos da tela"
},
"hooks": {
"info-command-info-description": "• Comandos são executados via shell (sh -c)<br>• Comandos rodam em segundo plano (desanexados)<br>• Botões de teste executam com os valores atuais",
"info-command-info-description": "• Comandos são executados via shell (sh -lc)<br>• Comandos rodam em segundo plano (desanexados)<br>• Botões de teste executam com os valores atuais",
"info-command-info-label": "Informações de Comando do Hook",
"info-parameters-description": "• Hook de Papel de Parede: $1 = caminho do papel de parede, $2 = nome da tela<br>• Hook de Alternância de Tema: $1 = true/false (estado do modo escuro)",
"info-parameters-label": "Parâmetros Disponíveis",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Углы экрана"
},
"hooks": {
"info-command-info-description": "• Команды выполняются через shell (sh -c)<br>• Команды выполняются в фоновом режиме (отдельно)<br>• Кнопки 'Тест' выполняются с текущими значениями",
"info-command-info-description": "• Команды выполняются через shell (sh -lc)<br>• Команды выполняются в фоновом режиме (отдельно)<br>• Кнопки 'Тест' выполняются с текущими значениями",
"info-command-info-label": "Информация о команде хука",
"info-parameters-description": "• Хук обоев: $1 = путь к обоям, $2 = имя экрана<br>• Хук переключения темы: $1 = true/false (состояние темного режима)",
"info-parameters-label": "Доступные параметры",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Ekran köşeleri"
},
"hooks": {
"info-command-info-description": "• Komutlar kabuk (sh -c) ile yürütülür<br>• Komutlar arka planda yürütülür (ayrık)<br>• Test düğmeleri mevcut değerlerle yürütülür",
"info-command-info-description": "• Komutlar kabuk (sh -lc) ile yürütülür<br>• Komutlar arka planda yürütülür (ayrık)<br>• Test düğmeleri mevcut değerlerle yürütülür",
"info-command-info-label": "Komut Bilgisi",
"info-parameters-description": "• Duvar Kâğıdı Kancası: $1 = duvar kâğıdı yolu, $2 = ekran adı<br>• Tema Geçiş Kancası: $1 = true/false (koyu mod durumu)",
"info-parameters-label": "Kullanılabilir Parametreler",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "Кути екрана"
},
"hooks": {
"info-command-info-description": "• Команди виконуються через оболонку (sh -c)<br>• Команди запускаються у фоні (відокремлено)<br>• Кнопки тестування виконують команди з поточними значеннями",
"info-command-info-description": "• Команди виконуються через оболонку (sh -lc)<br>• Команди запускаються у фоні (відокремлено)<br>• Кнопки тестування виконують команди з поточними значеннями",
"info-command-info-label": "Інформація про команди хуків",
"info-parameters-description": "• Хук шпалер: $1 = шлях до шпалер, $2 = назва екрана<br>• Хук перемикання теми: $1 = true/false (стан темного режиму)",
"info-parameters-label": "Доступні параметри",
+1 -1
View File
@@ -920,7 +920,7 @@
"screen-corners-title": "屏幕边角"
},
"hooks": {
"info-command-info-description": "• 命令通过 shell 执行(sh -c<br>• 命令在后台运行(分离)<br>• 测试按钮使用当前值执行",
"info-command-info-description": "• 命令通过 shell 执行(sh -lc<br>• 命令在后台运行(分离)<br>• 测试按钮使用当前值执行",
"info-command-info-label": "钩子命令信息",
"info-parameters-description": "• 壁纸钩子:$1 = 壁纸路径, $2 = 屏幕名称<br>• 主题切换钩子:$1 = true/false(深色模式状态)<br>• 屏幕锁定/解锁钩子:无参数<br>• 性能模式钩子:无参数",
"info-parameters-label": "可用参数",
+5 -5
View File
@@ -455,7 +455,7 @@ Item {
function onClicked() {
if (leftClickExec) {
Quickshell.execDetached(["sh", "-c", leftClickExec]);
Quickshell.execDetached(["sh", "-lc", leftClickExec]);
Logger.i("CustomButton", `Executing command: ${leftClickExec}`);
} else if (!leftClickUpdateText) {
// No left click script was defined, open settings
@@ -470,7 +470,7 @@ Item {
function onRightClicked() {
if (rightClickExec) {
Quickshell.execDetached(["sh", "-c", rightClickExec]);
Quickshell.execDetached(["sh", "-lc", rightClickExec]);
Logger.i("CustomButton", `Executing command: ${rightClickExec}`);
}
if (!textStream && rightClickUpdateText) {
@@ -480,7 +480,7 @@ Item {
function onMiddleClicked() {
if (middleClickExec) {
Quickshell.execDetached(["sh", "-c", middleClickExec]);
Quickshell.execDetached(["sh", "-lc", middleClickExec]);
Logger.i("CustomButton", `Executing command: ${middleClickExec}`);
}
if (!textStream && middleClickUpdateText) {
@@ -551,7 +551,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)) {
@@ -592,7 +592,7 @@ Item {
}
});
Quickshell.execDetached(["sh", "-c", command]);
Quickshell.execDetached(["sh", "-lc", command]);
Logger.i("CustomButton", `Executing command: ${command}`);
}
}
+2 -2
View File
@@ -116,7 +116,7 @@ Item {
if (action === "toggle-mute") {
AudioService.setInputMuted(!AudioService.inputMuted);
} else if (action === "custom-command") {
Quickshell.execDetached(["sh", "-c", middleClickCommand]);
Quickshell.execDetached(["sh", "-lc", middleClickCommand]);
} else if (action === "widget-settings") {
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
}
@@ -170,7 +170,7 @@ Item {
}
}
onMiddleClicked: {
Quickshell.execDetached(["sh", "-c", middleClickCommand]);
Quickshell.execDetached(["sh", "-lc", middleClickCommand]);
}
}
}
+2 -2
View File
@@ -99,7 +99,7 @@ Item {
if (action === "toggle-mute") {
AudioService.setOutputMuted(!AudioService.muted);
} else if (action === "custom-command") {
Quickshell.execDetached(["sh", "-c", middleClickCommand]);
Quickshell.execDetached(["sh", "-lc", middleClickCommand]);
} else if (action === "widget-settings") {
BarService.openWidgetSettings(screen, section, sectionWidgetIndex, widgetId, widgetSettings);
}
@@ -154,7 +154,7 @@ Item {
}
}
onMiddleClicked: {
Quickshell.execDetached(["sh", "-c", middleClickCommand]);
Quickshell.execDetached(["sh", "-lc", middleClickCommand]);
}
}
}
@@ -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();
}
}
@@ -42,7 +42,7 @@ Item {
"provider": root,
"onActivate": function () {
// Copy result to clipboard via xclip
Quickshell.execDetached(["bash", "-c", "echo -n '" + formattedResult.replace(/'/g, "'\\''") + "' | wl-copy"]);
Quickshell.execDetached(["sh", "-c", "echo -n '" + formattedResult.replace(/'/g, "'\\''") + "' | wl-copy"]);
ToastService.showNotice("Copied", formattedResult);
if (launcher)
launcher.close();
@@ -41,7 +41,7 @@ Item {
"onActivate": function () {
launcher.closeImmediately();
Qt.callLater(() => {
Quickshell.execDetached(["sh", "-c", expression]);
Quickshell.execDetached(["sh", "-lc", expression]);
});
}
}
+1 -1
View File
@@ -200,7 +200,7 @@ SmartPanel {
// If custom command is defined, execute it
if (option && option.command && option.command.trim() !== "") {
Logger.i("SessionMenu", "Executing custom command for action:", action, "Command:", option.command);
Quickshell.execDetached(["sh", "-c", option.command]);
Quickshell.execDetached(["sh", "-lc", option.command]);
cancelTimer();
root.close();
return;
+6 -6
View File
@@ -86,7 +86,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}`);
@@ -106,7 +106,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}`);
@@ -125,7 +125,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}`);
@@ -144,7 +144,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}`);
@@ -163,7 +163,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}`);
}
@@ -181,7 +181,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}`);
}
+3 -3
View File
@@ -48,7 +48,7 @@ Singleton {
const script = buildMatugenScript(content, wp, mode);
generateProcess.generator = "matugen";
generateProcess.command = ["bash", "-lc", script];
generateProcess.command = ["sh", "-lc", script];
generateProcess.running = true;
}
@@ -116,7 +116,7 @@ Singleton {
const item = templateQueue.shift();
currentTemplateContext = item;
templateProcess.command = ["bash", "-lc", item.script];
templateProcess.command = ["sh", "-lc", item.script];
templateProcess.running = true;
}
@@ -469,7 +469,7 @@ Singleton {
});
if (commands.length > 0) {
copyProcess.command = ["bash", "-lc", commands.join('; ')];
copyProcess.command = ["sh", "-lc", commands.join('; ')];
copyProcess.running = true;
}
}
+6 -6
View File
@@ -303,7 +303,7 @@ Singleton {
import QtQuick
import Quickshell.Io
Process {
command: ["bash", "-c", ""]
command: ["sh", "-c", ""]
stdout: StdioCollector {}
stderr: StdioCollector {}
}
@@ -311,7 +311,7 @@ Singleton {
try {
const downloadProcess = Qt.createQmlObject(processString, root, "DownloadProcess_" + cacheKey);
downloadProcess.command = ["bash", "-c", downloadCmd];
downloadProcess.command = ["sh", "-c", downloadCmd];
downloadProcess.exited.connect(function (exitCode) {
downloadProcess.destroy();
@@ -344,7 +344,7 @@ Singleton {
import QtQuick
import Quickshell.Io
Process {
command: ["bash", "-c", ""]
command: ["sh", "-c", ""]
stdout: StdioCollector {}
stderr: StdioCollector {}
}
@@ -352,7 +352,7 @@ Singleton {
try {
const processObj = Qt.createQmlObject(processString, root, "CircularProcess_" + cacheKey);
processObj.command = ["bash", "-c", command];
processObj.command = ["sh", "-c", command];
processObj.exited.connect(function (exitCode) {
// Clean up temp file
@@ -387,7 +387,7 @@ Singleton {
Process {
property string cacheKey: ""
property string cachedPath: ""
command: ["bash", "-c", ""]
command: ["sh", "-c", ""]
stdout: StdioCollector {}
stderr: StdioCollector {}
}
@@ -397,7 +397,7 @@ Singleton {
const processObj = Qt.createQmlObject(processString, root, "ImageProcess_" + cacheKey);
processObj.cacheKey = cacheKey;
processObj.cachedPath = outputPath;
processObj.command = ["bash", "-c", command];
processObj.command = ["sh", "-c", command];
processObj.exited.connect(function (exitCode) {
if (exitCode !== 0) {