This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/shell/shell_funcs

47 lines
796 B
Plaintext
Raw Normal View History

2017-02-07 16:16:45 -06:00
#!/usr/bin/env bash
calc() {
2017-02-08 13:27:09 -06:00
tp="$@"
2017-02-07 16:16:45 -06:00
python -c "print($tp)"
}
export -f calc
stopbar() {
# TODO: get the proper monitor!
bspc config -m "DVI-I-2" bottom_padding "0"
bspc config -m "DVI-I-2" top_padding "0"
killall -q polybar
while pgrep -x polybar >/dev/null; do sleep 1; done
2017-02-07 16:16:45 -06:00
}
export -f stopbar
# wm aliases
startbar() {
bash "$DOTFILES_PATH/de/bar/bar.bash" &
bg
disown
2017-02-07 16:16:45 -06:00
}
export -f startbar
# save the current directory for later retrieval
scwd() {
addon=""
if [[ -n $1 ]]; then
addon="-$1"
fi
echo "$PWD" > "$DOTFILES_PATH/.cwd$addon.tmp"
2017-02-07 16:16:45 -06:00
}
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/.cwd$addon.tmp")"
2017-02-07 16:16:45 -06:00
}
export -f gcwd
bind '"\C-g"':"\"gcwd\C-m\""