dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 5752cb94bc2303abbb8fcaa51f75eebe452f87c8
parent 41f0b45d89017d34180a55546dded8373fb931b1
Author: Alex Balgavy <a.balgavy@gmail.com>
Date:   Tue, 29 May 2018 16:33:44 +0200

Added function to return currently selected Finder item

Diffstat:
Mcommonprofile | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/commonprofile b/commonprofile @@ -13,11 +13,14 @@ alias rrsync='rsync -avhW --progress --remove-source-files' # Rsync, but rem alias top='sudo htop' # Top should launch htop with sudo alias g='git' alias r='ranger' + +### SIMPLE FUNCTIONS ### cd() { builtin cd -P "$@"; ls; } # List contents after cding mkcd() { mkdir -p -- "$1" && cd -P -- "$1" } # Make dir and cd at the same time procinfo() { ps -aux | grep $1 } # Get info about a process (by name) rmempty() { find ${1-.} -type d -empty -depth -delete } # Remove empty directories -batterypct() { ioreg -l | awk '$3~/Capacity/{c[$3]=$5}END{OFMT="%.2f%%";max=c["\"MaxCapacity\""];print(max>0?100*c["\"CurrentCapacity\""]/max:"?")}' | sed 's/\..*//' } +fsel() { osascript -e 'tell application "Finder" to return POSIX path of (first item of (get selection as alias list) as alias)' | rev | sed 's/^\///' | rev; } +batterypct() { ioreg -l | awk '$3~/Capacity/{c[$3]=$5}END{OFMT="%.2f%%";max=c["\"MaxCapacity\""];print(max>0?100*c["\"CurrentCapacity\""]/max:"?")}' | sed 's/\..*//'; } ### DOUG SCRIPTS TRIAL RESET ### alias rs_notinplaylist="rm /Users/alex/Library/iTunes/.ntnny.txt"