From 06f23070b052809a6a0bb4d8d42d6fa4c6994e00 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 3 Nov 2023 12:36:17 +0100 Subject: [PATCH] WIP: use Cosmo's emacs --- scripts/p7s/emacs.py | 16 ++++++++++++++++ scripts/pyproject.toml | 1 + 2 files changed, 17 insertions(+) create mode 100644 scripts/p7s/emacs.py diff --git a/scripts/p7s/emacs.py b/scripts/p7s/emacs.py new file mode 100644 index 0000000..d977554 --- /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) diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml index 27e545f..1480d2f 100644 --- a/scripts/pyproject.toml +++ b/scripts/pyproject.toml @@ -23,3 +23,4 @@ db-enter = 'p7s.distrobox:enter' nextcloud_setup = 'p7s.nextcloud:setup_nextcloud' soju_setup = 'p7s.soju:setup_soju' bitlbee_setup = 'p7s.bitlbee:setup_bitlbee' +setup_emacs = 'p7s.emacs:setup_emacs' -- 2.47.3