You are not logged in.

#1 2019-03-24 21:00:25

between 2 and 25
New Member
Registered: 2019-03-24
Posts: 3

[SOLVED] How to show everything with places pipemenu?

1. I want to places menu to start from root (/) instead of home ($HOME), but simple replacement is not working, any ideas?

2. Is it possible to show all dot-files everywhere, not only in $HOME? If so, then how?

Last edited by between 2 and 25 (2019-03-25 05:47:43)

Offline

#2 2019-03-24 22:26:08

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [SOLVED] How to show everything with places pipemenu?

between 2 and 25 wrote:

1. I want to places menu to start from root (/) instead of home ($HOME), but simple replacement is not working, any ideas?

Without delving into the script I don't see an easy way of doing that. Don't forget you can Browse using the first entry in the menu output.

2. Is it possible to show all dot-files everywhere, not only in $HOME? If so, then how?

See above.

bl-places-pipemenu --help

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#3 2019-03-25 02:44:57

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,560
Website

Re: [SOLVED] How to show everything with places pipemenu?

Hi between 2 and 25, welcome to BunsenLabs. smile

Yes, you can start the places pipemenu from / , just double it:

bl-places-pipemenu //

The reason is that the root is a bit special - it doesn't have a name. The script strips off a trailing slash (if there is one) from whatever directory name it is given (ie /home/user/ → /home/user ) before processing - this was simply to avoid double slashes in path names, and could have been done differently , in fact. Anyway, just add another slash and / survives as the path.

Dotfiles: the shell glob * ignores dotfiles by default. To include them you'll have to edit the script. Try:

cp /usr/bin/bl-places-pipemenu $HOME/bin

Then edit your local version in ~/bin.
Find line #155

for i in "$path"/* $extra_entries

and edit it to:

for i in "$path"/* "$path"/.* $extra_entries

...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#4 2019-03-25 05:47:19

between 2 and 25
New Member
Registered: 2019-03-24
Posts: 3

Re: [SOLVED] How to show everything with places pipemenu?

Nice, thank you !

Offline

#5 2019-03-25 09:38:11

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [SOLVED] How to show everything with places pipemenu?

bl-places-pipemenu //

A double slash! That's why it wasn't working when I tried it.

Maybe add these tweaks to the $HELP and/or comments?


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#6 2019-03-25 12:33:31

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: [SOLVED] How to show everything with places pipemenu?

Note: discard this post; proper solution is given in the post immediately after this post.

@johnraff and @damo: Well, this '//' instead of '/' argument problem can be easily taken care of in actual bl-places-pipemenu:

$ diff -u /usr/bin/bl-places-pipemenu-dist /usr/bin/bl-places-pipemenu
--- /usr/bin/bl-places-pipemenu-dist	2019-03-25 13:17:12.190489853 +0100
+++ /usr/bin/bl-places-pipemenu	2019-03-25 13:19:29.801787537 +0100
@@ -112,7 +112,7 @@
 esac
 
 path="${1:-$HOME}"  # default starting place is ~, otherwise $1
-path="${path%/}"
+[ ! $path = "/" ] && path="${path%/}"
 [ -d "$path" ] || { echo "$0 : $path is not a directory" >&2; exit 1; }
 
 case "$path" in    # only escape if string needs it

(Sorry, I don't really have time to find out how to submit patches to git* at this point ...)
I tried it and now this works as expected:

$ bl-places-pipemenu /

... but it is ugly (there are '//' all over menus in GUI). I will try to find yet what else I have to change to get desired correct menu, and get back with solution here.

Last edited by iMBeCil (2019-03-25 21:31:41)


Postpone all your duties; if you die, you won't have to do them ..

Offline

#7 2019-03-25 21:30:35

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: [SOLVED] How to show everything with places pipemenu?

Instead of editing previous post, here is corrected solution for described problem, and it is simpler than solution in post above:

$ diff -u /usr/bin/bl-places-pipemenu-dist /usr/bin/bl-places-pipemenu
--- /usr/bin/bl-places-pipemenu-dist	2019-03-25 13:17:12.190489853 +0100
+++ /usr/bin/bl-places-pipemenu	2019-03-25 22:27:35.256212511 +0100
@@ -112,8 +112,8 @@
 esac
 
 path="${1:-$HOME}"  # default starting place is ~, otherwise $1
-path="${path%/}"
 [ -d "$path" ] || { echo "$0 : $path is not a directory" >&2; exit 1; }
+path="${path%/}"
 
 case "$path" in    # only escape if string needs it
 *\&*|*\<*|*\>*|*\"*|*\'*)

Effectively, order of the lines 115 and 116 in original bl-places-pipemenu has to be (only) interchanged!

Now everything behaves as intended. I tested it with '/' as the argument, and without arguments.

Last edited by iMBeCil (2019-03-25 21:34:29)


Postpone all your duties; if you die, you won't have to do them ..

Offline

#8 2019-03-25 21:45:32

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [SOLVED] How to show everything with places pipemenu?

^ Nice find smile

With that tweak, I now have this in menu.xml:

        <menu execute="bl-places-pipemenu" id="pipe-placesmenu" label="Places $HOME"/>
        <menu execute="bl-places-pipemenu /" id="pipe-placesmenu-all" label="Places FileSystem"/>

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#9 2019-03-26 08:59:58

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,560
Website

Re: [SOLVED] How to show everything with places pipemenu?

^^That's very elegant!
At first I was baffled as to how the pipemenu would deal with / when the trailing slash had been removed, but it gets put back on at line 155

for i in "$path"/* $extra_entries

Thanks! I'll put that in the Lithium version.

To be honest, I'd really prefer $path to be / in the root filesystem case, rather than unset, but that will require a bit more code rewriting...

Last edited by johnraff (2019-03-26 09:03:33)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#10 2019-03-26 10:16:03

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: [SOLVED] How to show everything with places pipemenu?

^ & ^^ You're welcome, glad to help  wink


Postpone all your duties; if you die, you won't have to do them ..

Offline

Board footer

Powered by FluxBB