소스 검색

remove unneeded conditionals flattening code

fix leftover merge conflicts

fix alacritty behavior to load bash_profile and simplify gvm again
Casey DeLorme 2 년 전
부모
커밋
5cd5276616
3개의 변경된 파일50개의 추가작업 그리고 66개의 파일을 삭제
  1. 42 36
      arch.sh
  2. 4 1
      install/etc/skel/.config/alacritty/alacritty.yml
  3. 4 29
      todo.md

+ 42 - 36
arch.sh

@@ -138,6 +138,12 @@ sed -i "/ssh-add/d" "$(getent passwd root | cut -d: -f6)/.bashrc"
 # install protontricks
 python3 -m pip install protontricks
 
+
+
+
+
+
+
 # enable ccache and optimize cores for AUR
 sed -i 's/!ccache/ccache/' /etc/makepkg.conf
 sed -i 's/^#MAKEFLAGS.*/MAKEFLAGS="-j$(($(nproc) + 1)) -l$(nproc)"/' /etc/makepkg.conf
@@ -159,6 +165,11 @@ sudo -u $aur_username git clone https://aur.archlinux.org/numix-icon-theme-git.g
 
 # wev
 
+
+
+
+
+
 # cleanup aur user
 rm -rf /etc/sudoers.d/${aur_username}
 userdel -fr $aur_username
@@ -205,42 +216,37 @@ su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'"
 echo "net.core.rmem_max = 4194304" > /etc/sysctl.d/transmission.conf
 echo "net.core.wmem_max = 1048576" >> /etc/sysctl.d/transmission.conf
 
-# check whether username and password are not empty
-if [[ -n "$username" && -n "$password" ]]; then
-
-	# create user if not exists, else (re)-install dot-files
-	if ! id $username &> /dev/null; then
-		useradd -m -s /bin/bash $username
-		echo "${username}:${password}" | chpasswd -c SHA256
-	else
-		[ $EUID -ne 0 ] && rsync -Pav /etc/skel/ "$(getent passwd $username | cut -d: -f6)/"
-	fi
-
-	# add user to standard groups
-	usermod -aG users,sudo,adm,input,audio,video,disk,storage,lp,vboxusers $username
-
-	# generate postgres user and user database
-	systemctl start postgresql
-	su postgres -c "cd && createuser -ds $username" 2> /dev/null && su $username -c "cd && createdb"
-
-	# load xdg-user-dirs
-	su $username -c "cd && xdg-user-dirs-update"
-	update-desktop-database
-
-	# generate default (passwordless) ed25519 ssh key if none exists
-	su $username -c "cd; if [ ! -f ~/.ssh/id_ed25519 ]; then ssh-keygen -q -t ed25519 -N '' -f ~/.ssh/id_ed25519 && cd && chmod 600 ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519.pub; fi"
-
-	# install gvm loading from ~/.bashrc & ~/.bash_profile, and the latest go version
-	su $username -c "if [ ! -d ~/.gvm ]; then GVM_NO_UPDATE_PROFILE=1 bash < <(curl -Ls https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer 2> /dev/null); fi"
-	su $username -c 'grep "gvm" ~/.bash_profile &> /dev/null || echo -e "\n# load gvm\n[ -s $HOME/.gvm/scripts/gvm ] && . $HOME/.gvm/scripts/gvm" >> ~/.bash_profile'
-	su $username -c 'grep "gvm" ~/.bashrc &> /dev/null || echo -e "\n# load gvm\n[ -s $HOME/.gvm/scripts/gvm ] && . $HOME/.gvm/scripts/gvm" >> ~/.bashrc'
-	su $username -c ". ~/.gvm/scripts/gvm && gvm install go1.17.6 -B && gvm use go1.17.6 --default"
-
-	# configure user-space transmission
-	if [ ! -f "/etc/systemd/system/transmission.service.d/local.conf" ]; then
-		su $username -c "cd && mkdir -p ~/transmission/{done,incomplete}"
-		su $username -c 'cd && tmp=$(mktemp) && jq ".[\"download-dir\"] = \"${HOME}/transmission/done\"" $HOME/.config/transmission-daemon/settings.json | jq ".[\"incomplete-dir\"] = \"${HOME}/transmission/incomplete\"" | jq ".[\"watch-dir\"] = \"$(xdg-user-dir DOWNLOAD)\"" > $tmp && mv $tmp $HOME/.config/transmission-daemon/settings.json'
-	fi
+# create user if not exists, else (re)-install dot-files
+if ! id $username &> /dev/null; then
+	useradd -m -s /bin/bash $username
+	echo "${username}:${password}" | chpasswd -c SHA256
+else
+	[ $EUID -ne 0 ] && rsync -Pav /etc/skel/ "$(getent passwd $username | cut -d: -f6)/"
+fi
+
+# add user to standard groups
+usermod -aG users,sudo,adm,input,audio,video,disk,storage,lp,vboxusers $username
+
+# generate postgres user and user database
+systemctl start postgresql
+su postgres -c "cd && createuser -ds $username" 2> /dev/null && su $username -c "cd && createdb"
+
+# load xdg-user-dirs
+su $username -c "cd && xdg-user-dirs-update"
+update-desktop-database
+
+# generate default (passwordless) ed25519 ssh key if none exists
+su $username -c "cd; if [ ! -f ~/.ssh/id_ed25519 ]; then ssh-keygen -q -t ed25519 -N '' -f ~/.ssh/id_ed25519 && cd && chmod 600 ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519.pub; fi"
+
+# install gvm loading from ~/.bashrc & ~/.bash_profile, and the latest go version
+su $username -c "if [ ! -d ~/.gvm ]; then GVM_NO_UPDATE_PROFILE=1 bash < <(curl -Ls https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer 2> /dev/null); fi"
+su $username -c 'grep "gvm" ~/.bash_profile &> /dev/null || echo -e "\n# load gvm\n[ -s $HOME/.gvm/scripts/gvm ] && . $HOME/.gvm/scripts/gvm" >> ~/.bash_profile'
+su $username -c ". ~/.gvm/scripts/gvm && gvm install go1.17.6 -B && gvm use go1.17.6 --default"
+
+# configure user-space transmission
+if [ ! -f "/etc/systemd/system/transmission.service.d/local.conf" ]; then
+	su $username -c "cd && mkdir -p ~/transmission/{done,incomplete}"
+	su $username -c 'cd && tmp=$(mktemp) && jq ".[\"download-dir\"] = \"${HOME}/transmission/done\"" $HOME/.config/transmission-daemon/settings.json | jq ".[\"incomplete-dir\"] = \"${HOME}/transmission/incomplete\"" | jq ".[\"watch-dir\"] = \"$(xdg-user-dir DOWNLOAD)\"" > $tmp && mv $tmp $HOME/.config/transmission-daemon/settings.json'
 fi
 
 # symlink shceduled maintenance tasks

