From: Andrew Lorimer Date: Thu, 16 Aug 2018 11:52:13 +0000 (+1000) Subject: handy features for zsh on larry X-Git-Url: https://git.lorimer.id.au/scripts.git/diff_plain/c28a41e4999fe7f9f85caa4ea85958298d8e89f2?ds=sidebyside;hp=--cc handy features for zsh on larry --- c28a41e4999fe7f9f85caa4ea85958298d8e89f2 diff --git a/autocifs.sh b/autocifs.sh new file mode 100755 index 0000000..cccbc71 --- /dev/null +++ b/autocifs.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +# +# Automatically mount samba share on charles.cortex when connected to cortex-lab +# + +ssid=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | sed -e "s/^ *SSID: //p" -e d) + +if [[ $ssid == cortex-lab ]]; then + osascript -e 'mount volume "smb://andrew@charles/andrew"' +fi diff --git a/macopen.sh b/macopen.sh new file mode 100755 index 0000000..51d2746 --- /dev/null +++ b/macopen.sh @@ -0,0 +1,21 @@ +#! /bin/bash + +#include +#include + +exe=$1 +files=${@:2} +path='' + +resolve() { + path=$(realpath $1) + echo $1 +} + +#$(open -a $1 + +for f in $files +do + open -a $exe $(resolve $f) + echo $(resolve $f) +done