aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Byron <[email protected]>2016-05-04 09:50:53 +1000
committerDaniel Byron <[email protected]>2016-05-04 09:50:53 +1000
commit1949c2beb294509ab2e916b1f0d7659ea02e4f0f (patch)
tree406581d5e90419916968dcf0db03df928876b56c
parentAdded imageOverlay option to draw icons and images over the top of generated ... (diff)
downloadschemer2-1949c2beb294509ab2e916b1f0d7659ea02e4f0f.tar.xz
schemer2-1949c2beb294509ab2e916b1f0d7659ea02e4f0f.zip
Gnome terminal (dconf) support added
-rw-r--r--README.md1
-rw-r--r--TODO.md22
-rw-r--r--format.go5
-rw-r--r--output.go22
4 files changed, 28 insertions, 22 deletions
diff --git a/README.md b/README.md
index 1b96aee..bab6f8c 100644
--- a/README.md
+++ b/README.md
@@ -93,3 +93,4 @@ And it will be built in your GOPATH directory, in a subdirectory named 'bin'. To
- Terminator
- Chrome Shell
- OS X Terminal
+- Gnome Terminal (dconf only for now)
diff --git a/TODO.md b/TODO.md
deleted file mode 100644
index 55f8ce6..0000000
--- a/TODO.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# To Do
-
-- Support for following terminal inputs
- + Xterm (Partially done, needs more testing)
- + Urxvt (See: xterm)
- + Mac Terminal
- + iTerm2
- + RoxTerm
- + Konsole
- + Plain text
-
-- Write more tests and find existing or write configurations for terminals to test against
-
-
-# "Would be nice"
-
-- Vim colorscheme input/output
-
-# Maybe
-
-- Include pre-compiled binaries for Linux, Mac and Windows
-- Separate install instructions into INSTALL.md
diff --git a/format.go b/format.go
index 82fa53f..fda8bd1 100644
--- a/format.go
+++ b/format.go
@@ -86,4 +86,9 @@ var formats = []Format{
flagName: "osxterminal",
output: printOSXTerminal,
},
+ {
+ friendlyName: "Gnome Terminal (dconf)",
+ flagName: "gnome-terminal",
+ output: printGnomeDConf,
+ },
}
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
+}