<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bicosyes - since evermore... &#187; bashrc</title>
	<atom:link href="http://bicosyes.com/tag/bashrc/feed/" rel="self" type="application/rss+xml" />
	<link>http://bicosyes.com</link>
	<description></description>
	<lastBuildDate>Sat, 06 Mar 2010 20:03:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mostrar notificaciones emergentes desde la consola</title>
		<link>http://bicosyes.com/mostrar-notificaciones-emergentes-desde-la-consola/</link>
		<comments>http://bicosyes.com/mostrar-notificaciones-emergentes-desde-la-consola/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 14:20:21 +0000</pubDate>
		<dc:creator>blaxter</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[d-bus]]></category>
		<category><![CDATA[notificaciones]]></category>
		<category><![CDATA[notify]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ubutu]]></category>

		<guid isPermaLink="false">http://bicosyes.com/?p=894</guid>
		<description><![CDATA[A veces es útil mostrar algún tipo de notificación gráfica para informarte, por ejemplo, de cuándo se ha terminado una tarea. Las notificaciones emergentes de Ubuntu, añadidas hace un par de versiones, son una muy buena opción. Dos opciones, (1) &#8230; <a href="http://bicosyes.com/mostrar-notificaciones-emergentes-desde-la-consola/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A veces es útil mostrar algún tipo de notificación gráfica para informarte, por ejemplo, de cuándo se ha terminado una tarea. <a href="https://wiki.ubuntu.com/NotifyOSD">Las notificaciones emergentes de Ubuntu</a>, añadidas hace un par de versiones, son una muy buena opción.</p>
<p>Dos opciones, (1) instalarnos esta librería de perl <em>libnet-dbus-perl</em>, y nos ponemos esta función en nuestro <em>~/.bashrc</em></p>
<pre class="bash"><span style="color: #000000; font-weight: bold;">function</span> notify<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #c20cb9; font-weight: bold;">perl</span> -e <span style="color: #ff0000;">&quot;use Net::DBus; my <span style="color: #000099; font-weight: bold;">\$</span>sessionBus = Net::DBus-&gt;session; my <span style="color: #000099; font-weight: bold;">\$</span>notificat
ionsService = <span style="color: #000099; font-weight: bold;">\$</span>sessionBus-&gt;get_service('org.freedesktop.Notifications'); my <span style="color: #000099; font-weight: bold;">\$</span>n
otificationsObject = <span style="color: #000099; font-weight: bold;">\$</span>notificationsService-&gt;get_object('/org/freedesktop/Notifi
cations', 'org.freedesktop.Notifications'); my <span style="color: #000099; font-weight: bold;">\$</span>notificationId; <span style="color: #000099; font-weight: bold;">\$</span>notificationI
d = <span style="color: #000099; font-weight: bold;">\$</span>notificationsObject-&gt;Notify(shift, 0, '', '$1', '$2', [], {}, -1);&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre>
<pre>$ notify foooooooo baaarrr</pre>
<p><a href="http://bicosyes.com/wp-content/uploads/2009/11/notify.png"><img src="http://bicosyes.com/wp-content/uploads/2009/11/notify.png" alt="notify" title="notify" width="357" height="204" class="aligncenter size-full wp-image-895" /></a></p>
<p>El primer parámetro es el título y el segundo el contenido. </p>
<p>Otra forma (2) todavía más fácil es instalarnos el paquete <em>libnotify-bin</em>, el cual contiene el binario <em>notify-send</em> que hace justamente esto. Probablemente la primera solución nos servirá para cualquier distro, mientras que la segunda solo en debian, ubuntu y derivados. Ambas funcionan exactamente igual y sin problemas.</p>
<img src="http://bicosyes.com/?ak_action=api_record_view&id=894&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://bicosyes.com/mostrar-notificaciones-emergentes-desde-la-consola/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

