arch workstation commit

This commit is contained in:
[yuri]
2025-12-11 12:49:09 +01:00
parent 07a8af4dd8
commit 9c648a70b0
4 changed files with 438 additions and 3 deletions

View File

@@ -160,14 +160,20 @@ fi
SOURCE_DIR="$SCRIPT_DIR/config-files/arch" SOURCE_DIR="$SCRIPT_DIR/config-files/arch"
DEST_DIR="$HOME" DEST_DIR="$HOME"
# replace bashrc
say_yellow "Setting bashrc"
sudo cp -v /etc/skel/.bashrc /etc/skel/.bashrc.starburst
sudo cp -rf $SOURCE_DIR/.bashrc /etc/skel/.bashrc
sudo cp -rf $SOURCE_DIR/.bashrc $HOME/.bashrc
# 1. Verify source directory exists # 1. Verify source directory exists
if [ ! -d "$SOURCE_DIR" ]; then if [ ! -d "$SOURCE_DIR" ]; then
echo "Error: Source directory '$SOURCE_DIR' not found. Skipping XFCE config." echo "Error: Source directory '$SOURCE_DIR' not found. Skipping config."
# Use exit 1 if this is critical, or just exit 0 to continue the main script # Use exit 1 if this is critical, or just exit 0 to continue the main script
# exit 1 # exit 1
fi fi
say_yellow "Applying XFCE configuration directly to $DEST_DIR..." say_yellow "Applying configuration directly to $DEST_DIR..."
# 2. Use shopt for dotfiles, then copy recursively and forcefully # 2. Use shopt for dotfiles, then copy recursively and forcefully
shopt -s dotglob shopt -s dotglob
@@ -178,7 +184,7 @@ shopt -u dotglob
say_yellow "Clearing session cache..." say_yellow "Clearing session cache..."
rm -rf "$HOME/.cache/sessions/" rm -rf "$HOME/.cache/sessions/"
say_yellow "XFCE configuration applied. User can log in now." say_yellow "configuration applied. User can log in now."
# End of script # End of script
say_green "Full setup completed." say_green "Full setup completed."

View File

@@ -128,6 +128,12 @@ else
fi fi
fi fi
###### TODO
### from paru install pamac-tray-icon-plasma
### let autostart pamac-tray-plasma
# End of script # End of script
say_green -e "KDE Plasma / SDDM setup completed." say_green -e "KDE Plasma / SDDM setup completed."

97
v2/arch-workstation.sh Executable file
View File

