2016-05-21 19:10:29 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2016-05-22 16:58:31 +00:00
|
|
|
<language id="conkyrc" _name="Conky" version="2.0" _section="Others">
|
2016-05-21 19:10:29 +00:00
|
|
|
<metadata>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- This syntax highlighting will apply for any file with the sequence "conky"
|
|
|
|
in the file name (or extension), I recommend to use you_config_name.conky
|
2016-05-21 19:10:29 +00:00
|
|
|
for config files or alternatively conky_your_config_name
|
2016-05-22 16:58:31 +00:00
|
|
|
Unfortunately this will also trigger the syntax highlighting for this document,
|
2016-05-21 19:10:29 +00:00
|
|
|
you can always manually set this one back to XML.
|
|
|
|
If you have a favourite custom format you can change the globs property to your
|
|
|
|
personal preference. -->
|
|
|
|
<property name="globs">*conky*</property>
|
|
|
|
<property name="block-comment-start">--[[</property>
|
|
|
|
<property name="block-comment-end">]]</property>
|
|
|
|
</metadata>
|
|
|
|
|
|
|
|
<styles>
|
2016-05-22 16:58:31 +00:00
|
|
|
<style id="config-keyword" _name="Config keywords" map-to="def:keyword"/>
|
|
|
|
<style id="text-keyword" _name="Text keywords" map-to="def:type"/>
|
2016-05-21 19:10:29 +00:00
|
|
|
<style id="comment" _name="Comment" map-to="def:comment"/>
|
2016-05-22 16:58:31 +00:00
|
|
|
<style id="escaped-char" _name="Escaped Character" map-to="def:special-char"/>
|
2016-05-21 19:10:29 +00:00
|
|
|
<style id="path" _name="Paths and URLs" map-to="def:string"/>
|
|
|
|
<style id="boolean" _name="Boolean" map-to="def:boolean"/>
|
|
|
|
<style id="argument" _name="Arguments" map-to="def:preprocessor"/>
|
2016-05-22 16:58:31 +00:00
|
|
|
<style id="brackets" _name="Text Variable Brackets ${ ... }" map-to="def:identifier"/>
|
2016-05-21 19:10:29 +00:00
|
|
|
<style id="decimal" _name="Decimal" map-to="def:decimal"/>
|
|
|
|
</styles>
|
|
|
|
|
|
|
|
<definitions>
|
2016-05-22 16:58:31 +00:00
|
|
|
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<!-- Keep in mind gedit does not like < and >, use < and > instead! -->
|
|
|
|
<!-- Use `ref="id:*"` to include all children of `id` instead of `id` itself -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ========================== Container contexts and structure =========================== -->
|
|
|
|
<!-- "root structure" this is where it all begins -->
|
2016-05-21 19:10:29 +00:00
|
|
|
<context id="conkyrc" class="no-spell-check">
|
|
|
|
<include>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- Generic global stuff -->
|
|
|
|
<!-- Comments -->
|
|
|
|
<context ref="config-block-comment"/>
|
|
|
|
<context ref="config-line-comment"/>
|
|
|
|
<!-- end: Comments -->
|
|
|
|
|
|
|
|
<!-- The settings block -->
|
|
|
|
<context>
|
|
|
|
<start>(?:(conky)\.(config)(?:\s|\n)*(=)(?:\s|\n)*(\{))</start>
|
|
|
|
<end>\}</end>
|
|
|
|
<include>
|
|
|
|
<!-- Keyword mark highlighter -->
|
|
|
|
<context sub-pattern="1" where="start" style-ref="config-keyword"/>
|
|
|
|
<context sub-pattern="2" where="start" style-ref="text-keyword"/>
|
|
|
|
<!-- end: Keyword mark highlighter -->
|
|
|
|
<!-- Equals highlighter -->
|
|
|
|
<context sub-pattern="3" where="start" style-ref="brackets"/>
|
|
|
|
<!-- end: Equals highlighter -->
|
|
|
|
<!-- Brackets highlighter -->
|
|
|
|
<context sub-pattern="4" where="start" style-ref="brackets"/>
|
|
|
|
<context sub-pattern="0" where="end" style-ref="brackets"/>
|
|
|
|
<!-- end: Brackets highlighter -->
|
|
|
|
|
|
|
|
<!-- Comments -->
|
|
|
|
<context ref="config-block-comment"/>
|
|
|
|
<context ref="config-line-comment"/>
|
|
|
|
<!-- end: Comments -->
|
|
|
|
|
|
|
|
<!-- key=val pair -->
|
|
|
|
<context ref="config-option"/>
|
|
|
|
<!-- end: key=val -->
|
|
|
|
</include>
|
|
|
|
</context>
|
|
|
|
<!-- end: settings block -->
|
|
|
|
|
|
|
|
<!-- The text block -->
|
|
|
|
<context id="conky-text">
|
|
|
|
<start>(?:(conky)\.(text)(?:\s|\n)*(=)(?:\s|\n)*)</start>
|
|
|
|
<end>(?=.|$)</end><!-- End at anything as we only have one child -->
|
|
|
|
<include>
|
|
|
|
<!-- Keyword mark highlighter -->
|
|
|
|
<context sub-pattern="1" where="start" style-ref="config-keyword"/>
|
|
|
|
<context sub-pattern="2" where="start" style-ref="text-keyword"/>
|
|
|
|
<!-- end: Keyword mark highlighter -->
|
|
|
|
<!-- Equals highlighter -->
|
|
|
|
<context sub-pattern="3" where="start" style-ref="brackets"/>
|
|
|
|
<!-- end: Equals highlighter -->
|
|
|
|
|
|
|
|
<!-- Literal Sub-String -->
|
|
|
|
|
|
|
|
<!-- This is just a literal string, really -->
|
|
|
|
<context ref="lua-lit-string"/>
|
|
|
|
</include>
|
|
|
|
</context>
|
|
|
|
<!-- end: Text block -->
|
2016-05-21 19:10:29 +00:00
|
|
|
</include>
|
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: root context -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ================================== Import groups ================================== -->
|
|
|
|
<!-- Container for generic includes -->
|
|
|
|
<!--<context id="generic-container">
|
|
|
|
<include>
|
|
|
|
</include>
|
|
|
|
</context>-->
|
|
|
|
<!-- end: Generic container -->
|
2016-05-21 19:10:29 +00:00
|
|
|
|
|
|
|
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- ======================== Component contexts and structure ========================= -->
|
2016-05-21 19:10:29 +00:00
|
|
|
<!-- Block comment, lua syntax -->
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- Note: this will only highlight block comments outside the conky.text section -->
|
|
|
|
<context id="config-block-comment" style-ref="comment" class="comment" class-disabled="no-spell-check">
|
|
|
|
<start>--\[(=*)\[</start><end>]\%{1@start}]</end>
|
2016-05-21 19:10:29 +00:00
|
|
|
<include>
|
|
|
|
<context ref="def:in-comment"/>
|
|
|
|
</include>
|
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: Block comment, lua syntax -->
|
2016-05-21 19:10:29 +00:00
|
|
|
|
|
|
|
<!-- Line comment, lua syntax -->
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- Note: this will only highlight line comments outside the conky.text section -->
|
|
|
|
<context id="config-line-comment" style-ref="comment" class-disabled="no-spell-check">
|
|
|
|
<start>\-\-</start><end>$</end>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: Line comment, lua syntax -->
|
|
|
|
|
|
|
|
<!-- Line comment, conky text syntax -->
|
|
|
|
<!-- Note: this will only highlight line comments **inside** the conky.text section -->
|
|
|
|
<context id="text-comment" style-ref="comment" class-disabled="no-spell-check">
|
|
|
|
<start>#</start><end>$</end>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: Line comment, conky syntax-->
|
2016-05-21 19:10:29 +00:00
|
|
|
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- String -->
|
|
|
|
<context id="lua-string" style-ref="argument" style-inside="true"
|
|
|
|
end-at-line-end="true" class="string">
|
|
|
|
<start>('|")</start><end>\%{0@start}</end>
|
|
|
|
<include>
|
|
|
|
<!-- Quote mark highlighter -->
|
|
|
|
<context sub-pattern="0" where="start" style-ref="brackets"/>
|
|
|
|
<context sub-pattern="0" where="end" style-ref="brackets"/>
|
|
|
|
<!-- end: Quote mark highlighter -->
|
|
|
|
|
|
|
|
<!-- Known patterns -->
|
|
|
|
<!-- Escaped Char (also prevents the context ending prematurely) -->
|
|
|
|
<context ref="lua-escape"/>
|
|
|
|
<context ref="path"/>
|
|
|
|
<context ref="hex-colors"/>
|
|
|
|
<context ref="predefined-colors"/>
|
|
|
|
<!-- end: Known patterns -->
|
|
|
|
|
|
|
|
</include>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: String value -->
|
|
|
|
|
|
|
|
<!-- Literal string -->
|
|
|
|
<context id="lua-lit-string" once-only="true">
|
|
|
|
<start>\[\[</start><end>\]\]</end>
|
|
|
|
<include>
|
|
|
|
<!-- Quote mark highlighter -->
|
|
|
|
<context sub-pattern="0" where="start" style-ref="brackets"/>
|
|
|
|
<context sub-pattern="0" where="end" style-ref="brackets"/>
|
|
|
|
<!-- end: Quote mark highlighter -->
|
|
|
|
|
|
|
|
<!-- Literal Sub-String -->
|
|
|
|
<!-- We use this to stop premature end of parent -->
|
|
|
|
<context>
|
|
|
|
<start>\[\[</start><end>\]\]</end>
|
|
|
|
<!-- Reccursive -->
|
|
|
|
<include><context ref="lua-lit-string:*"/></include>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: Literal Sub-String -->
|
|
|
|
|
|
|
|
<!-- Stuff specific to literal strings (e.g. templates and conky.text) -->
|
|
|
|
<!-- TODO: Find a clean way to separate template and text lit-strings -->
|
|
|
|
<context ref="text-escape"/>
|
|
|
|
<context ref="template-escape"/>
|
|
|
|
<context ref="text-comment"/>
|
|
|
|
<context ref="bracket-var"/>
|
|
|
|
<context ref="text-var"/>
|
|
|
|
</include>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: Literal string -->
|
|
|
|
|
|
|
|
<!-- Escaped char -->
|
|
|
|
|
|
|
|
<!-- conky.text escapes -->
|
|
|
|
<context id="text-escape" style-ref="escaped-char">
|
|
|
|
<!-- NOTE: Conky doesn't currently escape double backslash -->
|
|
|
|
<match>\\(?:#|$)</match>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
|
|
|
|
<!-- template definition escapes -->
|
|
|
|
<context id="template-escape" style-ref="escaped-char">
|
|
|
|
<match>\\[n\\ 0-9]</match>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
|
|
|
|
<!-- lua string escapes -->
|
|
|
|
<context id="lua-escape" style-ref="escaped-char">
|
|
|
|
<match>\\[abfnrtv\\"'\[\]]</match>
|
|
|
|
</context>
|
|
|
|
<!-- end: Escaped char -->
|
|
|
|
|
|
|
|
<!-- File paths and URLs, starting with https://, http://, ~/ or / -->
|
|
|
|
<context id="path" style-ref="path" class="string">
|
|
|
|
<match>(?<=\'|\ )(?:\~\/|\/|htt(?:p|ps)\:\/\/){1}[^\s\}\']*</match>
|
|
|
|
</context>
|
|
|
|
<!-- end: File paths and URLs -->
|
|
|
|
|
|
|
|
<!-- Custom colors (hex) -->
|
|
|
|
<context id="hex-colors" style-ref="decimal">
|
|
|
|
<match>(?:[\da-fA-F]{6})</match>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: Custom colors -->
|
2016-05-21 19:10:29 +00:00
|
|
|
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- Predefined colors -->
|
|
|
|
<!-- Colors parsed by `XParsecolor()` (see /usr/share/X11/rgb.txt (or possibly /usr/lib)) -->
|
|
|
|
<context id="predefined-colors" style-ref="decimal">
|
|
|
|
<keyword>red</keyword>
|
|
|
|
<keyword>green</keyword>
|
|
|
|
<keyword>yellow</keyword>
|
|
|
|
<keyword>blue</keyword>
|
|
|
|
<keyword>magenta</keyword>
|
|
|
|
<keyword>cyan</keyword>
|
|
|
|
<keyword>black</keyword>
|
|
|
|
<keyword>white</keyword>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: Predefined colors -->
|
2016-05-21 19:10:29 +00:00
|
|
|
|
|
|
|
<!-- Numbers -->
|
|
|
|
<context id="number" style-ref="decimal">
|
|
|
|
<match>(?<=[\ \=]|\dx)([\+\-]{0,1}\d+)([\.\,]{1}\d+)?</match>
|
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: Numbers -->
|
|
|
|
|
2016-05-21 19:10:29 +00:00
|
|
|
<!-- Boolean values -->
|
|
|
|
<context id="boolean" style-ref="boolean">
|
|
|
|
<keyword>false</keyword>
|
|
|
|
<keyword>true</keyword>
|
|
|
|
<keyword>yes</keyword>
|
|
|
|
<keyword>no</keyword>
|
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: Boolean values -->
|
|
|
|
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
|
|
|
|
<!-- key=val pair -->
|
|
|
|
<context id="config-option">
|
|
|
|
<start>[A-Za-z0-9_]+</start>
|
|
|
|
<!-- ended by value -->
|
|
|
|
<include>
|
|
|
|
<!-- Keyword highlight -->
|
|
|
|
<context sub-pattern="0" where="start" style-ref="config-keyword"/>
|
|
|
|
<!-- end: Keyword highlight -->
|
|
|
|
|
|
|
|
<!-- value -->
|
|
|
|
<context end-parent="true">
|
|
|
|
<start>=</start><end>(?:,|(?=\}))</end>
|
|
|
|
<include>
|
|
|
|
<!-- Equals highlight -->
|
|
|
|
<context sub-pattern="0" where="start" style-ref="brackets"/>
|
|
|
|
<!-- end: Equals highlight -->
|
|
|
|
|
|
|
|
<!-- Value types -->
|
|
|
|
<context ref="lua-string"/>
|
|
|
|
<context ref="lua-lit-string"/>
|
|
|
|
<context ref="number"/>
|
|
|
|
<context ref="boolean"/>
|
|
|
|
<!-- end: Value types -->
|
|
|
|
|
|
|
|
<!-- Comments -->
|
|
|
|
<context ref="config-block-comment"/>
|
|
|
|
<context ref="config-line-comment"/>
|
|
|
|
<!-- end: Comments -->
|
|
|
|
</include>
|
|
|
|
</context>
|
|
|
|
<!-- end: value -->
|
|
|
|
|
|
|
|
<!-- Comments -->
|
|
|
|
<context ref="config-block-comment"/>
|
|
|
|
<context ref="config-line-comment"/>
|
|
|
|
<!-- end: Comments -->
|
|
|
|
</include>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- end: key=val -->
|
2016-05-21 19:10:29 +00:00
|
|
|
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- TextVariables -->
|
|
|
|
<!-- Bracket style -->
|
|
|
|
<context id="bracket-var" style-ref="argument" style-inside="true">
|
|
|
|
<start>(?:(\$\{)(?:\s|\n|$)*([a-z][a-z0-9_]*))</start>
|
|
|
|
<end>\}</end>
|
|
|
|
<include>
|
|
|
|
<!-- Brackets highlighter -->
|
|
|
|
<context sub-pattern="1" where="start" style-ref="brackets"/>
|
|
|
|
<context sub-pattern="0" where="end" style-ref="brackets"/>
|
|
|
|
<!-- end: Brackets highlighter -->
|
|
|
|
|
|
|
|
<!-- Variable/keyword highlighter -->
|
|
|
|
<context sub-pattern="2" where="start" style-ref="text-keyword"/>
|
|
|
|
|
|
|
|
<!-- Special patterns -->
|
|
|
|
<context ref="number"/>
|
|
|
|
<context ref="boolean"/>
|
|
|
|
<context ref="path"/>
|
|
|
|
<context ref="hex-colors"/>
|
|
|
|
<context ref="predefined-colors"/>
|
|
|
|
<!-- end: Special patterns -->
|
|
|
|
|
|
|
|
<!-- Inherit from lit-String -->
|
|
|
|
<context ref="lua-lit-string:*"/>
|
|
|
|
</include>
|
2016-05-21 19:10:29 +00:00
|
|
|
</context>
|
|
|
|
|
2016-05-22 16:58:31 +00:00
|
|
|
<!-- non-bracket style -->
|
|
|
|
<context id="text-var" style-ref="text-keyword" style-inside="true">
|
|
|
|
<start>(?:(\$)(?!\{))</start>
|
|
|
|
<end>(?:(?=[^A-Za-z0-9_])|$)</end>
|
|
|
|
<include>
|
|
|
|
<!-- Dollar highlighter -->
|
|
|
|
<context sub-pattern="1" where="start" style-ref="brackets"/>
|
|
|
|
<!-- end: Dollar highlighter -->
|
|
|
|
</include>
|
|
|
|
</context>
|
|
|
|
<!-- end: TextVariables -->
|
2016-05-21 19:10:29 +00:00
|
|
|
|
|
|
|
</definitions>
|
|
|
|
</language>
|