mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Fix #453 (Fuzzel) Predefined colorscheme templating was not supporting ".hex_stripped"
This commit is contained in:
@@ -273,11 +273,13 @@ Singleton {
|
||||
}
|
||||
|
||||
function replaceColorsInFile(filePath, colors) {
|
||||
// This handle both ".hex" and ".hex_stripped" the EXACT same way. Our predefined color schemes are
|
||||
// always RRGGBB without alpha so this is fine and keeps compatibility with matugen.
|
||||
let script = ""
|
||||
Object.keys(colors).forEach(colorKey => {
|
||||
const colorValue = colors[colorKey].default.hex
|
||||
const escapedColor = colorValue.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
||||
script += `sed -i 's/{{colors\\.${colorKey}\\.default\\.hex}}/${escapedColor}/g' '${filePath}'\n`
|
||||
script += `sed -i 's/{{colors\\.${colorKey}\\.default\\.hex\\(_stripped\\)\\?}}/${escapedColor}/g' '${filePath}'\n`
|
||||
})
|
||||
return script
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user