You are not logged in.

#1 2010-08-25 13:23:36

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Pithy - A tiny console file browser

Pithy is a console file browser, a branch of ranger which focuses on shortness and simplicity of the code and integration into the shell while retaining rangers basic features and looks. Its size is less than 1000sloc (about a tenth of ranger) which makes it great for people who want to tinker with the code.

Screenshot:
screenshot2.png
(yes, this is actually a screenshot of ranger, but they both look the same anyway)


There is no README file or other documentation, so here's an introduction:

Pithy is not started by executing a file but by executing a bash/zsh function. First you need to source either bash_integration.sh or zsh_integration.zsh, depending on your shell. Either file takes the command to run the program as an argument, which is a simple "/path/to/pithy.py" in most cases but can be as complex as python2.6 "/path/to/pithy.py" --option1 .... So, the full line looks like:

source /path/to/bash_integration.py /path/to/pithy.py

It defines the function bash_pithy or zsh_pithy and the hotkey CTRL+O for quickly starting it. Read the *_integration-file for details.

The configuration file puts the pieces together which the pithy "library" provides you. It is about 300 lines long and you may want to skim through it to grasp the concept and the control keys. It is located at pithy/data/settings.py and can be copied to ~/.config/pithy/rc.py for customization. The settings file is executable python code which is run on initialization. First the default settings.py, then the custom rc.py. To ignore the default settings, use the option --no-defaults.
To run files, you have to set up a file launcher. Try http://xyne.archlinux.ca/projects/mimeo/

echo 'FILE_LAUNCHER = "mimeo %f"' >> ~/.config/pithy/rc.py

The interface is much like in ranger. Main differences as of now: No automatic synchronization with the FS, type "r" to update the view. No parallel loading either, the unicode support is limited and there is no console, just very simple prompts.
Bookmarks are implemented using the file system. Type m<name><ENTER> to create a link at $confdir/bookmarks/<name>, then type ` or ' to go there and pick a directory.
Instead of the console, use the shell. Quitting and restarting pithy will restore almost the same state (which you can reset with pithy --reset.) The variable $f contains the current filename. You need to use "$f" in bash if the filename contains spaces. The command sel runs xargs with the selected files as arguments. For example, type sel echo to display all selected files or sel mv -t /some/directory to move all selected files to /some/directory. Files are selected with SPACE or v and unselected with V. In contrast to ranger, the selection is global.

To install and run:

git clone http://git.sv.gnu.org/r/ranger.git pithy
cd pithy
git checkout slim
source bash_integration.sh /path/to/pithy.py # if you use zsh, source zsh_integration.zsh instead

And start pithy with ctrl+O.
(Note: There's a little bug with the bash-version: when exiting pithy, the directory is changed but the old one is still displayed in the prompt. I don't know how to make bash update it. Pressing ENTER fixes it though.)

I guess thats about it. Feel free to ask your questions

Btw: I'm not working on this at the moment. I'm posting this just so it's out there.

Last edited by hut (2010-08-25 13:40:54)


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

Board footer

Powered by FluxBB