mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-02 02:26:00 +00:00
Merge pull request #427 from ecoskey/feat/intermediate_dirs
Create intermediate folders for theme syncing
This commit is contained in:
+24
-22
@@ -439,30 +439,30 @@ Singleton {
|
||||
jsonWriter.setText(matugenJson)
|
||||
|
||||
// -----
|
||||
// For terminals simply copy the full color from theme from iTerm2 so everything looks super nice!
|
||||
var copyCmd = ""
|
||||
if (Settings.data.templates.foot) {
|
||||
if (copyCmd !== "")
|
||||
copyCmd += " ; "
|
||||
copyCmd += `cp -f ${getTerminalColorsTemplate('foot')} ~/.config/foot/themes/noctalia`
|
||||
copyCmd += ` ; ${colorsApplyScript} foot`
|
||||
var terminals = {
|
||||
foot: "~/.config/foot/themes/noctalia",
|
||||
ghostty: "/.config/ghostty/themes/noctalia",
|
||||
kitty: "~/.config/kitty/themes/noctalia.conf",
|
||||
}
|
||||
|
||||
if (Settings.data.templates.ghostty) {
|
||||
if (copyCmd !== "")
|
||||
copyCmd += " ; "
|
||||
copyCmd += `cp -f ${getTerminalColorsTemplate('ghostty')} ~/.config/ghostty/themes/noctalia`
|
||||
copyCmd += ` ; ${colorsApplyScript} ghostty`
|
||||
}
|
||||
var copyCmd = Object.entries(terminals)
|
||||
.filter(([terminal, colorsPath]) => Settings.data.templates[terminal])
|
||||
.map(([terminal, colorsPath]) => {
|
||||
// regex matches everything after last '/' in a string
|
||||
var colorsPathParent = colorsPath.replace(/[^\/]*$/, "")
|
||||
var terminalColorsTemplate = getTerminalColorsTemplate(terminal)
|
||||
return [
|
||||
// make sure intermediate theme directories are present
|
||||
`mkdir -p ${colorsPathParent}`,
|
||||
// copy theme file to terminal config directory
|
||||
`cp -f ${terminalColorsTemplate} ${colorsPath}`,
|
||||
// apply theme config
|
||||
`${colorsApplyScript} ${terminal}`,
|
||||
]
|
||||
})
|
||||
.reduce((arr1, arr2) => arr1.concat(arr2), []) // can't use .flatMap in Qt's environment
|
||||
.join("; ")
|
||||
|
||||
if (Settings.data.templates.kitty) {
|
||||
if (copyCmd !== "")
|
||||
copyCmd += " ; "
|
||||
copyCmd += `cp -f ${getTerminalColorsTemplate('kitty')}.conf ~/.config/kitty/themes/noctalia.conf`
|
||||
copyCmd += ` ; ${colorsApplyScript} kitty`
|
||||
}
|
||||
|
||||
// Finally execute all copies at once.
|
||||
if (copyCmd !== "") {
|
||||
//console.log(copyCmd)
|
||||
copyProcess.command = ["bash", "-lc", copyCmd]
|
||||
@@ -484,7 +484,9 @@ Singleton {
|
||||
colorScheme = "Tokyo-Night"
|
||||
}
|
||||
|
||||
return `${Quickshell.shellDir}/Assets/ColorScheme/${colorScheme}/terminal/${terminal}/${colorScheme}-${darkLight}`
|
||||
var extension = terminal === 'kitty' ? ".conf" : ""
|
||||
|
||||
return `${Quickshell.shellDir}/Assets/ColorScheme/${colorScheme}/terminal/${terminal}/${colorScheme}-${darkLight}${extension}`
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
|
||||
Reference in New Issue
Block a user