Update Readme~

This commit is contained in:
Cameron Miller 2022-03-12 19:08:43 +00:00
parent b7926f56e7
commit 6a5a0f40a2
3 changed files with 62 additions and 31 deletions

View File

@ -1,5 +1,5 @@
#+TITLE: CBSH Postinstall Scripts (very original name i swear)
#+DESCRIPTION: A Bunch of Postinstall Scripts im calling CBSH
#+TITLE: Cabooshy's Shell (CBSH)
#+DESCRIPTION: CBSH, or Cabooshy's Shell, is a Post installation Script for Arch Linux, and Arch Based Distro's, it installs his Qtile Based desktop and the Apps he uses.
#+AUTHOR: Cabooshy (Cameron Miller)
#+PROPERTY: header-args :tangle cbsh
#+STARTUP: showeverything
@ -29,7 +29,8 @@
- [[#installation-complete][Installation Complete!]]
* 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 [[https://gitlab.com/Cabooshyy/cbsh-deb][Debian]] based distros.
Cabooshy's Shell (CBSH) is a Post Install Script for Arch Linux and Arch based Distro's, it installs my Qtile Desktop, and programs i use on a daily basis, like Emacs.
* Installing CBSH
** Install Instructions
@ -54,33 +55,41 @@ 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
CBSH is updated via your package manager.
So For Example, Updating on Arch would be the standard way, as below:
So For Example, Updating would be done the standard way, as below:
#+begin_example
sudo pacman -Syu
$ sudo pacman -Syu
#+end_example
If you have a AUR Helper installed to, do not forget to add that as well.
And on Debian:
If you have a AUR Helper installed, you can use that instead:
#+begin_example
sudo apt update && sudo apt upgrade
yay (or yay -Syu)
paru (or paru -Syu)
pikaur -Syu
#+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 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~.
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"
# ____ ____ ____ _ _
@ -95,6 +104,7 @@ It would be a very, very good idea to have a local VM with a clean installation
# 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.
@ -111,6 +121,7 @@ if [ "$(id -u)" = 0 ]; then
fi
#+end_src
* Error Handling
#+begin_src bash
err() { \
@ -118,6 +129,7 @@ err() { \
}
#+end_src
* Sync The Repos, and Install 'dialog'
#+begin_src bash
echo "##########################################################################"
@ -126,6 +138,7 @@ echo "########################################################################"
sudo pacman --noconfirm --needed -Syu dialog || error "Error syncing the repos."
#+end_src
* The Welcome Message
#+begin_src bash
welcome () { \
@ -136,8 +149,8 @@ dialog --colors --title "\Z7\ZbStay Near your PC!" --yes-label "Continue" --no-l
welcome || err "User choose to exit."
#+end_src
* Adding the CBSH Repos to your system.
Right now nothing is signed as i'm still testing stuff between my work PC and home PC and dealing with two seperate gpg keys is a pain so for now everything is unsigned, once everything is working properly i will be signing everything.
#+begin_src bash
addrepos() { \
echo "####################################################"
@ -145,11 +158,12 @@ addrepos() { \
echo "####################################################"
grep -qxF "[cbsh-arch-repo]" /etc/pacman.conf ||
(echo "[cbsh-arch-repo]"; echo "SigLevel = Optional DatabaseOptional"; \
echo "Server = https://gitlab.com/cabooshyy/\$repo/-/raw/main/\$arch") | sudo tee -a /etc/pacman.conf
echo "Server = https://gitlab.com/cbsh/cbsh-arch/\$repo/-/raw/main/\$arch") | sudo tee -a /etc/pacman.conf
}
addrepos || err "Error adding the Repo to /etc/pacman.conf."
#+end_src
* Adding keyservers to gpg.conf
#+begin_src bash
addkeyservers() { \
@ -176,6 +190,7 @@ recieve_keys() { \
recieve_keys || err "Error Recieving PGP key $_pgpkey"
#+end_src
* Installing the packages from the repos
All packages listed are either in the standard Arch Repos or in my CBSH repos. these will all get installed with pacman. the only exception is DOOM Emacs which will be installed later in the script.
@ -186,9 +201,10 @@ All packages listed are either in the standard Arch Repos or in my CBSH repos. t
sudo pacman --needed --ask 4 -Syu - < pkglist.txt
# Now that pikaur is installed, we can sync the AUR and install some needed packages (Nerd Fonts) from there.
pikaur -Syu nerd-fonts-source-code-pro nerd-fonts-fira-code pa-applet-git
pikaur -Syu nerd-fonts-source-code-pro nerd-fonts-fira-code pa-applet-git brave-bin
#+end_src
* Copying over the configs from /etc/cbsh to $HOME
Pacman cannot install files to $HOME, so normally we place them in /etc/skel, but as some distros such as Manjaro and Arco use /etc/skel for their own specific config files, we place them in /etc/cbsh so there are no conflicts on any arch based distro. the config files are placed here and then copied over to $HOME, we backup config just in case anything goes wrong. BEWARE!
@ -206,15 +222,22 @@ echo "#########################################################"
[ -d ~/.config ] && mkdir ~/.config-backup-$(date +%Y.%m.%d-%H%M) && cp -Rf ~/.config ~/.config-backup-$(date +%Y.%m.%d-%H%M)
cd /etc/cbsh
sudo mv .config/qtile/qtile/* .config/qtile && sudo rm -r .config/qtile/qtile
sudo mv .config/kitty/kitty/* .config/kitty && sudo rm -r .config/kitty/kitty
sudo mv .config/qtile/* .config/qtile
sudo mv .config/kitty/* .config/kitty
sudo mv zsh/.zshrc .zshrc
cp -Rf . ~ && cd -
echo "#################################################################################################"
echo "## Copying the sddm theme from /opt/cbsh-sddm-theme into /usr/share/sddm/theme/cbsh-sddm-theme ##"
echo "#################################################################################################"
cd /opt
sudo cp -r cbsh-sddm-theme /usr/share/sddm/themes
echo "#######################################################################"
echo "## Set skel directory to /etc/cbsh, so new users can use the configs ##"
echo "#######################################################################"
cd /etc/default
sudo sed "8cSKEL=/etc/cbsh" useradd
#+end_src
@ -254,10 +277,14 @@ select choice in "${shells[@]}"; do
done
#+end_src
* Make Sure SDDM is enabled so we don't boot into a TTY, and NetworkManager is too so the applet works.
#+begin_src bash
# Disable Current Login Manager, if any.
sudo systemctl disable $(grep '/usr/s\?bin' /etc/systemd/system/display-manager.service | awk -F / '{print $NF}') || echo "Cannot Disable current Display Manager"
echo "######################################################"
echo "## Disable previous login manager, if there is one. ##"
echo "######################################################"
sudo systemctl disable $(grep '/usr/s\?bin' /etc/systemd/system/display-manager.service | awk -F / '{print $NF}') || echo "Cannot Disable current Display Manager, or a Display Manager isn't already installed."
# Then enable SDDM as the Login Manager
sudo systemctl enable sddm
@ -278,13 +305,14 @@ echo "###################################"
# Create a local file if it doesnt exist (Mainline Arch Linux doesn't by default)
[ ! -f "/etc/sddm.conf" ] && \
sudo cp /usr/lib/sddm/sddm.conf.d/default.conf /etc/sddm.conf || echo "Default sddm system config file is not found."
sudo cp /usr/lib/sddm/sddm.conf.d/default.conf /etc/sddm.conf || echo "Default SDDM system config file is not found."
# Enable NetworkManager for networking
sudo systemctl enable NetworkManager
#+end_src
* Installation Complete!
#+begin_src bash
echo "###########################################"

22
cbsh
View File

@ -43,7 +43,7 @@ addrepos() { \
echo "####################################################"
grep -qxF "[cbsh-arch-repo]" /etc/pacman.conf ||
(echo "[cbsh-arch-repo]"; echo "SigLevel = Optional DatabaseOptional"; \
echo "Server = https://gitlab.com/cabooshyy/\$repo/-/raw/main/\$arch") | sudo tee -a /etc/pacman.conf
echo "Server = https://gitlab.com/cbsh/cbsh-arch/\$repo/-/raw/main/\$arch") | sudo tee -a /etc/pacman.conf
}
addrepos || err "Error adding the Repo to /etc/pacman.conf."
@ -70,7 +70,7 @@ recieve_keys || err "Error Recieving PGP key $_pgpkey"
sudo pacman --needed --ask 4 -Syu - < pkglist.txt
# Now that pikaur is installed, we can sync the AUR and install some needed packages (Nerd Fonts) from there.
pikaur -Syu nerd-fonts-source-code-pro nerd-fonts-fira-code pa-applet-git
pikaur -Syu nerd-fonts-source-code-pro nerd-fonts-fira-code pa-applet-git brave-bin
echo "#########################################################"
echo "## Copying the config files from /etc/cbsh into \$HOME ##"
@ -81,16 +81,23 @@ echo "#########################################################"
[ -d ~/.config ] && mkdir ~/.config-backup-$(date +%Y.%m.%d-%H%M) && cp -Rf ~/.config ~/.config-backup-$(date +%Y.%m.%d-%H%M)
cd /etc/cbsh
sudo mv .config/qtile/qtile/* .config/qtile && sudo rm -r .config/qtile/qtile
sudo mv .config/kitty/kitty/* .config/kitty && sudo rm -r .config/kitty/kitty
sudo mv .config/qtile/* .config/qtile
sudo mv .config/kitty/* .config/kitty
sudo mv zsh/.zshrc .zshrc
cp -Rf . ~ && cd -
echo "#################################################################################################"
echo "## Copying the sddm theme from /opt/cbsh-sddm-theme into /usr/share/sddm/theme/cbsh-sddm-theme ##"
echo "#################################################################################################"
cd /opt
sudo cp -r cbsh-sddm-theme /usr/share/sddm/themes
echo "#######################################################################"
echo "## Set skel directory to /etc/cbsh, so new users can use the configs ##"
echo "#######################################################################"
cd /etc/default
sudo sed "8cSKEL=/etc/cbsh" useradd
echo "#########################################################"
echo "## Installing Doom Emacs. This may take a few minutes. ##"
echo "#########################################################"
@ -121,7 +128,10 @@ select choice in "${shells[@]}"; do
done
# Disable Current Login Manager, if any.
sudo systemctl disable $(grep '/usr/s\?bin' /etc/systemd/system/display-manager.service | awk -F / '{print $NF}') || echo "Cannot Disable current Display Manager"
echo "######################################################"
echo "## Disable previous login manager, if there is one. ##"
echo "######################################################"
sudo systemctl disable $(grep '/usr/s\?bin' /etc/systemd/system/display-manager.service | awk -F / '{print $NF}') || echo "Cannot Disable current Display Manager, or a Display Manager isn't already installed."
# Then enable SDDM as the Login Manager
sudo systemctl enable sddm
@ -142,7 +152,7 @@ echo "###################################"
# Create a local file if it doesnt exist (Mainline Arch Linux doesn't by default)
[ ! -f "/etc/sddm.conf" ] && \
sudo cp /usr/lib/sddm/sddm.conf.d/default.conf /etc/sddm.conf || echo "Default sddm system config file is not found."
sudo cp /usr/lib/sddm/sddm.conf.d/default.conf /etc/sddm.conf || echo "Default SDDM system config file is not found."
# Enable NetworkManager for networking

View File

@ -45,16 +45,9 @@ ttf-ubuntu-font-family
xdg-user-dirs
xdg-desktop-portal
xorg-server
xorg-xrandr
xorg-xkill
xorg-xmessage
xorg-xprop
xorg-xrdb
xorg-xset
xorg-xsetroot
xorg
xterm
vim
dunst
xdotool
qtile
element-desktop