Created
May 17, 2019 23:44
-
-
Save konsumer/d045da02e7e97f59fdad07989a42ab0c to your computer and use it in GitHub Desktop.
Open a new tab in xfce4-terminal, if it's running, and cd to wherever the last-run zsh is
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# use tabs if terminal is running, otherwise new window | |
# designed for use with meta-T to open new terminal window/tab | |
XPID=$(pgrep zsh -o) | |
if [ "${XPID}" != "" ];then | |
cwd=$(pwdx $XPID|sed -e "s/${XPID}: //") | |
cwd=${cwd:-$HOME} | |
xfce4-terminal --tab --default-working-directory="${cwd}" | |
else | |
xfce4-terminal | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment