diff options
Diffstat (limited to 'output.go')
| -rw-r--r-- | output.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -246,3 +246,25 @@ func printOSXTerminal(colors []color.Color) string { output += "</plist>\n" return output } + +func printGnomeDConf(colors []color.Color) string { + output := "#!/usr/bin/env bash\npalette=\"[" + for i, c := range colors { + cc := c.(color.NRGBA) + bytes := []byte{byte(cc.R), byte(cc.G), byte(cc.B)} + output += "'" + output += "#" + output += hex.EncodeToString(bytes) + output += "'" + if i < len(colors)-1 { + output += "," + } + } + output += "]\"" + output += "\n" + output += "default=$(dconf read /org/gnome/terminal/legacy/profiles:/default | sed -e \"s/'//g\")" + output += "\n" + output += "dconf write /org/gnome/terminal/legacy/profiles:/:$default/palette \"$palette\"" + output += "\n" + return output +} |