Merge pull request #29 from MrDowntempo/Launch-TUI-apps

Feat: If applications have a runInTerminal flag, attempts to determine the appropriate terminal emulator to launch it with
This commit is contained in:
Lysec 2025-07-19 16:18:52 +02:00 committed by GitHub
commit f55af1b68b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -143,12 +143,15 @@ PanelWithOverlay {
return;
var modelData = filteredApps[selectedIndex];
const termEmu = Quickshell.env("TERMINAL") || Quickshell.env("TERM_PROGRAM") || none;
if (modelData.isCalculator) {
Qt.callLater(function () {
Quickshell.clipboardText = String(modelData.result);
Quickshell.execDetached(["notify-send", "Calculator Result", `${modelData.expr} = ${modelData.result} (copied to clipboard)`]);
});
} else if (modelData.runInTerminal && termEmu){
Quickshell.execDetached([termEmu, "-e", modelData.execString.trim()]);
} else if (modelData.execute) {
modelData.execute();
} else {