SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-09-07 23:28:41

kiiroitori
#! CrunchBanger
From: Tokyo, Japan
Registered: 2010-12-07
Posts: 229

[Solved] Removing items from "Places" menu (johnraff's script)

Hi Folks,

There was a similar thread for the previous places menu script but I couldn't find the answer of my problem for the excellent (I believe johnraff's) script.

I rely on lot on the places menu and I would like to hide items (files and directories) that I never use for clarity/efficiency purposes. For example, I have the pdf library management software Mendeley installed and its folder comes up in the menu (as it should) but I have never and probably never will access it from the places menu. So this entry and others basically just clog up my menu!
Is there a way to black-list such items? The icing on the cake would be to be able to sort the entries other than alphabetically...

Thanks!

Last edited by kiiroitori (2011-09-11 04:42:32)


I love #! more than my own kids. I told them and they sympathized.

Offline

Be excellent to each other!

#2 2011-09-07 23:33:36

psyco430404
#! Die Hard
From: Las Vegas, Nevada
Registered: 2011-07-04
Posts: 804

Re: [Solved] Removing items from "Places" menu (johnraff's script)

You could use my approach and just build the menu you want manually hmm, sorry if thats not what you want to hear but it may just be the easiest. What WM are you using and ill build the section for you.


"'If fighting is to result in victory, then you must fight'...Sun Tzu said that and id say he knows a little more about fighting then you do pal."

- TF2 Soldier

Offline

#3 2011-09-08 04:29:00

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: [Solved] Removing items from "Places" menu (johnraff's script)

Hi kiiroitori, a blacklist is possible: you could add a line after line 110 to check the file/directory name against some regular expression, or if it's in some list, something like this:

for i in "$path"* $extra_entries
do
    [ -e "$i" ] || continue    # only output code if file exists
    [ some_condition_on $i_is_met ] && continue # go on to next entry if $i is in blacklist
    shortname="${i##*/}"
    case $shortname in...

But because we are using the dash shell, not bash, it'll probably have to call some external app like grep awk or sed, or else make a function which is called for every menu entry. All this will slow the menu down.

psyco430404's idea may well be the way to go smile

(@psyco the WM must be openbox, because the places menu script only works for that.)

Last edited by johnraff (2011-09-08 04:30:58)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#4 2011-09-08 04:44:35

psyco430404
#! Die Hard
From: Las Vegas, Nevada
Registered: 2011-07-04
Posts: 804

Re: [Solved] Removing items from "Places" menu (johnraff's script)

    <item label="Home Folder">
      <action="Execute">
        <command>thunar ~/</command>
      </action>
    </item>
    <item label="Music">
      <action="Execute">
        <command>thunar ~/music</command>
      </action>
    </item>
    <item label="Videos">
      <action="Execute">
        <command>thunar ~/videos</command>
      </action>
    </item>
    <item label="Images">
      <action="Execute">
        <command>thunar ~/images</command>
      </action>
    </item>
    <item label="Documents">
      <action="Execute">
        <command>thunar ~/documents</command>
      </action>
    </item>
    <item label="Downloads">
      <action="Execute">
        <command>thunar ~/downloads</command>
      </action>
    </item>
    <!--<item label="Dropbox">
      <action="Execute">
        <command>thunar ~/Dropbox</command>
      </action>
    </item>-->

There you go, full menu with dropbox commented out.

Let me know if the syntax is wrong i haven't used Openbox in about a month


"'If fighting is to result in victory, then you must fight'...Sun Tzu said that and id say he knows a little more about fighting then you do pal."

- TF2 Soldier

Offline

#5 2011-09-08 13:37:55

kiiroitori
#! CrunchBanger
From: Tokyo, Japan
Registered: 2010-12-07
Posts: 229

Re: [Solved] Removing items from "Places" menu (johnraff's script)

Thanks for the quick and great replies!
Would it be possible to have a combination of your ideas, that is psyco430404's menu that instead of launching thunar a_given_folder would launch the pipe menu starting from a_given_folder? In other words I guess you would have as many scripts as you have entries (e.g. dash_places_music.sh, dash_places_videos.sh etc)...


I love #! more than my own kids. I told them and they sympathized.

Offline

#6 2011-09-08 15:08:13

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: [Solved] Removing items from "Places" menu (johnraff's script)

Certainly it's possible smile
Just call the pipe menu script with the path to the folder as an argument. See the notes at the top of dash_places_menu.sh:

# Usage: add
# <menu id="places" label="Places" execute="/path/to/dash_places_menu.sh ~" />
# to your .config/openbox/menu.xml (you don't need a final slash after the ~)

but substitute /path/to/the/folder for the ~ at the end, and change the 'id="places"' to some other id, eg the name of the folder.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#7 2011-09-11 04:41:36

kiiroitori
#! CrunchBanger
From: Tokyo, Japan
Registered: 2010-12-07
Posts: 229

Re: [Solved] Removing items from "Places" menu (johnraff's script)

Thanks to you guys my openbox just got even better! Following johnraff's indication I changed the relevant section of my menu.xml to these lines:

<menu id="placesmod" label="Places">
        <menu execute="~/.config/openbox/pipemenus/dash_places_menu.sh ~/downloads" id="placesdl" label="downloads"/>
        <menu execute="~/.config/openbox/pipemenus/dash_places_menu.sh ~/videos" id="placesvids" label="videos"/>
        <menu execute="~/.config/openbox/pipemenus/dash_places_menu.sh ~/images" id="placesimg" label="images"/>
        <menu execute="~/.config/openbox/pipemenus/dash_places_menu.sh ~/documents" id="placesdoc" label="documents"/>
        <menu execute="~/.config/openbox/pipemenus/dash_places_menu.sh ~/tmp" id="placestmp" label="tmp"/>
        <menu execute="~/.config/openbox/pipemenus/dash_places_menu.sh ~" id="places" label="home"/>
     </menu>

and it just does what I wanted in the first place!
psyco430404, johnraff, Thanks again!


I love #! more than my own kids. I told them and they sympathized.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo