Gedit and Conky (en)

From Conky PitStop

Revision as of 21:21, 17 June 2013 by Sector11 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

gedit and Conky

 Language   English   Français   


You can highlight Conky's syntax in gedit (or in any editor using gtksourceview-2.0).

Go to this blog. Look for "Télécharger le script" and download the zip or see the update below. If you know the owner of the blog, please let him know the file here is updated and he is more then welcome to use it at his site.

Save the file as :

~/.local/share/gtksourceview-2.0/language-specs/conkyrc.lang

or, for all users (need to be root) :

/usr/share/gtksourceview-2.0/language-specs/conkyrc.lang

Change gtksourceview-2.0 to gtksourceview-3.0 for gedit 3.x and higher

Restart gedit, and enjoy !

Note: highlighting works automatically if the filename contains 'conkyrc'. However once you select a file, for example: "OB_Astro_NEO", and tell gedit is is a conky file it will remember that file always.

Colorize-gedit.png

UPDATE: Conky.lang_17_Jun_2013.tar.gz has been updated to be compatible with conky syntax as of 17 June 2013.

OLD: Coloration_conky_11_11_11.tar.gz has been updated with almost 100 lines of new code to be compatible with conky syntax as of 11/11/11. (historical archive)

UPDATE From: dk75 who wrote a mime file so it will be recognized system wide as conkyrc config file:

.local/share/gtksourceview-2.0/language-specs/conkyrc.lang
<language id="conkyrc" _name=".conkyrc" version="2.0" _section="Others">
  <metadata>
    [COLOR="Red"][B]<property name="mimetypes">application/x-conkyrc</property>[/B][/COLOR]
    <property name="globs">*conkyrc*</property>
    <property name="line-comment-start">#</property>
 </metadata>

and a mime-type

.local/share/mime/package/conkyrc.xml
<!--
Author:		dk75
Date:		Sat Mar 31 15:24:28 CEST 2012
Version:	1.0
Comment:	If filename contains pattern 'conkyrc', or first line of file contains '#<conkyrc>', then the file is recognized as conky configuration file
 -->

<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
    <mime-type type="application/x-conkyrc">
	<sub-class-of type="text/plain"/>
        <comment>Conky config file</comment>
        <magic priority="50">
            <match type="string" offset="0" value="#<conkyrc>"/>
        </magic>
        <glob pattern="*conkyrc*"/>
    </mime-type>
</mime-info>
Personal tools
Namespaces
Variants
Actions
Navigation
English
Français
Toolbox