Skip to content

Instantly share code, notes, and snippets.

@kabeersvohra
kabeersvohra / i3-shell.sh
Last active May 5, 2021 16:54
Bash script for i3 to run terminal in the same working directory as active window running tmux
#!/bin/bash
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
# based on https://gist.github.com/viking/5851049 and https://gist.github.com/TiddoLangerak/c61e1e48df91192f9554
CWD=''
CMD='/usr/bin/x-terminal-emulator'
# Get window ID
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")