aboutsummaryrefslogtreecommitdiff
path: root/output.go
diff options
context:
space:
mode:
Diffstat (limited to 'output.go')
-rw-r--r--output.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/output.go b/output.go
index 71eff48..9441c33 100644
--- a/output.go
+++ b/output.go
@@ -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
+}