Skip to content

Instantly share code, notes, and snippets.

@enisozgen
Created November 3, 2015 13:14
Show Gist options
  • Save enisozgen/39bd2da923432cddf65f to your computer and use it in GitHub Desktop.
Save enisozgen/39bd2da923432cddf65f to your computer and use it in GitHub Desktop.
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