mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-30 09:32:05 -04:00
Fix: Expand tilde from config paths (#2242)
* Expand tilde to the home directory for paths from config * Remove extra line
This commit is contained in:
@@ -24,7 +24,9 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function expandTilde(path: string): string {
|
function expandTilde(path: string): string {
|
||||||
return strip(path.replace("~", stringify(root.home)));
|
if (!path.startsWith("~"))
|
||||||
|
return path;
|
||||||
|
return strip(root.home) + path.substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function shortenHome(path: string): string {
|
function shortenHome(path: string): string {
|
||||||
|
|||||||
@@ -1321,7 +1321,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadCustomThemeFromFile(filePath) {
|
function loadCustomThemeFromFile(filePath) {
|
||||||
customThemeFileView.path = filePath;
|
customThemeFileView.path = Paths.expandTilde(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadCustomThemeVariant() {
|
function reloadCustomThemeVariant() {
|
||||||
@@ -1967,6 +1967,7 @@ Singleton {
|
|||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
id: customThemeFileView
|
id: customThemeFileView
|
||||||
|
blockLoading: false
|
||||||
watchChanges: currentTheme === "custom"
|
watchChanges: currentTheme === "custom"
|
||||||
|
|
||||||
function parseAndLoadTheme() {
|
function parseAndLoadTheme() {
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ Singleton {
|
|||||||
|
|
||||||
function attachToSession(name) {
|
function attachToSession(name) {
|
||||||
if (SettingsData.muxUseCustomCommand && SettingsData.muxCustomCommand) {
|
if (SettingsData.muxUseCustomCommand && SettingsData.muxCustomCommand) {
|
||||||
Quickshell.execDetached([SettingsData.muxCustomCommand, name])
|
Quickshell.execDetached([Paths.expandTilde(SettingsData.muxCustomCommand), name])
|
||||||
} else if (root.muxType === "zellij") {
|
} else if (root.muxType === "zellij") {
|
||||||
Quickshell.execDetached(_terminalPrefix().concat(["zellij", "attach", name]))
|
Quickshell.execDetached(_terminalPrefix().concat(["zellij", "attach", name]))
|
||||||
} else {
|
} else {
|
||||||
@@ -202,7 +202,7 @@ Singleton {
|
|||||||
|
|
||||||
function createSession(name) {
|
function createSession(name) {
|
||||||
if (SettingsData.muxUseCustomCommand && SettingsData.muxCustomCommand) {
|
if (SettingsData.muxUseCustomCommand && SettingsData.muxCustomCommand) {
|
||||||
Quickshell.execDetached([SettingsData.muxCustomCommand, name])
|
Quickshell.execDetached([Paths.expandTilde(SettingsData.muxCustomCommand), name])
|
||||||
} else if (root.muxType === "zellij") {
|
} else if (root.muxType === "zellij") {
|
||||||
Quickshell.execDetached(_terminalPrefix().concat(["zellij", "-s", name]))
|
Quickshell.execDetached(_terminalPrefix().concat(["zellij", "-s", name]))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user