Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Focus emacs from everywhere
#!/bin/bash
#if emacs is running focus emacs
#else run emacs
if [ $(wmctrl -l | grep XXX--Emacs--XXX | awk '{ print $4 }') == XXX--Emacs--XXX ]; then
#you should put this line to your init.el or .emacs file
#(setq frame-title-format "XXX--Emacs--XXX")
wmctrl -a XXX--Emacs--XXX
else
#directory of emacs
/usr/bin/emacs
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.