<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: xterm code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 08 Aug 2008 15:17:39 GMT</pubDate>
    <description>DZone Snippets: xterm code</description>
    <item>
      <title>Unix Console Styler</title>
      <link>http://snippets.dzone.com/posts/show/4822</link>
      <description>This modue can be used to apply many style on Unix* terminals&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# Unix Console Style&lt;br /&gt;# You can use this module to apply a style on the terminal&lt;br /&gt;#&lt;br /&gt;# &lt;b&gt;DON'T WORK ON WINDOWS (Only on *nix Terminal)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;module UnixConsoleStyler&lt;br /&gt;  class StyleNotFoundException &lt; Exception; end&lt;br /&gt;  &lt;br /&gt;  # Availables Styles&lt;br /&gt;  STYLE = {&lt;br /&gt;      :default    =&gt;    "\033[0m",&lt;br /&gt;    	# styles&lt;br /&gt;    	:bold       =&gt;    "\033[1m",&lt;br /&gt;    	:underline  =&gt;    "\033[4m",&lt;br /&gt;    	:blink      =&gt;    "\033[5m",&lt;br /&gt;    	:reverse    =&gt;    "\033[7m",&lt;br /&gt;    	:concealed  =&gt;    "\033[8m",&lt;br /&gt;    	# font colors&lt;br /&gt;    	:black      =&gt;    "\033[30m", &lt;br /&gt;    	:red        =&gt;    "\033[31m",&lt;br /&gt;    	:green      =&gt;    "\033[32m",&lt;br /&gt;    	:yellow     =&gt;    "\033[33m",&lt;br /&gt;    	:blue       =&gt;    "\033[34m",&lt;br /&gt;    	:magenta    =&gt;    "\033[35m",&lt;br /&gt;    	:cyan       =&gt;    "\033[36m",&lt;br /&gt;    	:white      =&gt;    "\033[37m",&lt;br /&gt;    	# background colors&lt;br /&gt;    	:on_black   =&gt;    "\033[40m", &lt;br /&gt;    	:on_red     =&gt;    "\033[41m",&lt;br /&gt;    	:on_green   =&gt;    "\033[42m",&lt;br /&gt;    	:on_yellow  =&gt;    "\033[43m",&lt;br /&gt;    	:on_blue    =&gt;    "\033[44m",&lt;br /&gt;    	:on_magenta =&gt;    "\033[45m",&lt;br /&gt;    	:on_cyan    =&gt;    "\033[46m",&lt;br /&gt;    	:on_white   =&gt;    "\033[47m" }&lt;br /&gt;  &lt;br /&gt;  # Methods to use if you want to apply a style&lt;br /&gt;  def UnixConsoleStyler::apply_style(style)&lt;br /&gt;    if STYLE.has_key? style&lt;br /&gt;      STDOUT.write STYLE[style]&lt;br /&gt;    else&lt;br /&gt;      raise StyleNotFoundException, "Style #{style} not found"&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 28 Nov 2007 19:21:49 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4822</guid>
      <author>kedare (Mathieu Poussin)</author>
    </item>
    <item>
      <title>Set the title of an xterm or rxvt window</title>
      <link>http://snippets.dzone.com/posts/show/528</link>
      <description>This snippet of shell code will set the title bar text of an xterm, rxvt, or possibly other terminal programs:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;printf \\033]0\;\%s\\007 "$title"&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;...where $title is the title text.</description>
      <pubDate>Sat, 30 Jul 2005 06:13:22 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/528</guid>
      <author>AGWA (Andrew Ayer)</author>
    </item>
  </channel>
</rss>
