Skip to content

Instantly share code, notes, and snippets.

@mlabbe
Created April 30, 2020 18:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlabbe/966bbe9fe46fd4ee74037e2e8acb2969 to your computer and use it in GitHub Desktop.
Save mlabbe/966bbe9fe46fd4ee74037e2e8acb2969 to your computer and use it in GitHub Desktop.
Run Emacsclient on i3wm scratchpad workspace

A small snippet that shows how to run Emacs on the i3 scratch buffer. The i3 scratch buffer can appear and be dismissed with a single keypress, making it extremely useful for note capture.

This setup has been proven to work on FreeBSD 12 but should work anywhere with the paths changed as needed.

# launch scratchpad frame in existing emacs daemon
exec --no-startup-id /usr/local/bin/pad.sh
# when scratchpad frame is launched, move it to the scratchpad workspace
for_window [title="_emacs scratchpad_" class="Emacs"] move scratchpad
#!/bin/sh
# launch emacsclient with special frame name
/usr/local/bin/emacsclient -n -c \
"$HOME/scratch.txt" \
--frame-parameters "((name . \"_emacs scratchpad_\"))"
# launch emacs as daemon after X session starts but
# before i3 "exec" commands run from its config
/usr/local/bin/emacs --daemon
exec i3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment