diff --git a/init.el b/init.el deleted file mode 100644 index cce1c13..0000000 --- a/init.el +++ /dev/null @@ -1,15 +0,0 @@ -;;; init.el --- Icemacs -;; Author: Kenish -;;; Commentary: -;;; The Ultimate Emacs Setup! -;;; Code: - -;; Custom file garbage -(setq-default custom-file (expand-file-name ".custom.el" user-emacs-directory)) -(when (file-exists-p custom-file) ; Don’t forget to load it, we still need it - (load custom-file)) - -;; Org hook -(org-babel-load-file (expand-file-name "bwoah.org" user-emacs-directory)) - -;;; init.el ends here diff --git a/setup-icemacs.sh b/setup-icemacs.sh new file mode 100755 index 0000000..a98c85e --- /dev/null +++ b/setup-icemacs.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Define the paths +EMACS_DIR="$HOME/.emacs.d" +INIT_ORG="$EMACS_DIR/bwoah.org" +INIT_EL="$EMACS_DIR/init.el" + +# Check if init.el exists +if [ ! -f "$INIT_EL" ]; then + echo "Generating init.el from bwoah.org..." + # Use Emacs in batch mode to tangle init.org + emacs --batch --eval "(require 'org)" --eval "(org-babel-tangle-file \"$INIT_ORG\" \"$INIT_EL\")" + echo "init.el generated. Starting package installation..." + + # Start Emacs in batch mode to install packages + emacs --batch -l "$INIT_EL" --eval "(package-refresh-contents)" --eval "(package-install-selected-packages)" --eval "(kill-emacs)" + + echo "Package installation complete. Icemacs is ready!" +else + echo "init.el already exists." +fi