<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://crunchbang.org/forums/extern.php?action=feed&amp;type=rss&amp;tid=10231" rel="self" type="application/rss+xml" />
		<title><![CDATA[CrunchBang Linux Forums / Recently Opened Files pipe menu]]></title>
		<link>http://crunchbang.org/forums/viewtopic.php?id=10231</link>
		<description><![CDATA[The most recent posts in Recently Opened Files pipe menu.]]></description>
		<lastBuildDate>Fri, 30 Nov 2012 23:24:30 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=275878#p275878</link>
			<description><![CDATA[<p>Works fine.</p><p>Thank you very much John for the work done on this script.</p>]]></description>
			<author><![CDATA[dummy@example.com (whereisthetea)]]></author>
			<pubDate>Fri, 30 Nov 2012 23:24:30 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=275878#p275878</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=239632#p239632</link>
			<description><![CDATA[<div class="quotebox"><cite>johnraff wrote:</cite><blockquote><div><p>Hi Stanie - the script has now been modified - please see the first post in the thread. If recently-used.xbel is missing a message embedded in a menu is output. That way the error message to stderr seems not to annoy openbox, and leaves a record in .xsession-errors too.</p><p>Thanks for catching this issue.</p></div></blockquote></div><p>Very neat, John.</p><p>It works with bleachbit with no probs. I like it. It certainly is better than my workaround...<br />Thanks.</p>]]></description>
			<author><![CDATA[dummy@example.com (Stanie)]]></author>
			<pubDate>Wed, 04 Jul 2012 11:54:36 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=239632#p239632</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=239575#p239575</link>
			<description><![CDATA[<p>Hi Stanie - the script has now been modified - please see the first post in the thread. If recently-used.xbel is missing a message embedded in a menu is output. That way the error message to stderr seems not to annoy openbox, and leaves a record in .xsession-errors too.</p><p>Thanks for catching this issue.</p>]]></description>
			<author><![CDATA[dummy@example.com (johnraff)]]></author>
			<pubDate>Wed, 04 Jul 2012 06:02:24 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=239575#p239575</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=233737#p233737</link>
			<description><![CDATA[<p>^Yes that works -&#160; it sets $file_path to ${HOME}/.recently-used.xbel but no particular harm is done. A &quot;nicer&quot; solution might be to output a menu with the &quot;no recently-used.xbel found&quot; message. It should be easy enough - I&#039;ll try and put something up next week. (away a couple of days)</p>]]></description>
			<author><![CDATA[dummy@example.com (johnraff)]]></author>
			<pubDate>Sat, 16 Jun 2012 15:55:46 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=233737#p233737</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=233541#p233541</link>
			<description><![CDATA[<div class="quotebox"><cite>johnraff wrote:</cite><blockquote><div><p>@Stanie I guess that&#039;s because the script is checking in multiple locations for the existence of a readable recently-used.xbel and if it doesn&#039;t find one it exits, with an error message. When you get that &quot;Invalid output&quot; message do you see &quot;cannot find a readable recently-used.xbel file&quot; in your ~/.xsession-errors file? </p><p>Maybe better than exiting would be just to output an empty menu, and recreate a blank recently-used.xbel? But then we have to guess which is the right place to put it...</p><p>...or just live with the results of using bleachbit, which shouldn&#039;t really be <em>deleting</em> files like that...</p></div></blockquote></div><p>Hi John.</p><p>Yes, there is indeed &quot;cannot find a readable recently-used.xbel file&quot; in my ~/.xsession-errors. And I know I can avoid this by editing my bleachbit preferences - but I kinda like it this way. So I will play a little with your script later today and will let you know the results...</p><br /><p><span class="bbu">EDIT:</span> I am back with a working solution.</p><p>I commented out 3 lines in your script - namely 35-37:</p><div class="codebox"><pre><code>#else
#    echo &quot;$0: cannot find a readable recently-used.xbel file&quot; &gt;&amp;2
#    exit 1</code></pre></div><p>and now I have no &quot;invalid output&quot; message after running bleachbit <img src="http://crunchbang.org/forums/plugins/ezbbc/style/smilies/wink.png" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Stanie)]]></author>
			<pubDate>Sat, 16 Jun 2012 07:22:57 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=233541#p233541</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=233498#p233498</link>
			<description><![CDATA[<p>@Stanie I guess that&#039;s because the script is checking in multiple locations for the existence of a readable recently-used.xbel and if it doesn&#039;t find one it exits, with an error message. When you get that &quot;Invalid output&quot; message do you see &quot;cannot find a readable recently-used.xbel file&quot; in your ~/.xsession-errors file? </p><p>Maybe better than exiting would be just to output an empty menu, and recreate a blank recently-used.xbel? But then we have to guess which is the right place to put it...</p><p>...or just live with the results of using bleachbit, which shouldn&#039;t really be <em>deleting</em> files like that...</p>]]></description>
			<author><![CDATA[dummy@example.com (johnraff)]]></author>
			<pubDate>Sat, 16 Jun 2012 04:11:39 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=233498#p233498</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=233272#p233272</link>
			<description><![CDATA[<p>Hello John,</p><p>I&#039;ve been playing with your latest version of recent files today and have had one strange behaviour.<br />I use bleachbit with the option delete Recent documents list checked. After it if I hover over the Recent Files in Openbox menu I got the following <a href="http://i.minus.com/ibylHIqxzDyti2.png">&quot;Invalid output&quot; message</a>. It works fine again when I open first file, that creates recently-used.xbel.</p><p>There is no error or warning message when I run the old (but default) waldorf script with the correct path to recently-used.xbel</p><div class="codebox"><pre class="vscroll"><code>#!/bin/sh
#    recently_opened_menu.sh - a script to parse .recently-used.xbel
#    and generate openbox pipe menu
#    Copyright (C) 2010  John Crawley
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.

# Usage: add
# &lt;menu id=&quot;recent&quot; label=&quot;Recent Files&quot; execute=&quot;/path/to/recently_opened_menu.sh&quot; /&gt;
# to your .config/openbox/menu.xml, or use with dash_places_menu.sh (see comments there)

maximum_entries=15 # max. number of entries in menu

#######################################################################

# if argument is --clear, empty .recently-used.xbel
[ &quot;$1&quot; = &#039;--clear&#039; ] &amp;&amp; {
cat &lt;&lt;&#039;:EOF&#039; &gt; &quot;${HOME}&quot;/.local/share/recently-used.xbel
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xbel version=&quot;1.0&quot;
      xmlns:bookmark=&quot;http://www.freedesktop.org/standards/desktop-bookmarks&quot;
      xmlns:mime=&quot;http://www.freedesktop.org/standards/shared-mime-info&quot;
&gt;
&lt;/xbel&gt;
:EOF
exit
}

maximum_entries=$((maximum_entries+2))

pre=&#039;    &lt;item label=&quot;&#039;
mid=&#039;&quot;&gt;
    &lt;action name=&quot;Execute&quot;&gt;&lt;command&gt;&#039;
post=&#039;&lt;/command&gt;&lt;/action&gt;
    &lt;/item&gt;&#039;
    
files=$( tac &quot;${HOME}&quot;/.local/share/recently-used.xbel |  awk -v MAX=&quot;$maximum_entries&quot; -v PR=&quot;$pre&quot; -v MI=&quot;$mid&quot; -v PO=&quot;$post&quot; &#039;BEGIN {
    RS=&quot;&lt;/bookmark&gt;&quot;;
    FS=&quot;&lt;info&gt;&quot;;
}
(NR == MAX) {exit}
!/&lt;bookmark/ {next}
# $1 is the command, $2 the file path
{
    sub(/^.*exec=\&quot;\&amp;apos\;/,&quot;&quot;,$1)
    sub(/\&amp;apos\;.*$/,&quot;&quot;,$1)
    sub(/ *%./,&quot;&quot;,$1)
    sub(/^.*file:\/\//,&quot;&quot;,$2)
    sub(/\&quot;.*$/,&quot;&quot;,$2)
    gsub(/%22/,&quot;\&amp;quot;&quot;,$2)
    gsub(/%3C/,&quot;\&amp;lt;&quot;,$2)
    gsub(/%3E/,&quot;\&amp;gt;&quot;,$2)
    name=$2
    sub(/^.*\//,&quot;&quot;,name)
    gsub(/\&amp;apos;/,&quot;\&amp;apos;\&amp;quot;\&amp;apos;\&amp;quot;\&amp;apos;&quot;,$2)
    print (PR name MI $1 &quot; &#039;&quot;&#039;&quot;&#039;&quot; $2 &quot;&#039;&quot;&#039;&quot;&#039;&quot; PO)
}&#039; )  

# use perl to decode urlencoded characters
files=$(perl -MURI::Escape -e &#039;print uri_unescape($ARGV[0]);&#039; &quot;$files&quot;)

output=&#039;&lt;openbox_pipe_menu&gt;
&#039;&quot;$files&quot;&#039;
&lt;separator /&gt;
    &lt;item label=&quot;Clear Recent Files&quot;&gt;
        &lt;action name=&quot;Execute&quot;&gt;
            &lt;command&gt;
            &amp;apos;&#039;&quot;$0&quot;&#039;&amp;apos; --clear
            &lt;/command&gt;
        &lt;/action&gt;
    &lt;/item&gt;
&lt;/openbox_pipe_menu&gt;
&#039;
printf &#039;%s&#039; &quot;$output&quot;  # printf because echo sometimes eats backslashes</code></pre></div><p>I think I know how to change it (by editing the first part of the script) or I can always switch to the older version. Just thought I would let you know about it...</p>]]></description>
			<author><![CDATA[dummy@example.com (Stanie)]]></author>
			<pubDate>Fri, 15 Jun 2012 18:38:18 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=233272#p233272</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=224357#p224357</link>
			<description><![CDATA[<p>sorry to update an old thread but this seems to work very well for those having issues with their recent files pipe menu. tu johnraff</p>]]></description>
			<author><![CDATA[dummy@example.com (gurtid)]]></author>
			<pubDate>Sun, 27 May 2012 00:16:27 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=224357#p224357</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=150580#p150580</link>
			<description><![CDATA[<p>Sorry, I was too hasty about the &quot;places&quot; menu hack. What I posted doubled underscores in the file <em>path</em> as well as the menu label, so breaking the menu. <img src="http://crunchbang.org/forums/plugins/ezbbc/style/smilies/sad.png" alt="sad" /></p><p>I&#039;ve now edited the last post.</p>]]></description>
			<author><![CDATA[dummy@example.com (johnraff)]]></author>
			<pubDate>Wed, 05 Oct 2011 05:08:46 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=150580#p150580</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=149902#p149902</link>
			<description><![CDATA[<p>Thanks, John, I&#039;ve just tried it, it works fine !</p><p>Denis</p>]]></description>
			<author><![CDATA[dummy@example.com (denis_p)]]></author>
			<pubDate>Sat, 01 Oct 2011 05:34:55 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=149902#p149902</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=149900#p149900</link>
			<description><![CDATA[<p>That seems to be working. <img src="http://crunchbang.org/forums/plugins/ezbbc/style/smilies/smile.png" alt="smile" /></p><p>If you want to try it, <strong>for recent files menu:</strong></p><p>go to line 79, which should be</p><div class="codebox"><pre><code>    sub(/^.*\//,&quot;&quot;,name)</code></pre></div><p>and immediately below it add this line:</p><div class="codebox"><pre><code>    gsub(/_/,&quot;__&quot;,name)</code></pre></div><p><strong>for places menu:</strong><br />Go to line ~126 and just before this line:</p><div class="codebox"><pre><code>    [ -d &quot;$i&quot; ] &amp;&amp; { </code></pre></div><p>add this block of code:</p><div class="codebox"><pre><code>    case $shortnamee in
    *_*) shortnamee_label=$(sed &#039;s/_/__/g;&#039;)&lt;&lt;XXX
$shortnamee
XXX
    ;;
    *) shortnamee_label=$shortnamee;;
    esac</code></pre></div><p>Then in the menu code just below, change the two ocurrences of </p><div class="codebox"><pre><code>label=&quot;&#039;&quot;$shortnamee&quot;&#039;&quot;</code></pre></div><p>to</p><div class="codebox"><pre><code>label=&quot;&#039;&quot;$shortnamee_label&quot;&#039;&quot;</code></pre></div><p>I&#039;m sorry it&#039;s a bit messy, but it seems to do the job. <img src="http://crunchbang.org/forums/plugins/ezbbc/style/smilies/roll.png" alt="roll" /></p>]]></description>
			<author><![CDATA[dummy@example.com (johnraff)]]></author>
			<pubDate>Sat, 01 Oct 2011 05:31:22 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=149900#p149900</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=149719#p149719</link>
			<description><![CDATA[<p>I was wrong, the proper solution is the one ColInvictus proposed : doubling every underscore.<br />(see <a href="http://openbox.org/wiki/Help:Menus#Specifying_menu_shortcuts).">http://openbox.org/wiki/Help:Menus#Spec … hortcuts).</a><br />Putting an underscore at the beginning of filename as I proposed is useless (since openbox already considers the first letter of the item label as a shortcut) and it makes the first letter be underlined which is visually unpleasant.</p>]]></description>
			<author><![CDATA[dummy@example.com (denis_p)]]></author>
			<pubDate>Fri, 30 Sep 2011 12:54:44 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=149719#p149719</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=139712#p139712</link>
			<description><![CDATA[<p>Yes, this is another more neutral solution, but it should be done only for the first appearing underscore, since this is the first one openbox considers as marking the menu shorcut.<br />The solution I proposed (underscore added at beginning of filename) had the advantage of creating, at the same time, a usable menu shortcut that could help browsing through menus with keyboard.<br />But both solutions suit me.</p>]]></description>
			<author><![CDATA[dummy@example.com (denis_p)]]></author>
			<pubDate>Sun, 21 Aug 2011 07:38:37 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=139712#p139712</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=139633#p139633</link>
			<description><![CDATA[<p>I think replacing a single _ with two of them will change it to a single underscore in that position, rather than underlining the subsequent character.</p>]]></description>
			<author><![CDATA[dummy@example.com (ColInvictus)]]></author>
			<pubDate>Sat, 20 Aug 2011 23:33:33 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=139633#p139633</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recently Opened Files pipe menu]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=139531#p139531</link>
			<description><![CDATA[<p>Opinions, anyone else?</p>]]></description>
			<author><![CDATA[dummy@example.com (johnraff)]]></author>
			<pubDate>Sat, 20 Aug 2011 16:51:16 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=139531#p139531</guid>
		</item>
	</channel>
</rss>
