diff --git a/lib/theme.php b/lib/theme.php index 383c711..5901dda 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -20,8 +20,8 @@ public function readTheme($file) { // Strip out all the directives $pragma, $set, $icon etc before parsing //echo $theme."\n\n"; - preg_match_all('/\$(pragma|icon|set|import|include)\((.+?)\)/', $theme, $directives); - $theme = preg_replace('/\$(pragma|icon|set|import|include)\((.+?)\)/', "", $theme); + preg_match_all('/\$(pragma|icon|set|source|include)\((.+?)\)/', $theme, $directives); + $theme = preg_replace('/\$(pragma|icon|set|source|include)\((.+?)\)/', "", $theme); $d_vars = []; // vars from $set() directives $d_icons = []; // icons from $icon() directives @@ -42,7 +42,7 @@ public function readTheme($file) { list($name,$value) = explode(",",$value,2); $d_icons[$name] = $value; break; - case 'import': + case 'source': $path = dirname($file).DIRECTORY_SEPARATOR.$value; if (file_exists($path)) $this->readTheme($path); @@ -59,6 +59,8 @@ public function readTheme($file) { list($name,$value) = explode(",",$value,2); $d_vars[$name] = $value; break; + default: + printf("Warning: Unsupported directive \$%s\n", $directive); } } diff --git a/modules/git.php b/modules/git.php index dddfa4a..c72f2cd 100644 --- a/modules/git.php +++ b/modules/git.php @@ -16,10 +16,12 @@ function _git(array $opts) { $git = "env LANG=C git"; + if (!is_dir(".git")) + return null; $branch = exec("{$git} symbolic-ref --short HEAD 2>/dev/null"); - if (!$branch) - return null; + //if (!$branch) + // return null; $marks = []; diff --git a/modules/loadavg.php b/modules/loadavg.php index 8d17362..9e9f00b 100644 --- a/modules/loadavg.php +++ b/modules/loadavg.php @@ -2,7 +2,7 @@ function _loadavg() { - return panel(sprintf("%s%s",icon('loadavg.load'), sys_getloadavg()[0]),[],'loadavg'); + return panel(sprintf("%s%s",icon('loadavg.icon'), sys_getloadavg()[0]),[],'loadavg'); } module("loadavg", "Display system load average", [ "info", "loadavg" ]); -seticon("loadavg.load"," "); \ No newline at end of file +seticon("loadavg.icon"," "); \ No newline at end of file diff --git a/modules/thermal.php b/modules/thermal.php index 68bb4d6..21899b3 100644 --- a/modules/thermal.php +++ b/modules/thermal.php @@ -9,7 +9,7 @@ function _thermal(array $opts) { $zone = $opts[THERMAL_ZONE]; $temp = (int)@trim(file_get_contents("/sys/class/thermal/{$zone}/temp")); $temp = (float)$temp/1000; - $text = sprintf("%s".$opts[THERMAL_FORMAT], icon('thermal.temp'), $temp); + $text = sprintf("%s".$opts[THERMAL_FORMAT], icon('thermal.icon'), $temp); $attr['class'] = $opts[THERMAL_CLASS]; return panel($text, $attr, 'thermal'); } @@ -17,4 +17,4 @@ function _thermal(array $opts) { option("zone", THERMAL_ZONE, OPT_TYPE_STRING, "Thermal zone (from /sys/class/thermal)", "thermal_zone0"); option("format", THERMAL_FORMAT, OPT_TYPE_STRING, "Format", "%.1fºc"); option("class", THERMAL_CLASS, OPT_TYPE_STRING, "The class to use", "system"); -seticon("thermal.temp", ""); \ No newline at end of file +seticon("thermal.icon", ""); \ No newline at end of file diff --git a/themes/blues.theme b/themes/blues.theme index b06efa8..36b546c 100644 --- a/themes/blues.theme +++ b/themes/blues.theme @@ -1,3 +1,5 @@ +$source(user.icons) + * { background: blue; color: white; diff --git a/themes/classic.theme b/themes/classic.theme index 2acc65c..005a952 100644 --- a/themes/classic.theme +++ b/themes/classic.theme @@ -1,4 +1,4 @@ - +$source(user.icons) * { pad-before: 0; diff --git a/themes/default.theme b/themes/default.theme index e057fe6..6eab18f 100644 --- a/themes/default.theme +++ b/themes/default.theme @@ -1,4 +1,4 @@ -$import(user.icons); +$source(user.icons); // Defaults, applies to everything * { diff --git a/themes/gray.theme b/themes/gray.theme index 83c3ee3..d623890 100644 --- a/themes/gray.theme +++ b/themes/gray.theme @@ -1,3 +1,5 @@ +$source(user.icons) + * { color: black; background: white; diff --git a/themes/mono.theme b/themes/mono.theme index 8b0354a..a7f4268 100644 --- a/themes/mono.theme +++ b/themes/mono.theme @@ -1,3 +1,5 @@ +$source(user.icons) + * { color: white; background: none; diff --git a/themes/solarized.theme b/themes/solarized.theme index e9afb4a..a9fdac7 100644 --- a/themes/solarized.theme +++ b/themes/solarized.theme @@ -1,6 +1,7 @@ // Solarized color theme // http://ethanschoonover.com/solarized +$source(user.icons) $pragma(truecolor) // --- palette ---