Come and get them: tree(s)-1.6.0 and 1.7.0 (32-bit & 64 bit)

Miscellaneous tools
Message
Author
User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#21 Post by greengeek »

I just had a tinker to see how I could get some value out of tree as a righclick utility. Attached is a pet for a very raw way to use rightclick to get "tree" to list directory contents in leafpad.

If the pet is of no use please uninstall it before shutting down - don't graft it into your savefile in it's current form. Use for testing/criticism only - and preferably in a "ram only" boot.

The pet installs my script called "treepad" into /root/config/rox.sourceforge.net/OpenWith/.inode_directory
Attachments
treepad_gg-0.1.pet
(842 Bytes) Downloaded 134 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#22 Post by musher0 »

Hi greengeek.

If I may, here's my take on it:

Code: Select all

#!/bin/ash
# musher0, 23 Febr. 2017
# script to run "tree" by right-clicking a directory in a ROX-Filer window
# Dependency: tree
####
> /tmp/treeDir # making sure the recipient is empty
tree "$@" > /tmp/treeDir # dir tree is built
leafpad /tmp/treeDir # dir tree is read
You just need to specify "$@", ROX-Filer does the rest.
No fancy string juggling is needed.

Also, IMO, it is more reliable to save the tree listing to a file and then
ask leafpad to read it, rather than pipe it from tree directly to leafpad.

Respectfully,
Attachments
treepad(1).JPG
(75.93 KiB) Downloaded 145 times
treepad_musher-0.1.pet
(578 Bytes) Downloaded 135 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#23 Post by Flash »

greengeek wrote:
Flash wrote:I'd like to see tree incorporated into ROX-filer's right-click menu.
How would you use it from right click menu?

Would you right click on a directory and select "tree" from the rightclick menu and then have a terminal pop up with the output of the tree command showing the contents of that directory? Is that how you see it working?
That's basically what I had in mind, except no need to specify the directory by right-clicking on it. The contents of the directory ROX is in when you right-click is the one that tree should show. So you'd need to already be in a directory with ROX. But that's only my preliminary thoughts and I'm sure other people will come up with something classier or more elegant or something.

I will say that tree's appearance when displayed in a console leaves a lot to be desired. Perhaps the result could be displayed in a text editor that has a font that looks good. I've saved tree's result as a file before, then opened the file with Geany and edited it to remove the vertical and horizontal lines and display the text with a variable pitch font. Kind of like what musher0 did in his post above, only without the lines, which I find distracting and visually confusing.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#24 Post by musher0 »

@Flash:

Something like this? (Please see pic.)

That's

Code: Select all

tree -afi "$@"
list shown in a less window. With these parms, the path is repeated in
front of every file, though.

Since the less window has an urxvt base, we can easily specify a fancy
font via urxvt, but not in leafpad. The illustration is just an example. If we
follow this route, we can provide any color and contrast as well.

I also suspect that you'd want

Code: Select all

tree -afi $PWD
since you want to call it from the dir itself, and script wise, that's another
can of worms entirely!

BFN.
Attachments
treepad(2).JPG
(50.67 KiB) Downloaded 106 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#25 Post by Flash »

If right-clicking in the ROX window of a directory to call tree would make your script less elegant or more complicated, then I'm fine with not doing it that way. It's not that big a deal, I just thought it might be a good way to go.

As for your picture, it appears that removing the lines also removed the indentation. I like indentation. The end result should look like an outline, in my opinion. "tree -d" already does, except for those pesky lines. Whose idea were they, anyway? :)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#26 Post by musher0 »

Just a thought, Flash...

Maybe using Midnight Commander in tree mode would bring you closer to
what you want, instead of torturing ROX-Filer with scripts!

I just made the most recent version of mc available here.

