Skip to content

Commit

Permalink
Spiced up the '--theme list' output
Browse files Browse the repository at this point in the history
  • Loading branch information
noccy80 committed Dec 16, 2016
1 parent dc80e7e commit becc840
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
12 changes: 10 additions & 2 deletions bin/phpl-config
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
13 changes: 10 additions & 3 deletions themes/solarized.theme
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -18,15 +22,18 @@ $set(blue,#268bd2)
$set(cyan,#2aa198)
$set(green,#859900)

// --- theme ---

* {
color: %base0;
background: %base03;
pad-before: 1;
pad-after: 1;
}

path {
XXpath {
color: %base1;
background: %base02;
}

loadavg {
Expand Down

0 comments on commit becc840

Please sign in to comment.