Last active
June 14, 2022 04:51
-
-
Save ratmice/72705ded485c59931c221fb6b05944ad to your computer and use it in GitHub Desktop.
launch another wezterm in the current directory (sway)...
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/sh | |
alias wezterm=~/.cargo/bin/wezterm | |
if [ $(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true and .window_properties.class == "org.wezfurlong.wezterm").window_properties.class, select(.focused==true and .app_id =="org.wezfurlong.wezterm").app_id') ]; | |
then | |
PANE_ID=$(wezterm cli list-clients --format json | jq '.[] | .focused_pane_id') | |
WORKDIR=$(wezterm cli list --format json | jq -r ".[] | select(.pane_id == $PANE_ID).cwd") | |
wezterm cli spawn --new-window --cwd ${WORKDIR#file://} | |
false | |
else | |
wezterm | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment