Skip to content

Instantly share code, notes, and snippets.

@msafadieh
Created July 17, 2020 18:57
Show Gist options
  • Save msafadieh/668b8d2344ad9f15926fa5843f87db01 to your computer and use it in GitHub Desktop.
Save msafadieh/668b8d2344ad9f15926fa5843f87db01 to your computer and use it in GitHub Desktop.
#! /bin/sh
tree="$(i3-msg -t get_tree)"
if echo "$tree" | grep '"scratchpad"'; then
if echo "$tree" | jq '.nodes[0]' | grep Alacritty; then
i3-msg "scratchpad show"
else
i3-msg '[instance="scratchpad"] move scratchpad'
fi
else
i3-msg 'exec alacritty --class "scratchpad"'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment