You are not logged in.
I've been casually working on a file browser that has a similar interface like ranger, but takes a different approach, in that it is written in bash POSIX shell.
I wanted to combine the elegance, portability and simplicity of a short bash shell script with the ability to get me whereever I want ASAP without the "cd TAB TAB TAB" boilerplate. Additionally, it can use ranger's file opener "rifle" to execute files just the way ranger does.
I'm not finished yet, but there is a working alpha version at github:
It uses the basic h/j/k/l vim type movement control keys. Check the source for more key bindings, it makes no sense to write a complete list at this stage of development.
And the obligatory screen shot:
As you can see, there are no miller columns like in ranger. That may or may not change in the future. I suspect it would be too slow in shell script.
Pro tip: if you run lscd with the command ". lscd", it will run in the current bash environment, rather than in a new one. Only this way the directory will actually change after you close lscd.
Last edited by hut (2014-09-11 12:13:45)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
written in bash.
I notice that you aren't actually writing this in bash, but posix shell.
Additionally, it can use ranger's file opener "rifle" to execute files just the way ranger does.
Seems more like a hard dependency. Even drilling down into a directory fails without rifle installed.
I'm not finished yet, but there is a working alpha version at github
Aliasing ls will break (e.g. alias ls='ls --color') this. You shouldn't be using ls at all, but rather glob expansion....
Last edited by falconindy (2014-08-14 17:39:24)
Offline
hut wrote:Additionally, it can use ranger's file opener "rifle" to execute files just the way ranger does.
Seems more like a hard dependency. Even drilling down into a directory fails without rifle installed.
Currently it thinks that symlinks are files and tries to open them. Maybe you tried entering a symlink to a directory?
Aliasing ls will break (e.g. alias ls='ls --color') this. You probably shouldn't be using ls at all, but glob expansion....
Strange, I aliased ls to "ls --color" too and it works for me.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Really cool.
Aliasing ls will break (e.g. alias ls='ls --color') this. You shouldn't be using ls at all, but rather glob expansion....
In case you source it it will use the alias/function, so indeed, be careful with that.
Here's a template I always use for adding cursor movement:
(starting with line 147)
(adjust to posix shell yourself)
(the -t 0.01 newinput is "beatable" like if you hold the cursor newinput will get larger. That's why there's a "$newinput" =~ [~A-Da-d] for cursor keys and shift+cursor keys)
read -n 1 -s input
if [[ "$input" == $'\e' ]]; then
input=ESC
while true; do
read -n 1 -s -t 0.01 newinput < /dev/tty
[[ "$newinput" == $'\e' ]] && newinput=ESC
input=${input}${newinput}
[[ -z "$newinput" || "$newinput" =~ [~A-Da-d] ]] && break
done
fi
case "$input" in
'ESC[A') "code for up, etc"
;; #Up
'ESC[B')
;; #Down
'ESC[6~')
;; #Page Down
'ESC[5~')
;; #Page Up
'ESC[4~'|'ESC[F'|'ESC[8~'|'ESCOF')
;; #End
'ESC[1~'|'ESC[H'|'ESC[7~'|'ESCOH')
;; #Home
'ESC[D')
;; #Left
'ESC[C')
;; #Right
'ESC[3~')
;; #Delete
Offline
Here's a template I always use for adding cursor movement:
Nice, I was already wondering how to do this. Thanks!
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
There has been some progress with lscd. It's now fully POSIX-compatible and getting more and more stable and efficient.
In addition, somebody forked lscd in bash and actually implemented miller columns. His repository is here: https://github.com/D630/blscd
For the zsh folks there is also a zsh-reimplementation of ranger that arose independently of lscd, also with miller columns: https://github.com/Vifon/deer
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline