https://github.com/vdustr/term-ptt-custom-theme
A Tampermonkey / Greasemonkey stylesheet and guide to customize term.ptt.cc .
https://github.com/vdustr/term-ptt-custom-theme
color css customization goph greasemonkey palette ptt tampermonkey theme
Last synced: 6 months ago
JSON representation
A Tampermonkey / Greasemonkey stylesheet and guide to customize term.ptt.cc .
- Host: GitHub
- URL: https://github.com/vdustr/term-ptt-custom-theme
- Owner: VdustR
- License: mit
- Created: 2022-04-08T08:27:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-11T03:49:18.000Z (almost 3 years ago)
- Last Synced: 2025-03-25T08:51:21.598Z (7 months ago)
- Topics: color, css, customization, goph, greasemonkey, palette, ptt, tampermonkey, theme
- Language: CSS
- Homepage: https://term.ptt.cc
- Size: 14.6 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PTT Custom Theme
A [Tampermonkey](https://www.tampermonkey.net/) / [Greasemonkey](https://www.greasespot.net/) stylesheet and guide to customize [term.ptt.cc](https://term.ptt.cc/) .
Sample with Goph Graph Theme + [jf open 粉圓](https://github.com/justfont/open-huninn-font):

## Usage
Create a script and insert the script:
```js
// ==UserScript==
// @name PTT Custom Theme
// @description https://github.com/VdustR/term-ptt-custom-theme
// @version 0.0.0
// @match https://term.ptt.cc/
// ==/UserScript==(function () {
"use strict";
function addCss(href) {
const link = document.createElement("link");
link.setAttribute("rel", "stylesheet");
link.setAttribute("href", href);
document.body.appendChild(link);
}
function setColor(color) {
const style = document.createElement("style");
style.innerText = `:root {${Object.entries(color)
.map(([key, value]) => `--term-color-${key}: ${value};`)
.join("")}}`.replace(/[\s\n]/g, "");
document.body.appendChild(style);
}
addCss("https://cdn.jsdelivr.net/gh/vdustr/term-ptt-custom-theme/color.css");
// SolarizedDark for example.
setColor({
black: "#073642",
maroon: "#dc322f",
green: "#859900",
olive: "#cf9a6b",
navy: "#268bd2",
purple: "#d33682",
teal: "#2aa198",
silver: "#eee8d5",
grey: "#657b83",
red: "#d87979",
"0f0": "#88cf76",
ff0: "#657b83",
"00f": "#2699ff",
f0f: "#d33682",
"0ff": "#43b8c3",
fff: "#fdf6e3",
});
})();
```## Useful Links
### Gogh
> Color Scheme for Gnome Terminal, Pantheon Terminal, Tilix, and XFCE4 Terminal
>
> Color Schemes For Ubuntu, Linux Mint, Elementary OS and all distributions that use Gnome Terminal, Pantheon Terminal, Tilix, or XFCE4 Terminal; initially inspired by Elementary OS Luna. Also works on iTerm for macOS.-
```js
// ==UserScript==
// @name PTT Gogh Themes
// @description https://github.com/VdustR/term-ptt-custom-theme
// @version 0.0.0
// @match https://term.ptt.cc/
// ==/UserScript==(async function () {
"use strict";
function addCss(href) {
const link = document.createElement("link");
link.setAttribute("rel", "stylesheet");
link.setAttribute("href", href);
document.body.appendChild(link);
}
function setColor(color) {
const style = document.createElement("style");
style.innerText = `:root {${Object.entries(color)
.map(([key, value]) => `--term-color-${key}: ${value};`)
.join("")}}`.replace(/[\s\n]/g, "");
document.body.appendChild(style);
}
async function setGoghTheme(themeName) {
const { themes } = await (
await fetch("https://cdn.jsdelivr.net/gh/Mayccoll/Gogh/data/themes.json")
).json();
const theme = themes.find(({ name }) => name === themeName);
if (!theme) throw new Error(`Theme ${themeName} not found`);
setColor({
// black: theme.background,
black: theme.black,
maroon: theme.red,
green: theme.green,
olive: theme.yellow,
navy: theme.blue,
purple: theme.purple,
teal: theme.cyan,
silver: theme.white,
grey: theme.brightBlack,
red: theme.brightRed,
"0f0": theme.brightGreen,
ff0: theme.brightYellow,
"00f": theme.brightBlue,
f0f: theme.brightPurple,
"0ff": theme.brightCyan,
fff: theme.brightWhite,
});
}
addCss("https://cdn.jsdelivr.net/gh/vdustr/term-ptt-custom-theme/color.css");
// Replace with the theme name you want
await setGoghTheme("Grape");
})();
```### Themes Based on term-ptt-custom-theme
- [Retro](https://github.com/VdustR/term-ptt-retro-theme)
## License
[MIT](https://github.com/VdustR/term-ptt-custom-theme/blob/main/LICENSE) © [ViPro](https://vdustr.dev).