108 lines
5.6 KiB
Org Mode
108 lines
5.6 KiB
Org Mode
#+TITLE: CBSH Postinstall Scripts (very original name i swear)
|
|
#+DESCRIPTION: A Bunch of Postinstall Scripts im calling CBSH
|
|
#+AUTHOR: Cabooshy (Cameron Miller)
|
|
#+PROPERTY: header-args :tangle cbsh
|
|
#+STARTUP: showeverything
|
|
|
|
* TABLE OF CONTENTS :toc:
|
|
- [[#about-cbsh][About CBSH]]
|
|
- [[#installing-cbsh][Installing CBSH]]
|
|
- [[#install-instructions][Install Instructions]]
|
|
- [[#potential-bugs][Potential Bugs]]
|
|
- [[#updating-cbsh][Updating CBSH]]
|
|
- [[#contributing-to-cbsh][Contributing to CBSH]]
|
|
- [[#edit-the-readmeorg][Edit The README.org]]
|
|
- [[#test-your-changes-locally-first][TEST. YOUR. CHANGES. LOCALLY. FIRST.]]
|
|
- [[#shebang-plus-comments][Shebang plus Comments]]
|
|
- [[#check-that-user-is-not-root][Check that user is NOT root!]]
|
|
- [[#error-handling][Error Handling]]
|
|
|
|
* About CBSH
|
|
CBSH is the name for a set of Linux Postinstall Scripts that give you my set of programs i use and my Desktop Layout, for both Arch and Debian based distros.
|
|
|
|
* Installing CBSH
|
|
** Install Instructions
|
|
To Install CBSH you'll need to clone the repo and run the shell script relevent to your distro's base. As an example, Ubuntu, Mint, Pop!_OS etc. should use the ~Debian~ Script like so:
|
|
#+begin_example
|
|
git clone https://gitlab.com/cabooshyy/cbsh
|
|
cd cbsh
|
|
./cbsh_deb
|
|
#+end_example
|
|
|
|
** Potential Bugs
|
|
*** Slow Download Times
|
|
These Scripts can take a LONG time to complete as there are around 200 packages. On Arch, make sure you are using ParallelDownloads in /etc/pacman.conf for faster download times, for example changing ParallelDownloads so that it downloads up to five packages at a time:
|
|
#+begin_example
|
|
ParallelDownloads = 5
|
|
#+end_example
|
|
|
|
*** DOOM Emacs isn't launching
|
|
After the install completes, DOOM Emacs may not launch properly the very first time, killing the Emacs Daemon (Emacs Server) if it is running, and restarting it fixes this issue.
|
|
#+begin_example
|
|
killall emacs
|
|
/usr/bin/emacs --daemon &
|
|
#+end_example
|
|
|
|
* Updating CBSH
|
|
CBSH is updated via your package manager, such as APT on Debian Based Installs and Pacman on Arch Based Installs
|
|
|
|
So For Example, Updating on Arch would be the standard way, as below:
|
|
#+begin_example
|
|
sudo pacman -Syu
|
|
#+end_example
|
|
|
|
And on Debian:
|
|
#+begin_example
|
|
sudo apt update && sudo apt upgrade
|
|
#+end_example
|
|
|
|
Many of CBSH's Packages are actually configuration files, these will get stored in /etc/cbsh, as we don't want to overwrite any config files you may already have on your system accidentally. If you'd like to use them, then you'd need to manually copy them from /etc/cbsh into $HOME.
|
|
=NOTE:= You do not need to run the CBSH install script more than once, if you succeeded in installing CBSH then you'll have access to the CBSH Repos and all of the Packages stored in them, so when a new update arrives and it installs packages that you don't have, you can simply install them via APT or Pacman.
|
|
|
|
* Contributing to CBSH
|
|
Contributions from other people are welcomed. especially for distro's i have no experience with, like Fedora, but there are a few things you will need to consider before making a merge request.
|
|
** Edit The README.org
|
|
I get some people are not well versed in the emacs way of doing things, but this very readme is the postinstall script. Utilising ORG-Mode's magic, i convert the ~README.org~ into both ~cbsh~ scripts. So by editing the main scripts directly and making a merge request, especially for huge changes, makes a lot more work than what is needed, as i'd have to manually edit the ~README.org~ to make it conform to the changes you proposed in your merge request. So please, edit the ~README.org~ that relates to the base you are running.
|
|
|
|
I Will include a conversion script for non emacs users so they can edit the corresponding (or new!) ~README.org~ with whatever Text-Editor/IDE they want, and then convert it into the script to see if it exports correctly.
|
|
|
|
** TEST. YOUR. CHANGES. LOCALLY. FIRST.
|
|
It would be a very, very good idea to have a local VM with a clean installation of your distro of choice, and clone the clean VM when you need to test the script. Please don't make a merge request without actually testing your changes first in a ~fresh VM~ (One you have not run the script on before).
|
|
|
|
* Shebang plus Comments
|
|
#+begin_src bash :shebang "#!/usr/bin/env bash"
|
|
# ____ ____ ____ _ _
|
|
# / ___|| __ )/ ___| | | | |
|
|
# | | | _ \\___ \ | |_| |
|
|
# | |___ | |_) |___) || _ |
|
|
# \____||____/|____/ |_| |_|
|
|
#
|
|
# NAME: CBSH -- ARCH
|
|
# DESC: An installation and deployment script that installs Cabooshy's Desktop on Arch Linux and Arch based Distro's
|
|
# WARNING: Run this script at your own risk.
|
|
# DEPENDENCIES: dialog
|
|
#+end_src
|
|
|
|
* Check that user is NOT root!
|
|
Don't run this script as root! This is done for safety reasons, as this script makes a lot of changes to the $HOME of the $USER of this script. For obvious reasons, we want $USER to not be 'root' and $HOME not to be '/root'. Instead, run this script as a normal user. You will be asked to enter a sudo password at several points when needed.
|
|
|
|
#+begin_src bash
|
|
if [ "$(id -u)" = 0 ]; then
|
|
echo "#######################################################################"
|
|
echo "This script MUST NOT be run as root user since it makes changes to the"
|
|
echo "\$HOME directory of the \$USER executing this script. We dont want"
|
|
echo "those to be 'root' and '/root',We don't want to mess around in there"
|
|
echo "and potentially break something, So run this script as a normal user."
|
|
echo "You will be asked for a sudo password when necessary."
|
|
echo "######################################################################"
|
|
exit 1
|
|
fi
|
|
#+end_src
|
|
|
|
* Error Handling
|
|
#+begin_src bash
|
|
err() { \
|
|
clear; printf "ERR:\\n%s\\n" "$1" >&2; exit 1;
|
|
}
|
|
#+end_src
|