diff options
-rwxr-xr-x | dwim | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -107,6 +107,9 @@ sub path { return $n if $n =~ /^\// or $n =~ /^~/; my $d = `xtitle`; chomp $d; + $d =~ s/.*\(([^(]+)\)$/$1/; + $d =~ s,^~([^/]+),/home/$1,; + $d =~ s,^~,/home/$ENV{USER},; die "couldn't retrieve current directory\n" if ! -d $d and ! -d ($d = dirname($d)); return "$d/$n"; |