Some other FMs have a tree mode, such as
XFE -- http://roland65.free.fr/xfe/index.php?page=screenshots
emelfm2 -- http://emelfm2.net/wiki/ScreenShots
three others -- http://askubuntu.com/questions/339125/i ... -finder-in
16 "best" FMs -- https://www.slant.co/topics/2090/~linux-file-managers
Attachments
mc-tree_view(1).JPG
Example of mc used in tree mode. The tree is in the right panel and the files
show up in the left panel.
(54.56 KiB) Downloaded 96 times
Last edited by musher0 on Fri 24 Feb 2017, 03:06, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#27 Post by musher0 »

Flash wrote:If right-clicking in the ROX window of a directory to call tree would make your script less elegant or more complicated, then I'm fine with not doing it that way. It's not that big a deal, I just thought it might be a good way to go.

As for your picture, it appears that removing the lines also removed the indentation. I like indentation. The end result should look like an outline, in my opinion. "tree -d" already does, except for those pesky lines. Whose idea were they, anyway? :)
At the top right of this page: http://mama.indstate.edu/users/ice/tree/,
you can e-mail your dissatisfaction to the man! :lol:
Last edited by musher0 on Fri 24 Feb 2017, 03:04, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#28 Post by musher0 »

@Flash again

Unfortunately with the tree utility, your preferred option is not available!

You either have:
the ANSI lines,
the full path
OR
nothing at all, only the file specs. This last option is useless, of course,
since you don't know in which dir the file is.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#29 Post by Flash »

The file managers I've tried that have tree modes don't show in outline form all the directories that are contained in the top directory like tree does. At least, I couldn't think of a way to make them do it. Instead, they all show only the next level down of directories. You have to click on or open each of those directories to see if it contains directories, etc.. What I'm trying to describe is difficult for me to explain. I hope I managed it.

Okay, well, I was able to get what I wanted by saving the output of tree as a file, then opening the file with Geany and editing it.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#30 Post by musher0 »

Hello again Flash.

Here's another experiment using

Code: Select all

ls -AlR1 "$@"
Who knows? Someone may like it! ;)

BFN
Attachments
lsRpad-0.1.pet
(563 Bytes) Downloaded 121 times
lsRpad.JPG
Result.
(45.4 KiB) Downloaded 74 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#31 Post by greengeek »

Flash wrote:Okay, well, I was able to get what I wanted by saving the output of tree as a file, then opening the file with Geany and editing it.
Flash - any chance of posting an image of what you like the look of?

@musher - nice work with the various options above!

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#32 Post by musher0 »

greengeek wrote:
Flash wrote:Okay, well, I was able to get what I wanted by saving the output of tree as a file, then opening the file with Geany and editing it.
Flash - any chance of posting an image of what you like the look of?

@musher - nice work with the various options above!
Thanks, greengeek.

However, I must confess that you had cleared the trail: I just continued!

And between you and me, yeah, what is it that Flash has in mind exactly?
;) :lol:

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#33 Post by Flash »

I'll work something up to give you an idea. It might take a day or so, I'm kinda busy. :roll:
Last edited by Flash on Sat 25 Feb 2017, 04:29, edited 1 time in total.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#34 Post by Flash »

Hmm, I can't figure out how I removed the lines before. I thought I used Geany, but now I can't find a way to remove the lines in Geany. This would be perfect without the vertical and horizontal lines but with the same indentation below each main heading as it has now and with an extra line feed above each main heading to separate each author a bit more from the others:


├── Carlin, John
│ └── Playing the Enemy
├── Casey, Donis
│ ├── Hell With The Lid Blown Off
│ ├── Hornswoggled
│ ├── The Sky Took Him
│ └── Wrong Hill To Die On
├── Jacques, Brian
│ └── Voyage of Slaves
├── Jakes, John
│ └── Savannah
├── Letts, Elizabeth
│ └── The Perfect Horse
├── McCullough, Colleen
│ └── Morgans Run
├── Pinker, Steven
│ └── The Sense of Style (A++)
├── Price, Richard
│ └── The Whites - NY cop story
└── Robinson, Marilynne
├── Home
└── Lila

The forum is not displaying the last two books (Home and Lila) indented properly.

Post Reply