From becc84059cf08301bbba2f7354cfaa6b15e76392 Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Fri, 16 Dec 2016 16:57:55 +0100 Subject: [PATCH] Spiced up the '--theme list' output --- README.md | 1 + bin/phpl-config | 12 ++++++++++-- themes/solarized.theme | 13 ++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4f37abe..a09e8a0 100644 --- a/README.md +++ b/README.md @@ -147,3 +147,4 @@ Things that need improving: * Icons should be customizable, maybe as icon packs. * Better handling of 256-color and 24b-color stuff. Pragmas are in place but not active. * Need to strip UTF-8 when outputting to a physical console as most icons fail there. + * Solarized theme need dark and light variants, and `$include()` must be added to theme parser. diff --git a/bin/phpl-config b/bin/phpl-config index 99b222f..37844ea 100755 --- a/bin/phpl-config +++ b/bin/phpl-config @@ -142,11 +142,19 @@ if (cmdl_get($opts,'list')) { exit; } elseif (($theme = cmdl_get($opts,'theme'))) { if ($theme == 'list') { + $current = $_CONFIG['theme']; $themes = glob(PHPL_THEMES."/*.theme"); - printf("Installed themes:\n"); + printf("Installed themes:\n\n"); foreach ($themes as $theme) { - printf(" - %s\n", basename($theme,".theme")); + $_CONFIG['theme'] = basename($theme,".theme"); + config_write(); + $example = trim(exec("phpl-reload --theme; phpl-generate -r")); + printf("%20s %s\n", basename($theme,".theme"), $example); } + printf("\n"); + $_CONFIG['theme']=$current; + config_write(); + exec("phpl-reload --theme"); exit(0); } if (!file_exists(PHPL_THEMES."/{$theme}.theme")) { diff --git a/themes/solarized.theme b/themes/solarized.theme index a96e314..e9afb4a 100644 --- a/themes/solarized.theme +++ b/themes/solarized.theme @@ -1,6 +1,10 @@ -$pragma(256color) - // Solarized color theme +// http://ethanschoonover.com/solarized + +$pragma(truecolor) + +// --- palette --- + $set(base03,#002b36) $set(base02,#073642) $set(base01,#586e75) @@ -18,6 +22,8 @@ $set(blue,#268bd2) $set(cyan,#2aa198) $set(green,#859900) +// --- theme --- + * { color: %base0; background: %base03; @@ -25,8 +31,9 @@ $set(green,#859900) pad-after: 1; } -path { +XXpath { color: %base1; + background: %base02; } loadavg {