Skip to content

Instantly share code, notes, and snippets.

@DevonMorris
Last active October 7, 2022 12:32
Show Gist options
  • Save DevonMorris/c43da4f7ff4939b426d071635e8934ff to your computer and use it in GitHub Desktop.
Save DevonMorris/c43da4f7ff4939b426d071635e8934ff to your computer and use it in GitHub Desktop.
i3 open URxvt in current directory, zsh

Add the following to a script in .config/i3/i3_shell.sh

#!/usr/bin/env bash
WHEREAMI=$(cat /tmp/whereami)
i3-sensible-terminal -cd $WHEREAMI

To call store the environment variable WHEREAMI put

export PROMPT_COMMAND="pwd > /tmp/whereami"
precmd() { eval "$PROMPT_COMMAND" }

in your .zshrc

Then edit your i3config to launch your new terminal

# start a terminal
bindsym $mod+Return exec $HOME/.config/i3/i3_shell.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment