43 lines
643 B
Text
43 lines
643 B
Text
|
#!/usr/bin/env bash
|
||
|
|
||
|
calc() {
|
||
|
tp="$@"
|
||
|
python -c "print($tp)"
|
||
|
}
|
||
|
export -f calc
|
||
|
|
||
|
stopbar() {
|
||
|
}
|
||
|
export -f stopbar
|
||
|
|
||
|
# wm aliases
|
||
|
startbar() {
|
||
|
}
|
||
|
export -f startbar
|
||
|
|
||
|
# save the current directory for later retrieval
|
||
|
scwd() {
|
||
|
addon=""
|
||
|
if [[ -n $1 ]]; then
|
||
|
addon="-$1"
|
||
|
fi
|
||
|
echo "$PWD" > "$DOTFILES_PATH/env/sh/cwd$addon.tmp"
|
||
|
}
|
||
|
export -f scwd
|
||
|
bind '"\C-s"':"\"scwd\C-m\""
|
||
|
|
||
|
# go to the saved current directory
|
||
|
gcwd() {
|
||
|
addon=""
|
||
|
if [[ -n $1 ]]; then
|
||
|
addon="-$1"
|
||
|
fi
|
||
|
cd "$(cat "$DOTFILES_PATH/env/sh/cwd$addon.tmp")"
|
||
|
}
|
||
|
export -f gcwd
|
||
|
bind '"\C-g"':"\"gcwd\C-m\""
|
||
|
|
||
|
# close a terminal with Ctrl-Shift-D (in theory)
|
||
|
bind '"\C-D"':"\"\C-c\C-d\""
|
||
|
|