-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwinTerminalToggleColorMode.js
46 lines (38 loc) · 1.31 KB
/
winTerminalToggleColorMode.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const fs = require("fs")
const path = require("path")
const settingsPath = "/mnt/c/Users/mariu/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json"
const hxsettingsPath = "/home/marius/.config/helix/config.toml"
let settings = {}
fs.readFile(hxsettingsPath, { encoding: "utf-8" }, (err, data) => {
if (err) return console.error(err)
const pos = data.search("autumn_night")
let newSettings = ""
if (pos > 0) {
newSettings = data.replace("autumn_night", "emacs")
} else {
newSettings = data.replace("emacs", "autumn_night")
}
fs.writeFile(hxsettingsPath, newSettings, (err) => {
if (err) console.error(err)
})
})
fs.readFile(settingsPath, { encoding: "utf-8" }, (err, data) => {
if (err) return console.error(err)
settings = JSON.parse(data)
settings.profiles.list.forEach(profile => {
if (profile.name == "Arch Linux") {
if (profile.colorScheme == "Campbell") {
profile.colorScheme = "Tango Light"
profile.backgroundImage = null
} else {
profile.colorScheme = "Campbell"
profile.backgroundImage = ""
}
}
})
fs.writeFile(settingsPath, JSON.stringify(settings), (err) => {
if (err) console.error(err)
})
// console.log(settings.profiles)
})
console.log("✨🎉🎇 FARBEN ✨🎉🎇")