blahgeek / emacs-appimage

25 stars 5 forks source link

Scripts to make this even more awesome #5

Open algal opened 1 week ago

algal commented 1 week ago

This is more of a mash note than a GitHub issue. Just wanted to say this project is awesome. I have been trying forever to find a way to install a full emacs without sudo (compiling, nix, etc.), and this is the only thing that has worked.

I'm on a system that doesn't even have fuse2, but I found that extracting the squash-fs filesystem worked perfectly.

One problem this leaves is that all my other scripts which rely on the usual executable names of emacs, emacsclient, etc., don't work right. I was able to resolve this by creating wrapper scripts for every one of the executable, scripts which just call AppRun.

Now an installer script something like the one below suffices to install a full no-xwindows emacs, without root privileges, and it leaves in place executables with the usual names in a ~/bin directory.

I'll share this script here in case you might want to consider adding it to the project in some fashion:

#!/usr/bin/env bash
set -euxo pipefail

cd $HOME/bin

# github repo: https://github.com/blahgeek/emacs-appimage/releases?q=Release&expanded=true

# download nox release: 
curl -L -O https://github.com/blahgeek/emacs-appimage/releases/download/github-action-build-11538673229/Emacs-30.0.92-nox.AppImage

E=Emacs-30.0.92-nox.AppImage
chmod u+x $E
./"$E" --appimage-extract
mkdir emacsdir
mv squashfs-root emacsdir

cat << 'EOF' > ctags
#!/bin/bash
WRAPPER_ROOT="$(dirname "$(readlink -f "$0")")"
exec "$WRAPPER_ROOT/emacsdir/squashfs-root/AppRun" --emacs-appimage-run-as ctags "$@"
EOF

cat << 'EOF' > ebrowse
#!/bin/bash
WRAPPER_ROOT="$(dirname "$(readlink -f "$0")")"
exec "$WRAPPER_ROOT/emacsdir/squashfs-root/AppRun"  --emacs-appimage-run-as ebrowse "$@"
EOF

cat << 'EOF' > emacs
#!/bin/bash
WRAPPER_ROOT="$(dirname "$(readlink -f "$0")")"
exec "$WRAPPER_ROOT/emacsdir/squashfs-root/AppRun" "$@"
EOF

cat << 'EOF' > emacsclient
#!/bin/bash
WRAPPER_ROOT="$(dirname "$(readlink -f "$0")")"
exec "$WRAPPER_ROOT/emacsdir/squashfs-root/AppRun"  --emacs-appimage-run-as emacsclient "$@"
EOF

chmod u+x ctags ebrowse emacs emacsclient
blahgeek commented 5 days ago

Hello,

I'm glad to know that this project is useful to you and thank you for sharing your scripts. I have no doubt that it's useful for you and some others, however, I personally don't really want to add it to the project as an "official supported way" to install. The one main advantage of AppImage is that it's a single-file-executable that users can simply download and execute. I really want to keep it simple and easy, without introduction of further installation scripts or step guides (optionally or not), which may confuses the users and possibly brings more maintenance overhead. What's more, users have different use cases or environments, so I would expect users find solutions that suites their own needs.

You are welcome to edit the wiki if you like (the wiki of this project is now editable by anyone), or just leave the issue here so people may find what they want here.

Again, thanks for your contribution.