Skip to content

Instantly share code, notes, and snippets.

@nefigcas
Created July 6, 2024 06:18
Show Gist options
  • Save nefigcas/ab6b09b8eb730fcf24ad071167a1df9c to your computer and use it in GitHub Desktop.
Save nefigcas/ab6b09b8eb730fcf24ad071167a1df9c to your computer and use it in GitHub Desktop.
#!/bin/bash
# if no args open new frame
if [ $# -eq 0 ]; then
jumpapp -R emacs || emacsclient -nc
exit
fi
emacsclient -e "(frames-on-display-list \"$DISPLAY\")" # &>/dev/null
if [ $? -eq 0 ]; then
jumpapp -R emacs ; emacsclient -n "$*"
else
jumpapp -R emacs || emacsclient -nc "$*"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment