You are not logged in.
Pages: 1
Hi all,
You might remember autojump, which is a little tool I made which is a cd command that "learns" from your usage of the CLI. There's been significant progress since the last post:
1) We now support zsh completely, including autocompletion. I think this should please a number of people, give the number of zsh zealots in these forums
2) A user contributed a little applet which displays an icon in the notification area. The icon allows you to quickly open a terminal or file browser in the most used directories.
3) Performance has been improved by running the prompt command in the background.
The package is not up to date yet because I don't feel the features have been tested enough for a big release, but if you want to test and report bugs to the autojump forum (http://n2.nabble.com/autojump-f2340094.html), that would help a lot.
Github page for the project: http://wiki.github.com/joelthelion/autojump
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
I just read this now. Looking for zsh compatibility with autojump... THANKS
For now all I can say is: WHOO it works
My coding blog (or an attempt at it)
Archer start page (or an attempt at it)
Offline
I just read this now. Looking for zsh compatibility with autojump... THANKS
For now all I can say is: WHOO it works
Great! Thanks for testing!
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
i may have a biased point of view but i must say that autojump changed my life!!! especially the applet
Offline
The package is not up to date yet because I don't feel the features have been tested enough for a big release, ...
Why not upload an autojump-git pkg then?
Offline
lardon wrote:The package is not up to date yet because I don't feel the features have been tested enough for a big release, ...
Why not upload an autojump-git pkg then?
I hope the official package will be updated soon. There is also a simple install script that works very well for people who don't want to wait. Anyways, if someone updates a git package, I will vote for it
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Here you go, feel free to take over and post the files somewhere under your ownership.
PKBUILD:
# Contributor: Sean Escriva <sean.escrivaATgmail.com>
pkgname=autojump-git
pkgver=20090421
pkgrel=1
pkgdesc="A cd command that learns"
url="http://github.com/joelthelion/autojump/tree/master"
arch=('i686' 'x86_64')
license=('GPL')
depends=('bash' 'python')
makedepends=('git')
conflicts=('autojump')
provides=('autojump')
replaces=()
backup=()
source=()
install=(${pkgname}.install)
md5sums=('')
_gitroot="git://github.com/joelthelion/autojump.git"
_gitname="autojump"
build() {
cd ${srcdir}
msg "Connecting to github.com GIT server...."
if [ -d ${srcdir}/$_gitname ] ; then
cd $_gitname && git pull origin
msg "The local files are updated."
else
git clone $_gitroot
fi
msg "GIT checkout done or server timeout"
msg "Starting script install..."
git clone $_gitname $_gitname-build
cd ${srcdir}/$_gitname-build
install -Dm 755 autojump "$pkgdir"/usr/bin/autojump
install -Dm 755 jumpapplet "$pkgdir"/usr/bin/jumpapplet
install -Dm 755 autojump.sh "$pkgdir"/etc/profile.d/autojump.sh
install -Dm 755 autojump.zsh "$pkgdir"/etc/profile.d/autojump.zsh
gzip -f autojump.1
install -Dm 644 autojump.1.gz "$pkgdir"/usr/share/man/man1/autojump.1.gz
install -Dm 644 icon.png "$pkgdir"/usr/share/autojump/icon.png
}
# vim:set ts=2 sw=2 et:
autojump-git.install:
#This code is licensed under the GPL, version 3.
#A full copy of the license can be obtained at http://www.gnu.org/licenses/gpl-3.0.html
# arg 1: the new package version
post_install() {
echo " > You need to source /etc/profile in your ~/.bashrc or ~/.zshrc for autojump to work"
echo " > man autojump for instructions."
/bin/true
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
post_install $1
/bin/true
}
op=$1
shift
$op $*
# vim:set ts=2 sw=2 et:
Offline
imho the dictionary should be saved after deleting dead directories
and maybe exclude /tmp/* as this will likely produce dead directories. but that's up to you.
great program! love it
Last edited by robmaloy (2009-04-22 08:59:08)
☃ Snowman ☃
Offline
Thanks for the contibution! Please post the PKGBUILD to AUR.
here you go: http://aur.archlinux.org/packages.php?ID=25870
Offline
lardon wrote:Thanks for the contibution! Please post the PKGBUILD to AUR.
here you go: http://aur.archlinux.org/packages.php?ID=25870
Great, thanks!
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
imho the dictionary should be saved after deleting dead directories
That's definitely a bug... I don't really know how to fix it though. I will try to take a more in-depth look at it this week-end. Thanks for reporting!
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
just add the bold line
def match(path,pattern,path_dict,re_flags=0):
import re
if os.path.realpath(os.curdir)==path : return False
if re.search(pattern,"/".join(path.split('/')[-1-pattern.count('/'):]),re_flags) is None:
return False
else:
if os.path.exists(path) : return True
else: #clean up dead directories
del path_dict[path]
save(path_dict, dic_file)
return False
☃ Snowman ☃
Offline
just add the bold line
def match(path,pattern,path_dict,re_flags=0):
import re
if os.path.realpath(os.curdir)==path : return False
if re.search(pattern,"/".join(path.split('/')[-1-pattern.count('/'):]),re_flags) is None:
return False
else:
if os.path.exists(path) : return True
else: #clean up dead directories
del path_dict[path]
save(path_dict, dic_file)
return False
Well of course, that will work, but it will sync the file for every path it doesn't find..
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
robmaloy wrote:just add the bold line
def match(path,pattern,path_dict,re_flags=0):
import re
if os.path.realpath(os.curdir)==path : return False
if re.search(pattern,"/".join(path.split('/')[-1-pattern.count('/'):]),re_flags) is None:
return False
else:
if os.path.exists(path) : return True
else: #clean up dead directories
del path_dict[path]
save(path_dict, dic_file)
return FalseWell of course, that will work, but it will sync the file for every path it doesn't find..
right, that would be quite inefficient
☃ Snowman ☃
Offline
I've added a fix, it's not the most elegant code, but it should work and be efficient:
diff --git a/autojump b/autojump
index 6b67b9f..43e8393 100755
--- a/autojump
+++ b/autojump
@@ -8,6 +8,7 @@ from sys import argv,exit
import os
import signal
max_keyweight=1000
+dead_dirs=False #global variable (evil ;-) to know if we should save the dict at the end
def signal_handler(arg1,arg2):
print "Received SIGINT, trying to continue"
@@ -29,6 +30,7 @@ def match(path,pattern,path_dict,re_flags=0):
if os.path.exists(path) : return True
else: #clean up dead directories
del path_dict[path]
+ dead_dirs=True
return False
def save(path_dict,dic_file):
@@ -118,6 +120,8 @@ else:
dirs.sort(key=lambda e:e[1],reverse=True)
if completion or not results: #if not found, try ignoring case. On completion always show all results
find_matches(dirs,pattern,path_dict,results,re_flags=re.IGNORECASE,max_matches=9)
+ if dead_dirs: #save the dict if there were some non-existent directories in the database
+ save(path_dict,dic_file)
if userchoice!=-1:
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
you could also define constants, i.e.
MATCH_FOUND = 0
MATCH_NOTFOUND = 1
MATCH_DEADDIR = 2
which can be returned by match()
or when you stick to the global var, you have to add:
global dead_dirs
before CHANGING the value of dead_dirs in match()
☃ Snowman ☃
Offline
or when you stick to the global var, you have to add:
global dead_dirs
before CHANGING the value of dead_dirs in match()
Thanks, I really suck at writing python :-D It should be fixed now.
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Pages: 1