+ 4 - 1
install/etc/skel/.config/alacritty/alacritty.yml

@@ -2,4 +2,7 @@ env:
   TERM: xterm-256color
 window:
   opacity: 0.95
-
+shell:
+  program: /usr/bin/bash
+  args:
+    - --login

+ 4 - 29
todo.md

@@ -8,34 +8,8 @@ _Expect iterative changes over the following months while fine-tuning happens on
 
 ## sway
 
-Fresh install after swapping motherboards since Gigabyte hasn't fixed the reboot problems in 1.5 years.
-
-- Verify gvm reloads properly as I have copied it to bashrc
-- Verify swapping export locations into bash_profile does not break (_eg. due to alacritty only loading bashrc not bash_profile_)
-- Test the new sway exit command works by properly terminating session services
-	- _Figure out what is still broken so I can exit and restart sway without rebooting?_
-
-- modify alacritty.yml to match former xdefaults
-	- [reference](https://sunnnychan.github.io/cheatsheet/linux/config/alacritty.yml.html)
-	- We can set the program and args to force it to load bash_profile and eliminate redundant gvm logic while fixing the other major issue I had with it?
-
-<<<<<<< HEAD
-alacritty does not load bash_profile, which means gvm never refreshes.
-
-I should move most of the non-static content into bashrc instead, which does get loaded every new shell.
-
-Perhaps hardcode gvm loading into the bashrc, and only keep raw static exports in bash_profile?
-
-
----
-
-Consider modifying this line to stop the sway-session.target:
-
-	bindsym $mod+x exec swaymsg exit
-
-Like:
-
-	bindsym $mod+x exec "systemctl --user import-environment; systemctl --user stop sway-session.target; swaymsg exit"
+- verify fix for alacritty config loads gvm/bash_profile without requiring redundant sourcing
+- double-check whether exit command properly, and fully, terminates our sway session (eg. we can safely reload sway)
 
 
 ---
@@ -53,7 +27,8 @@ https://github.com/gurrgur/er-patcher
 
 ---
 
-- install `aur` packages under actual user rather than temporary user
+- figure out how to modify aur package installation to occur under new user rather than temporary user
+- add new aur packages to the installation
 	- cmst (sway/wayland friendly connman management)
 	- wev (_need to verify necessity?_)