@@ -0,0 +1,97 @@
#!/bin/bash
set -euo pipefail
##########################
# Color helpers (printf-safe, no tput)
##########################
RED="\033[0;31m"
GREEN="\033[0;32m"
YELLOW="\033[0;33m"
CYAN="\033[0;36m"
GRAY="\033[0;37m"
BOLD="\033[1m"
RESET="\033[0m"
# Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED="" GREEN="" YELLOW="" CYAN="" GRAY="" BOLD="" RESET=""
fi
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
##########################
# Use exported variables from main detection script
##########################
OS="${DETECTED_OS:-debian}"
DDE="${DETECTED_DE:-}"
DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
##########################
# Helper functions
##########################
install_packages() { sudo pacman -Sy; sudo pacman -S --noconfirm --needed "$@"; }
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
remove_packages() {
local packages_to_remove=()
# 1. Identify which packages are actually installed
for pkg in "$@"; do
if is_package_installed "$pkg"; then
packages_to_remove+=("$pkg")
else
say_gray "Package '$pkg' not found. Skipping removal."
fi
done
# 2. Only run pacman if there are packages to remove
if [ ${#packages_to_remove[@]} -gt 0 ]; then
say_cyan "Removing packages: ${packages_to_remove[*]}"
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
else
say_gray "No packages to remove from the list."
fi
}
say_yellow "Starting Workstation setup..."
# Run full first
bash "$SCRIPT_DIR/arch-full.sh"
# Add extra packages
install_packages git libreoffice-fresh
# gitahead-git
# editors
install_packages vscodium sublime-text-4
#internet
install_packages brave-bin insync
# google-chrome discord firefox
#theming
# variety
#media
install_packages flameshot-git mpv-full
# vlc gimp inkscape spotify lollypop
#shells
install_packages zsh zsh-completions zsh-syntax-highlighting oh-my-zsh-git
# fish
#system-tools
install_packages base-devel
#tools
install_packages wttr system-config-printer ripgrep meld btop htop hwinfo lshw
# End of script
say_green "Workstation setup completed."

View File

@@ -0,0 +1,326 @@
### EXPORT ###
export EDITOR='nano'
export VISUAL='nano'
export HISTCONTROL=ignoreboth:erasedups
export PAGER='most'
PS1='[\u@\h \W]\$ '
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
#ignore upper and lowercase when TAB completion
bind "set completion-ignore-case on"
### ALIASES ###
#list
alias ls='ls --color=auto'
alias la='ls -a'
alias ll='ls -alFh'
alias l='ls'
alias l.="ls -A | grep -E '^\.'"
alias listdir="ls -d */ > list"
#pacman
alias sps='sudo pacman -S'
alias spr='sudo pacman -R'
alias sprs='sudo pacman -Rs'
alias sprdd='sudo pacman -Rdd'
alias spqo='sudo pacman -Qo'
alias spsii='sudo pacman -Sii'
# show the list of packages that need this package - depends mpv as example
function_depends() {
search=$(echo "$1")
sudo pacman -Sii $search | grep "Required" | sed -e "s/Required By : //g" | sed -e "s/ /\n/g"
}
alias depends='function_depends'
#fix obvious typo's
alias cd..='cd ..'
## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='grep -E --color=auto'
alias fgrep='grep -F --color=auto'
#readable output
alias df='df -h'
#setlocale
alias setlocale="sudo localectl set-locale LANG=en_US.UTF-8"
#pacman unlock
alias unlock="sudo rm /var/lib/pacman/db.lck"
alias rmpacmanlock="sudo rm /var/lib/pacman/db.lck"
#arcolinux logout unlock
alias rmlogoutlock="sudo rm /tmp/arcologout.lock"
#which graphical card is working
alias whichvga="/usr/local/bin/arcolinux-which-vga"
#free
alias free="free -mt"
#continue download
alias wget="wget -c"
#userlist
alias userlist="cut -d: -f1 /etc/passwd | sort"
#merge new settings
alias merge="xrdb -merge ~/.Xresources"
# Aliases for software managment
# pacman or pm
alias pacman='sudo pacman --color auto'
alias update='sudo pacman -Syyu'
alias upd='sudo pacman -Syyu'
# paru as aur helper - updates everything
alias pksyua="paru -Syu --noconfirm"
alias upall="paru -Syu --noconfirm"
alias upa="paru -Syu --noconfirm"
#ps
alias psa="ps auxf"
alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
#grub update
alias update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
alias grub-update="sudo grub-mkconfig -o /boot/grub/grub.cfg"
#grub issue 08/2022
alias install-grub-efi="sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArcoLinux"
#add new fonts
alias update-fc='sudo fc-cache -fv'
#copy/paste all content of /etc/skel over to home folder - backup of config created - beware
#skel alias has been replaced with a script at /usr/local/bin/skel
#backup contents of /etc/skel to hidden backup folder in home/user
alias bupskel='cp -Rf /etc/skel ~/.skel-backup-$(date +%Y.%m.%d-%H.%M.%S)'
#copy shell configs
alias cb='cp /etc/skel/.bashrc ~/.bashrc && exec bash'
alias cz='cp /etc/skel/.zshrc ~/.zshrc && echo "Copied."'
alias cf='cp /etc/skel/.config/fish/config.fish ~/.config/fish/config.fish && echo "Copied."'
#switch between bash and zsh
alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'"
alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'"
alias tofish="sudo chsh $USER -s /bin/fish && echo 'Now log out.'"
# kill commands
# quickly kill conkies
alias kc='killall conky'
# quickly kill polybar
alias kp='killall polybar'
# quickly kill picom
alias kpi='killall picom'
# hardware info --short
alias hw="hwinfo --short"
# fastfetch --short
alias ff="fastfetch | lolcat"
# audio check pulseaudio or pipewire
alias audio="pactl info | grep 'Server Name'"
# skip integrity check
alias paruskip='paru -S --mflags --skipinteg'
alias yayskip='yay -S --mflags --skipinteg'
alias trizenskip='trizen -S --skipinteg'
# check vulnerabilities microcode
alias microcode='grep . /sys/devices/system/cpu/vulnerabilities/*'
#approximation of how old your hardware is
alias howold="sudo lshw | grep -B 3 -A 8 BIOS"
#check cpu
alias cpu="cpuid -i | grep uarch | head -n 1"
#get fastest mirrors in your neighborhood
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
alias mirrord="sudo reflector --latest 30 --number 10 --sort delay --save /etc/pacman.d/mirrorlist"
alias mirrors="sudo reflector --latest 30 --number 10 --sort score --save /etc/pacman.d/mirrorlist"
alias mirrora="sudo reflector --latest 30 --number 10 --sort age --save /etc/pacman.d/mirrorlist"
#our experimental - best option for the moment
alias mirrorx="sudo reflector --age 6 --latest 20 --fastest 20 --threads 5 --sort rate --protocol https --save /etc/pacman.d/mirrorlist"
alias mirrorxx="sudo reflector --age 6 --latest 20 --fastest 20 --threads 20 --sort rate --protocol https --save /etc/pacman.d/mirrorlist"
alias ram='rate-mirrors --allow-root --disable-comments arch | sudo tee /etc/pacman.d/mirrorlist'
alias rams='rate-mirrors --allow-root --disable-comments --protocol https arch | sudo tee /etc/pacman.d/mirrorlist'
#Recent Installed Packages
alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
alias riplong="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -3000 | nl"
#Cleanup orphaned packages
alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'
# This will generate a list of explicitly installed packages
alias list="sudo pacman -Qqe"
#This will generate a list of explicitly installed packages without dependencies
alias listt="sudo pacman -Qqet"
# list of AUR packages
alias listaur="sudo pacman -Qqem"
# add > list at the end to write to a file
# install packages from list
# pacman -S --needed - < my-list-of-packages.txt
#clear
alias clean="clear; seq 1 $(tput cols) | sort -R | sparklines | lolcat"
alias cls="clear; seq 1 $(tput cols) | sort -R | sparklines | lolcat"
#search content with ripgrep
alias rg="rg --sort path"
#get the error messages from journalctl
alias jctl="journalctl -p 3 -xb"
#nano for important configuration files
#know what you do in these files
alias npacman="sudo $EDITOR /etc/pacman.conf"
alias ngrub="sudo $EDITOR /etc/default/grub"
alias nconfgrub="sudo $EDITOR /boot/grub/grub.cfg"
alias nmakepkg="sudo $EDITOR /etc/makepkg.conf"
alias nmkinitcpio="sudo $EDITOR /etc/mkinitcpio.conf"
alias nmirrorlist="sudo $EDITOR /etc/pacman.d/mirrorlist"
alias nsddm="sudo $EDITOR /etc/sddm.conf"
alias nsddmk="sudo $EDITOR /etc/sddm.conf.d/kde_settings.conf"
alias nsddmd="sudo $EDITOR /usr/lib/sddm/sddm.conf.d/default.conf"
alias nfstab="sudo $EDITOR /etc/fstab"
alias nnsswitch="sudo $EDITOR /etc/nsswitch.conf"
alias nsamba="sudo $EDITOR /etc/samba/smb.conf"
alias ngnupgconf="sudo $EDITOR /etc/pacman.d/gnupg/gpg.conf"
alias nhosts="sudo $EDITOR /etc/hosts"
alias nhostname="sudo $EDITOR /etc/hostname"
alias nresolv="sudo $EDITOR /etc/resolv.conf"
alias nb="$EDITOR ~/.bashrc"
alias nz="$EDITOR ~/.zshrc"
alias nf="$EDITOR ~/.config/fish/config.fish"
alias nfastfetch="$EDITOR ~/.config/fastfetch/config.jsonc"
alias nvconsole="sudo $EDITOR /etc/vconsole.conf"
alias nenvironment="sudo $EDITOR /etc/environment"
alias nloader="sudo $EDITOR /boot/efi/loader/loader.conf"
alias nalacritty="nano /home/$USER/.config/alacritty/alacritty.toml"
alias nemptty="sudo $EDITOR /etc/emptty/conf"
#reading logs with bat
alias lpacman="bat /var/log/pacman.log"
alias lxorg="bat /var/log/Xorg.0.log"
alias lxorgo="bat /var/log/Xorg.0.log.old"
#reading logs with sublime-text-4
alias spac="subl /etc/pacman.conf"
#gpg
#verify signature for isos
alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
alias fix-gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
#receive the key of a developer
alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
alias fix-gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
alias fix-keyserver="[ -d ~/.gnupg ] || mkdir ~/.gnupg ; cp /etc/pacman.d/gnupg/gpg.conf ~/.gnupg/ ; echo 'done'"
#fixes
alias fix-permissions="sudo chown -R $USER:$USER ~/.config ~/.local"
alias keyfix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
alias key-fix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
alias keys-fix="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
alias fixkey="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
alias fixkeys="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
alias fix-key="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
alias fix-keys="/usr/local/bin/arcolinux-fix-pacman-databases-and-keys"
alias fix-pacman-conf="/usr/local/bin/arcolinux-fix-pacman-conf"
alias fix-pacman-keyserver="/usr/local/bin/arcolinux-fix-pacman-gpg-conf"
alias fix-grub="sudo /usr/local/bin/arcolinux-fix-grub"
alias fixgrub="sudo /usr/local/bin/arcolinux-fix-grub"
alias fix-archlinux-mirrors="/usr/local/bin/arcolinux-fix-archlinux-servers"
alias fix-arcolinux-mirrors="/usr/local/bin/arcolinux-fix-arcolinux-servers"
#maintenance
alias big="expac -H M '%m\t%n' | sort -h | nl"
alias downgrada="sudo downgrade --ala-url https://ant.seedhost.eu/arcolinux/"
#systeminfo
alias sysfailed="systemctl list-units --failed"
#shutdown or reboot
alias ssn="sudo shutdown now"
alias sr="reboot"
#update betterlockscreen images
alias bls="betterlockscreen -u /usr/share/backgrounds/"
#give the list of all installed desktops - xsessions desktops
alias xd="ls /usr/share/xsessions"
alias xdw="ls /usr/share/wayland-sessions"
#give a list of the kernels installed
alias kernel="ls /usr/lib/modules"
alias kernels="ls /usr/lib/modules"
# # ex = EXtractor for all kinds of archives
# # usage: ex <file>
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*.deb) ar x $1 ;;
*.tar.xz) tar xf $1 ;;
*.tar.zst) tar xf $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
#wayland aliases
alias wsimplescreen="wf-recorder -a"
alias wsimplescreenrecorder="wf-recorder -a -c h264_vaapi -C aac -d /dev/dri/renderD128 --file=recording.mp4"
#btrfs aliases
alias btrfsfs="sudo btrfs filesystem df /"
alias btrfsli="sudo btrfs su li / -t"
#snapper aliases
alias snapcroot="sudo snapper -c root create-config /"
alias snapchome="sudo snapper -c home create-config /home"
alias snapli="sudo snapper list"
alias snapcr="sudo snapper -c root create"
alias snapch="sudo snapper -c home create"
#git
alias rmgitcache="rm -r ~/.cache/git"
alias grh="git reset --hard"
#pamac
alias pamac-unlock="sudo rm /var/tmp/pamac/dbs/db.lock"
#create a file called .bashrc-personal and put all your personal aliases
#in there. They will not be overwritten by skel.
[[ -f ~/.bashrc-personal ]] && . ~/.bashrc-personal
# reporting tools - install when not installed
fastfetch | lolcat
#neofetch