Create the concept of enabled plugins
This allows users to disable a plugin without completely removing it. Instead, they simply remove the `plugins/enabled/*.bash` file for the plugin they want to disable. This continues the concept of "everything on" while providing greater flexibility to future users. It might be a good idea to allow turning these off by default in the future and allowing not only the `plugins/enabled/*.bash` files but also an array of `<plugin_name>` values that would search for `plugins/available/<plugin_name>.plugin.bash` to enable them. That method would make it easier for people custom tune their plugins from within their `.bash_profile` script.
This commit is contained in:
37
plugins/available/osx.plugin.bash
Normal file
37
plugins/available/osx.plugin.bash
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
function tab() {
|
||||
osascript 2>/dev/null <<EOF
|
||||
tell application "System Events"
|
||||
tell process "Terminal" to keystroke "t" using command down
|
||||
end
|
||||
tell application "Terminal"
|
||||
activate
|
||||
do script with command "cd \"$PWD\"; $*" in window 1
|
||||
end tell
|
||||
EOF
|
||||
}
|
||||
|
||||
# this one switches your os x dock between 2d and 3d
|
||||
# thanks to savier.zwetschge.org
|
||||
function dock-switch() {
|
||||
|
||||
if [ $(uname) = "Darwin" ]; then
|
||||
|
||||
if [ $1 = 3d ] ; then
|
||||
defaults write com.apple.dock no-glass -boolean NO
|
||||
killall Dock
|
||||
|
||||
elif [ $1 = 2d ] ; then
|
||||
defaults write com.apple.dock no-glass -boolean YES
|
||||
killall Dock
|
||||
|
||||
else
|
||||
echo "usage:"
|
||||
echo "dock-switch 2d"
|
||||
echo "dock-switch 3d."
|
||||
fi
|
||||
else
|
||||
echo "sorry. you're currently not using os x"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user