123456789101112131415161718 |
- # this is for making new terminals cd to the same directory of existing ones
- if [[ -x $(which xdotool 2> /dev/null) ]] && [[ -n "$DISPLAY" ]] then
- CURRDESKTOP=$(xdotool get_desktop)
- PWDFILE="$HOME/.config/bspwm/$CURRDESKTOP.pwd"
- function chpwd {
- pwd > $PWDFILE
- }
- ACTIVEWIN=$(xdotool search --desktop $CURRDESKTOP --class $TERMINAL | wc -l)
- if [[ $ACTIVEWIN -le 1 ]]; then
- chpwd
- else
- cd "$(cat $PWDFILE)"
- fi
- fi
|