aboutsummaryrefslogtreecommitdiff
path: root/scripts/p7s/emacs.py
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2023-11-03 12:36:17 +0100
committeralex <alex@pdp7.net>2023-11-05 10:48:10 +0100
commit06f23070b052809a6a0bb4d8d42d6fa4c6994e00 (patch)
tree3148989c1139448513f71600313483a3481bff19 /scripts/p7s/emacs.py
parent1936d016fa756acc55768a27fc956de218e0aa3d (diff)
WIP: use Cosmo's emacs
Diffstat (limited to 'scripts/p7s/emacs.py')
-rw-r--r--scripts/p7s/emacs.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/p7s/emacs.py b/scripts/p7s/emacs.py
new file mode 100644
index 00000000..d977554f
--- /dev/null
+++ b/scripts/p7s/emacs.py
@@ -0,0 +1,16 @@
+import pathlib
+import textwrap
+
+
+def setup_emacs():
+ bin = pathlib.Path.home() / ".local" / "bin"
+ emacs = bin / "emacs"
+ emacs.write_text(textwrap.dedent("""
+ #!/bin/sh
+
+ ~/.cache/cosmo/bin/emacsclient --create-frame -t "$@" || {
+ ~/.cache/cosmo/bin/emacs --daemon --user=""
+ ~/.cache/cosmo/bin/emacsclient --create-frame -t "$@"
+ }
+ """))
+ emacs.chmod(0o755)