Spawn shell subprocesses with bash -c instead of bash -lc
Each `bash -lc` starts a login shell that re-sources the profile (mise activation, /etc/profile.d) on every invocation — ~16 forks per call versus ~2 for `bash -c` — which taxes every menu/panel/launcher action the shell shells out for. The session already exports PATH and env to the shell, so omarchy commands resolve fine under `bash -c`. Switch the internal/omarchy-owned spawns (theme+background switches, brightness, monitor scaling, DNS, lock/fingerprint, keyboard-layout probe, voxtype status, and the `:`/printf state-file writes) to `bash -c`. Leave `bash -lc` on the sites that run user-configurable commands (custom bar-widget exec, menu provider/guard scripts, launcher scan commands, configurable idle/screensaver command), where a user's command may rely on their login environment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
4d630c9f30
commit
a64d895a02
@@ -262,7 +262,7 @@ Panel {
|
||||
|
||||
function copyToClipboard(value) {
|
||||
if (!value || !root.bar) return
|
||||
Quickshell.execDetached(["bash", "-lc", "printf %s " + Util.shellQuote(value) + " | wl-copy"])
|
||||
Quickshell.execDetached(["bash", "-c", "printf %s " + Util.shellQuote(value) + " | wl-copy"])
|
||||
}
|
||||
|
||||
readonly property string icon: Model.connectionIcon(kind, signalStrength)
|
||||
@@ -271,7 +271,7 @@ Panel {
|
||||
if (scanWifi === undefined) scanWifi = false
|
||||
if (!detailsProc.running) detailsProc.running = true
|
||||
if (!dnsProc.running) {
|
||||
dnsProc.command = ["bash", "-lc", root.dnsCommand("")]
|
||||
dnsProc.command = ["bash", "-c", root.dnsCommand("")]
|
||||
dnsProc.running = true
|
||||
}
|
||||
if (wifiDevice) {
|
||||
@@ -467,7 +467,7 @@ Panel {
|
||||
}
|
||||
|
||||
root.pendingDnsProvider = provider
|
||||
actionProc.command = ["bash", "-lc", root.dnsCommand(provider)]
|
||||
actionProc.command = ["bash", "-c", root.dnsCommand(provider)]
|
||||
actionProc.running = true
|
||||
root.close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user