commit 13023c05f11a342147c173cb5a0f2b4b32216462 parent 17bc5f457203b7a5bef0895d4422fcde9b3a06fe Author: Alex Balgavy <a.balgavy@gmail.com> Date: Sat, 14 Apr 2018 20:32:27 +0200 Added gdf() function that gets path to current finder window Diffstat:
M | .commonprofile | | | 17 | ++++++++++------- |
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/.commonprofile b/.commonprofile @@ -36,7 +36,7 @@ alias startpg="pg_ctl -D $(brew --prefix)/var/postgres start" ### MORE COMPLEX FUNCTIONS ### pip3-upgrade() { - pip3 list --outdated | cut -d ' ' -f1 | xargs -n1 pip3 install -U + pip3 list --outdated | cut -d ' ' -f1 | xargs -n1 pip3 install -U } notify() { @@ -101,12 +101,15 @@ current_wifi_password() { } cdf() { - target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'` - if [ "$target" != "" ]; then - cd "$target"; pwd - else - echo 'No Finder window found' >&2 - fi + target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'` + if [ "$target" != "" ]; then + cd "$target"; pwd + else + echo 'No Finder window found' >&2 + fi +} +gdf() { + echo `osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'` }