Skip to content

Instantly share code, notes, and snippets.

@piotrek94692
Last active May 4, 2023 13:05
Show Gist options
  • Save piotrek94692/22f9e56d2dc4aff0321d784a6c7aa9c6 to your computer and use it in GitHub Desktop.
Save piotrek94692/22f9e56d2dc4aff0321d784a6c7aa9c6 to your computer and use it in GitHub Desktop.
floppyOS chroot script
#!/bin/sh
trap '' 2 20
cd /
# floppyOS chroot script
unset HISTFILE
setfont eurlatgr
until curl --compressed -H "Cache-Control: no-cache, no-store, must-revalidate" -H "Expires: 0" -H "Pragma: no-cache" -L -o /etc/fl-one-half-dark.json "https://raw.githubusercontent.com/sonph/onehalf/master/wal/colorschemes/dark/one-half-dark.json?$(date +%s)"; do continue; done
wal --vte -f /etc/fl-one-half-dark.json
loadkeys "$keymap"
rm -f /boot/initramfs-linux-zen-fallback.img /boot/initramfs-linux-zen.img /boot/initramfs-linux-fallback.img /boot/initramfs-linux.img
mv -f /usr/share/libalpm/hooks/90-mkinitcpio-install.hook /usr/share/libalpm/hooks/90-mkinitcpio-install.disabledhook
echo -e "Welcome to\033[0;36m floppyOS\033[1;37m •\033[0;36m freedomLite\033[1;37m •\033[0;36m Arch Linux\033[1;37m •\033[0;36m \\\r\033[0m on\033[1;37m \\l \033[0m" > /etc/issue
echo -e "Displayed at:\033[1;37m \\\t \033[0m" >> /etc/issue
cat > /etc/fl-ascii << EOF
___,___,_______,____
| :::|///./||'|| \\
| :::|//.//|| || H) |
| :::|/.///|!!!| |
| _______________ |
| |:::::::::::::::| |
| |_______________| |
| |_______________| |
| |_______________| |
| |_______________| |
||_| ||_|
|__|_______________|__|
» fuck freedom, «
» embrace yes «
EOF
echo "KEYMAP=${keymap}" > /etc/vconsole.conf
echo "FONT=eurlatgr" >> /etc/vconsole.conf
echo -e "\nalias bridge='bridge --color=auto '" >> /etc/profile
echo "alias diff='diff --color '" >> /etc/profile
echo "alias dir='dir --color=auto '" >> /etc/profile
echo "alias vdir='vdir --color=auto '" >> /etc/profile
echo "alias dmesg='dmesg -L '" >> /etc/profile
echo "alias fdisk='fdisk -L '" >> /etc/profile
echo "alias cfdisk='cfdisk -L '" >> /etc/profile
echo "alias sfdisk='sfdisk --color '" >> /etc/profile
echo "alias gcov='gcov -k '" >> /etc/profile
echo "alias grep='grep --color=auto '" >> /etc/profile
echo "alias egrep='grep -E --color=auto '" >> /etc/profile
echo "alias fgrep='grep -F --color=auto '" >> /etc/profile
echo "alias rgrep='grep -r --color=auto '" >> /etc/profile
echo "alias msggrep='msggrep --color=auto '" >> /etc/profile
echo "alias hexdump='hexdump -L '" >> /etc/profile
echo "alias ip='ip --color=auto '" >> /etc/profile
echo "alias less='less -RF --mouse --use-color '" >> /etc/profile
echo "alias ls='ls --color=auto '" >> /etc/profile
echo "alias pactree='pactree -c '" >> /etc/profile
echo "alias ponysay='ponysay +c '" >> /etc/profile
echo "alias ponysay-tool='ponysay-tool +c '" >> /etc/profile
echo "alias ponythink='ponythink +c '" >> /etc/profile
echo "alias tree='tree -C '" >> /etc/profile
echo "alias xgettext='xgettext --color=auto '" >> /etc/profile
echo -e "\nalias sudo='sudo -v; sudo '" >> /etc/profile
echo "alias sudoedit='sudoedit -v; sudoedit '" >> /etc/profile
echo "alias speedtest='SpeedTest '" >> /etc/profile
echo "alias czkawka_cli='czkawka-cli '" >> /etc/profile
echo "alias czkawkacli='czkawka-cli '" >> /etc/profile
echo "alias btm='btm --enable_gpu_memory '" >> /etc/profile
echo "alias bottom='btm '" >> /etc/profile
echo "alias htop='btm -b '" >> /etc/profile
echo "alias startx='startx > /dev/null 2>&1'" >> /etc/profile
echo "alias fastfetch=\"fastfetch --file /etc/fl-ascii --OS-format 'floppyOS • freedomLite • {3}' \"" >> /etc/profile
echo "alias fl-basepackages='yay -Qi $basepackages '" >> /etc/profile
echo "alias fl-cleanfs=\"profile-cleaner b c e f gc i ix o pm to v; yay --noconfirm -Sc; if [ '\$EUID' != 0 ]; then czkawka-cli empty-folders -DX -d /; fi\"" >> /etc/profile
echo "alias fl-commandlist=\"ls \$(echo \$PATH | tr ':' ' ') | grep -v '/' | grep . | sort\"" >> /etc/profile
echo "alias fl-gnomesetup='yay --needed -Syu gnome-shell-extension-appindicator gnome-shell-extension-color-picker gnome-shell-extension-favourites-in-appgrid-git gnome-shell-extension-fuzzy-app-search gnome-shell-extension-gnome-ui-tune-git gnome-shell-extension-gtile gnome-shell-extension-impatience-git gnome-shell-extension-pixel-saver gnome-shell-extension-power-profile-switcher-git gnome-shell-extension-transparent-window-moving-git gnome-shell-extensions '" >> /etc/profile
echo "alias fl-logo='flat -p /etc/fl-ascii '" >> /etc/profile
echo "alias bat='bat --style=full '" >> /etc/profile
echo "alias flat=\"bat --style=full --pager 'less -RF --mouse --use-color ' \"" >> /etc/profile
echo "alias paci='pacman -Qi '" >> /etc/profile
echo "alias paclist='pacman -Qq '" >> /etc/profile
echo "alias pacs='pacman --needed -S '" >> /etc/profile
echo "alias spacs='sudo pacman --needed -S '" >> /etc/profile
echo "alias syays='yay --needed -S '" >> /etc/profile
echo "alias yayi='yay -Qi '" >> /etc/profile
echo "alias yaylist='yay -Qq '" >> /etc/profile
echo "alias yays='yay --needed -S '" >> /etc/profile
echo "alias fuckstartx='pacman -Rn gstreamer-vaapi && startx '" >> /etc/profile
echo "alias 0x0=\"curl -F 'file=@-' 0x0.st\"" >> /etc/profile
echo "alias curl=\"curl --compressed -H 'Cache-Control: no-cache, no-store, must-revalidate' -H 'Expires: 0' -H 'Pragma: no-cache' \"" >> /etc/profile
echo "alias curls=\"curl --compressed -H 'Cache-Control: no-cache, no-store, must-revalidate' -H 'Expires: 0' -H 'Pragma: no-cache' -sL \"" >> /etc/profile
echo -e "\nexport \"MANPAGER=less -RF --mouse --use-color\"" >> /etc/profile
export "MANPAGER=less -RF --mouse --use-color"
echo "export \"PAGER=less -RF --mouse --use-color\"" >> /etc/profile
export "PAGER=less -RF --mouse --use-color"
echo "export \"LESS=-RF --mouse --use-color\"" >> /etc/profile
export "LESS=-RF --mouse --use-color"
echo "export \"LESSOPEN=| /usr/bin/source-highlight-esc.sh %s\"" >> /etc/profile
export "LESSOPEN=| /usr/bin/source-highlight-esc.sh %s"
echo "export \"GREP_OPTIONS=--color=auto\"" >> /etc/profile
export "GREP_OPTIONS=--color=auto"
if [ "$gpu" = "amd" ]; then
libvadriver="radeonsi"
fi
if [ "$gpu" = "intel" ]; then
libvadriver="i965"
vdpaudriver="va_gl"
fi
if [ "$gpu" = "nvidia" ]; then
libvadriver="nvidia"
vdpaudriver="nvidia"
fi
echo -e "\nexport \"JDK_JAVA_OPTIONS=-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel\"" >> /etc/profile
echo "export \"PROTON_FORCE_LARGE_ADDRESS_AWARE=1\"" >> /etc/profile
echo "export \"PROTON_ENABLE_NGX_UPDATER=1\"" >> /etc/profile
echo "export \"PROTON_ENABLE_NVAPI=1\"" >> /etc/profile
echo "export \"__GL_THREADED_OPTIMIZATIONS=1\"" >> /etc/profile
echo "export \"DOTNET_CLI_TELEMETRY_OPTOUT=1\"" >> /etc/profile
echo "export \"GTK_OVERLAY_SCROLLING=1\"" >> /etc/profile
echo "export \"GTK_CSD=1\"" >> /etc/profile
echo "export \"ROC_ENABLE_PRE_VEGA=1\"" >> /etc/profile
echo "export \"ELECTRON_TRASH=gio\"" >> /etc/profile
echo -e "\nJDK_JAVA_OPTIONS=-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" >> /etc/environment
echo "PROTON_FORCE_LARGE_ADDRESS_AWARE=1" >> /etc/environment
echo "PROTON_ENABLE_NGX_UPDATER=1" >> /etc/environment
echo "PROTON_ENABLE_NVAPI=1" >> /etc/environment
echo "__GL_THREADED_OPTIMIZATIONS=1" >> /etc/environment
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> /etc/environment
echo "GTK_OVERLAY_SCROLLING=1" >> /etc/environment
echo "GTK_CSD=1" >> /etc/environment
echo "ROC_ENABLE_PRE_VEGA=1" >> /etc/environment
echo "ELECTRON_TRASH=gio" >> /etc/environment
echo "LESS=-RF --mouse --use-color" >> /etc/environment
echo "LESSOPEN='| /usr/bin/source-highlight-esc.sh %s'" >> /etc/environment
echo "GREP_OPTIONS=--color=auto" >> /etc/environment
echo "export \"LIBVA_DRIVER_NAME=${libvadriver}\"" >> /etc/profile
echo "LIBVA_DRIVER_NAME=${libvadriver}" >> /etc/environment
echo "export \"GST_VAAPI_ALL_DRIVERS=1\"" >> /etc/profile
echo "GST_VAAPI_ALL_DRIVERS=1" >> /etc/environment
if [ "$gpu" != "amd" ]; then
echo "export \"VDPAU_DRIVER=${libvadriver}\"" >> /etc/profile
echo "VDPAU_DRIVER=${libvadriver}" >> /etc/environment
fi
if [ "$gpu" = "nvidia" ]; then
echo "export \"GBM_BACKEND=nvidia-drm\"" >> /etc/profile
echo "GBM_BACKEND=nvidia-drm" >> /etc/environment
echo "export \"__GLX_VENDOR_LIBRARY_NAME=nvidia\"" >> /etc/profile
echo "__GLX_VENDOR_LIBRARY_NAME=nvidia" >> /etc/environment
fi
echo "export \"CLICOLOR=1\"" >> /etc/profile
echo "CLICOLOR=1" >> /etc/environment
echo "export \"SYSTEMD_COLORS=true\"" >> /etc/profile
echo "SYSTEMD_COLORS=true" >> /etc/environment
echo -e "\nif [ \"\$XDG_SESSION_TYPE\" = \"wayland\" ]; then" >> /etc/profile
echo " export \"CLUTTER_BACKEND=wayland\"" >> /etc/profile
echo "fi" >> /etc/profile
echo -e "\nwal --vte -q -R || (cat ~/.cache/wal/sequences &) || source ~/.cache/wal/colors-tty.sh || true" >> /etc/profile
if [ "$psdbool" = "true" ]; then
echo "systemctl --user enable --now psd.service" >> /etc/profile
fi
if [ "$rfkbool" = "false" ]; then
echo "rfkill unblock all" >> /etc/profile
fi
ln -sf /usr/share/zoneinfo/$timezone /etc/localtime
hwclock -w
sed -i "/#en_GB.UTF-8/s/^#//g" /etc/locale.gen
sed -i "/#en_US.UTF-8/s/^#//g" /etc/locale.gen
locale-gen
echo "LANG=en_GB.UTF-8" > /etc/locale.conf
export "LANG=en_GB.UTF-8"
echo "LC_COLLATE=C" >> /etc/locale.conf
echo "TIME_STYLE=posix-long-iso" >> /etc/locale.conf
sed -i "/#Color/s/^#//g" /etc/pacman.conf
sed -i "/#ParallelDownloads/s/^#//g" /etc/pacman.conf
sed -i "s/^CheckSpace/#CheckSpace/g" /etc/pacman.conf
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
sed -i "/# set autoindent/s/^# //g" /etc/nanorc
sed -i "/# set constantshow/s/^# //g" /etc/nanorc
sed -i "/# set indicator/s/^# //g" /etc/nanorc
sed -i "/# set linenumbers/s/^# //g" /etc/nanorc
sed -i "/# set locking/s/^# //g" /etc/nanorc
sed -i "/# set minibar/s/^# //g" /etc/nanorc
sed -i "/# set mouse/s/^# //g" /etc/nanorc
sed -i "s/^# set tabsize 8/set tabsize 4/g" /etc/nanorc
sed -i "/# set tabstospaces/s/^# //g" /etc/nanorc
sed -i "/# set trimblanks/s/^# //g" /etc/nanorc
sed -i "/# include \"\/usr\/share\/nano\/*.nanorc\"/s/^# //g" /etc/nanorc
sed -i "/# bind ^S/s/^# //g" /etc/nanorc
echo -e "\ninclude \"/usr/share/nano-syntax-highlighting/*.nanorc\"" >> /etc/nanorc
unset VISUAL
unset EDITOR
unset SUDO_EDITOR
SUDO_EDITOR="sed -i \"/#[[:blank:]]Defaults[[:blank:]]env_keep/s/^#[[:blank:]]//g\"" visudo
SUDO_EDITOR="sed -i \"/#[[:blank:]]%wheel[[:blank:]]ALL=(ALL:ALL)[[:blank:]]ALL/s/^#[[:blank:]]//g\"" visudo
SUDO_EDITOR="sed -i \"/#[[:blank:]]%sudo[[:blank:]]ALL=(ALL:ALL)[[:blank:]]ALL/s/^#[[:blank:]]//g\"" visudo
echo -e "\nexport \"VISUAL=nano\"" >> /etc/profile
export "VISUAL=nano"
echo "export \"EDITOR=nano\"" >> /etc/profile
export "EDITOR=nano"
echo "export \"SUDO_EDITOR=nano\"" >> /etc/profile
export "SUDO_EDITOR=nano"
echo -e "\nDefaults passwd_timeout=0,pwfeedback,timestamp_type=global" >> /etc/sudoers
echo "$hostname" > /etc/hostname
cat > /etc/hosts << EOF
127.0.0.1 localhost
::1 localhost
127.0.1.1 ${hostname}
EOF
sed -i "s#^SHELL=/bin/bash#SHELL=/usr/bin/zsh#g" /etc/default/useradd
sed -ie "s/^FAIL_DELAY[[:blank:]]\+3/FAIL_DELAY 1/g" /etc/login.defs
sed -i "s/^# fail_interval = 900/fail_interval = 600/g" /etc/security/faillock.conf
sed -i "s/^# unlock_time = 600/unlock_time = 60/g" /etc/security/faillock.conf
sed -i "s/^# root_unlock_time = 900/root_unlock_time = 60/g" /etc/security/faillock.conf
sed -i "s/^#NAutoVTs=6/NAutoVTs=3/g" /etc/systemd/logind.conf
sed -i "/#swapfc_enabled=1/s/^#//g" /etc/systemd/swap.conf
sed -i "s/^#swapfc_enabled=0/swapfc_enabled=1/g" /etc/systemd/swap.conf
sed -i "s/^# --country France,Germany/--country \"$country\"/g" /etc/xdg/reflector/reflector.conf
sed -i "s/^--latest 5/--latest 20/g" /etc/xdg/reflector/reflector.conf
sed -i "s/^--sort age/--sort rate/g" /etc/xdg/reflector/reflector.conf
sed -i "s/^#Storage=external/Storage=none/g" /etc/systemd/coredump.conf
echo -e "\nset colored-completion-prefix on" >> /etc/inputrc
echo "set colored-stats on" >> /etc/inputrc
echo "set completion-ignore-case on" >> /etc/inputrc
echo "set completion-prefix-display-length 3" >> /etc/inputrc
echo "set echo-control-characters off" >> /etc/inputrc
echo "set mark-symlinked-directories on" >> /etc/inputrc
echo "set menu-complete-display-prefix on" >> /etc/inputrc
echo "set show-all-if-ambiguous on" >> /etc/inputrc
echo "set show-all-if-unmodified on" >> /etc/inputrc
echo "set visible-stats on" >> /etc/inputrc
cat > /etc/systemd/network/20-wired.network << EOF
[Match]
Name=en*
Name=eth*
[Network]
DHCP=yes
IgnoreCarrierLoss=5s
[DHCPv4]
RouteMetric=10
EOF
cat > /etc/systemd/network/25-wireless.network << EOF
[Match]
Name=wl*
[Network]
DHCP=yes
IgnoreCarrierLoss=5s
[DHCPv4]
RouteMetric=20
EOF
git config --system alias.graph "log --graph --oneline --decorate"
cputhreads="$(lscpu -p | grep -Ev '^#' | sort -u -t, -k 2,4 | wc -l)"
sed -i "s/-march=x86-64 -mtune=generic/-march=native/g" /etc/makepkg.conf
sed -i "/^#RUSTFLAGS/s/^#//g" /etc/makepkg.conf
sed -i "s/-C opt-level=2/-C opt-level=2 -C target-cpu=native/g" /etc/makepkg.conf
sed -i "/^#MAKEFLAGS/s/^#//g" /etc/makepkg.conf
sed -i "s/-j2/-j${cputhreads}/g" /etc/makepkg.conf
sed -i "s/.pkg.tar.zst/.pkg.tar.lz4/g" /etc/makepkg.conf
sed -i "s/zstd -c -z -q -/zstd -c -z -q --threads=0 -/g" /etc/makepkg.conf
sed -i "s/xz -c -z -/xz -c -z --threads=0 -/g" /etc/makepkg.conf
sed -i "s/^BINARIES=()/BINARIES=(setfont)/g" /etc/mkinitcpio.conf
sed -i '/#COMPRESSION="lz4"/s/^#//g' /etc/mkinitcpio.conf
sed -i '/#MODULES_DECOMPRESS="yes"/s/^#//g' /etc/mkinitcpio.conf
cat > /etc/sysctl.d/99-sysctl.conf << EOF
kernel.kexec_load_disabled=1
kernel.printk = 3 3 3 3
net.ipv4.tcp_fastopen=3
vm.stat_interval=120
vm.vfs_cache_pressure=50
EOF
if [ "$gpu" = "amd" ]; then
sed -i "/^HOOKS/s/)$/ amdgpu)/g" /etc/mkinitcpio.conf
fi
if [ "$gpu" = "intel" ]; then
sed -i "/^HOOKS/s/)$/ i915)/g" /etc/mkinitcpio.conf
fi
if [ "$gpu" = "nvidia" ]; then
sed -i "/^HOOKS/s/)$/ nvidia nvidia_modeset nvidia_uvm nvidia_drm)/g" /etc/mkinitcpio.conf
sed -i "/^HOOKS/s/ kms//g" /etc/mkinitcpio.conf
cat > /etc/modprobe.d/nvidia.conf << EOF
options nvidia-drm modeset=1
options nvidia NVreg_UsePageAttributeTable=1
options nvidia NVreg_RegistryDwords="OverrideMaxPerf=0x1"
EOF
fi
if [ "$fbinitramfs" = "false" ]; then
sed -i "s/'default' 'fallback'/'default'/g" /etc/mkinitcpio.d/linux-zen.preset
sed -i "s/^fallback/#fallback/g" /etc/mkinitcpio.d/linux-zen.preset
sed -i "s/'default' 'fallback'/'default'/g" /etc/mkinitcpio.d/linux.preset
sed -i "s/^fallback/#fallback/g" /etc/mkinitcpio.d/linux.preset
fi
echo "options kvm_amd nested=1" > /etc/modprobe.d/kvm_amd.conf
echo "options kvm_intel nested=1" > /etc/modprobe.d/kvm_intel.conf
if [ "$bluetoothbool" = "true" ]; then
sed -i "s/^#AutoEnable=true/AutoEnable=true/g" /etc/bluetooth/main.conf
fi
if [ "$bluetoothbool" = "false" ]; then
sed -i "s/^#AutoEnable=true/AutoEnable=false/g" /etc/bluetooth/main.conf
fi
cat > /etc/chromium-flags.conf << EOF
--disable-breakpad
--disable-crash-reporter
--enable-features=UseOzonePlatform,VaapiIgnoreDriverChecks,VaapiVideoDecoder,WaylandWindowDecorations,WebRTCPipeWireCapturer,WebUIDarkMode
--enable-gpu-rasterization
--enable-zero-copy
--force-dark-mode
--gtk-version=4
--ignore-gpu-blocklist
--no-startup-window
--ozone-platform-hint=auto
--password-store=basic
--process-per-site
--start-maximized
--use-gl=egl
EOF
ln -f /etc/chromium-flags.conf /etc/brave-flags.conf
ln -f /etc/chromium-flags.conf /etc/brave-beta-flags.conf
ln -f /etc/chromium-flags.conf /etc/brave-nightly-flags.conf
ln -f /etc/chromium-flags.conf /etc/chrome-flags.conf
ln -f /etc/chromium-flags.conf /etc/chrome-beta-flags.conf
ln -f /etc/chromium-flags.conf /etc/chrome-dev-flags.conf
ln -f /etc/chromium-flags.conf /etc/chromium-canary-flags.conf
ln -f /etc/chromium-flags.conf /etc/chromium-dev-flags.conf
ln -f /etc/chromium-flags.conf /etc/code-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron12-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron13-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron14-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron15-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron16-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron17-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron18-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron19-flags.conf
ln -f /etc/chromium-flags.conf /etc/electron20-flags.conf
ln -f /etc/chromium-flags.conf /etc/microsoft-edge-beta-flags.conf
ln -f /etc/chromium-flags.conf /etc/microsoft-edge-dev-flags.conf
ln -f /etc/chromium-flags.conf /etc/microsoft-edge-stable-flags.conf
ln -f /etc/chromium-flags.conf /etc/vivaldi-snapshot.conf
ln -f /etc/chromium-flags.conf /etc/vivaldi-stable.conf
cd /
Xorg :0 -configure
mv -f /root/xorg.conf.new /etc/X11/xorg.conf
mv -f xorg.conf.new /etc/X11/xorg.conf
nvidia-xconfig
mv -f /root/xorg.conf.new /etc/X11/xorg.conf
mv -f xorg.conf.new /etc/X11/xorg.conf
rm -f xorg.conf.new /root/xorg.conf.new /etc/X11/xorg.conf.new xorg.conf.backup /root/xorg.conf.backup /etc/X11/xorg.conf.backup xorg.conf.nvidia-xconfig-original /root/xorg.conf.nvidia-xconfig-original /etc/X11/xorg.conf.nvidia-xconfig-original
cd /
pacman --noconfirm -Syu
echo -e "${gg}• floppyOS installed and configured.${cc}"
grouplist="adm audio bluetooth camera cdrom dialout dip fax floppy fuse gamemode games informant input kvm libvirt locate log lp lpadmin netdev network optical plugdev power render rfkill scanner src storage sudo sys systemd-journal tape tty users utmp uucp video voice wheel"
for g in "${=grouplist}"; do
getent group $g || { grouplist=${grouplist//$g }; grouplist=${grouplist// $g} }
done
grouplist=${grouplist// /,}
useradd -m -G $grouplist -c "$userdisplayname" $username
echo -e "${bb}• Please enter the administrator's password.${cc}"
until passwd $username; do continue; done
echo -e "${bb}• Please enter the root's password to complete the installation.${cc}"
until passwd; do continue; done
echo -e "${yy}• Installing the yay AUR helper and the AUR base packages...${cc}"
if [ "$gpu" = "nvidia" ]; then
nvmpsv=" nvidia-modprobe-service"
fi
basepackages_aur="adw-gtk-theme dar fastfetch git-extras lha libva-vdpau-driver-vp9-git mkinitcpio-firmware ntfsprogs-ntfs3 pacman-cleanup-hook phinger-cursors rar speedtest++ systemd-boot-pacman-hook systemd-cleanup-pacman-hook t2sz yt-dlp-drop-in zpaq zulu-19-bin${nvmpsv}"
cd /
sudo -u $username -i << EOF
wal --vte -f /etc/fl-one-half-dark.json
emulate sh -c "source /etc/profile"
cd ~
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg --noconfirm -Cis
cd ..
rm -rf yay
cd ~
yay -Y --sudoloop --devel --batchinstall --save
yay -Y --gendb
yay --noconfirm -Syu
until yay --noconfirm --needed -S ${basepackages_aur}${java8}; do continue; done
until yay --noconfirm --needed --mflags --skipinteg -S czkawka-cli-bin; do continue; done
until yay --noconfirm --needed -S informant; do continue; done
yay --noconfirm -Sc
czkawka-cli empty-folders -DX -d /
EOF
cd /
if pacman -Q gnome-shell; then
cat > /etc/X11/xinit/xinitrc << EOF
export XDG_SESSION_TYPE=x11
export GDK_BACKEND=x11
exec gnome-session
EOF
echo -e "\nif [ \"\$XDG_SESSION_TYPE\" = \"x11\" ] || [ \"\$XDG_SESSION_TYPE\" = \"wayland\" ]; then" >> /etc/profile
echo " alias logout='gnome-session-quit --no-prompt '" >> /etc/profile
echo "fi" >> /etc/profile
fi
mv -f /usr/share/libalpm/hooks/00-informant.hook /usr/share/libalpm/hooks/00-informant.disabledhook
informant read --all
usermod -aG informant $username
echo -e "\nalias fl-basepackages-aur='yay -Qi ${basepackages_aur} '" >> /etc/profile
echo -e "\nexport PATH=\"${PATH}:/opt/rocm/bin\"" >> /etc/zsh/zprofile
echo "source /usr/share/doc/git-extras/git-extras-completion.zsh" >> /etc/zsh/zprofile
mkdir -p /etc/dconf/profile
cat > /etc/dconf/profile/user << EOF
user-db:user
system-db:local
EOF
mkdir -p /etc/dconf/db/local.d
cat > /etc/dconf/db/local.d/00-fl-config << EOF
[ca/desrt/dconf-editor]
mouse-use-extra-buttons=true
refresh-settings-schema-source=true
restore-view=false
saved-pathbar-path="/"
saved-view="/"
show-warning=false
sort-case-sensitive=true
use-shortpaths=true
window-is-maximized=true
[com/ubuntu/update-notifier]
no-show-notifications=true
[org/freedesktop/tracker/extract]
wait-for-miner-fs=true
[org/freedesktop/tracker/fts]
enable-stemmer=true
enable-unaccent=true
ignore-numbers=true
ignore-stop-words=true
[org/freedesktop/tracker/miner/files]
enable-monitors=true
index-on-battery=true
index-on-battery-first-time=true
[org/gnome/baobab/ui]
active-chart="rings"
is-maximized=true
[org/gnome/calculator]
angle-units="degrees"
button-mode="basic"
number-format="automatic"
show-thousands=false
show-zeroes=false
window-maximized=true
[org/gnome/Connections]
first-run=false
[org/gnome/control-center]
show-development-warning=false
[org/gnome/desktop/app-folders]
folder-children="[]"
[org/gnome/desktop/background]
color-shading-type="vertical"
draw-background=true
picture-opacity=100
primary-color="#000000"
secondary-color="#023B88"
[org/gnome/desktop/calendar]
show-weekdate=true
[org/gnome/desktop/datetime]
automatic-timezone=true
[org/gnome/desktop/input-sources]
show-all-sources=true
[org/gnome/desktop/interface]
buttons-have-icons=true
can-change-accels=false
clock-format="24h"
clock-show-date=false
clock-show-seconds=true
clock-show-weekday=false
color-scheme="prefer-dark"
cursor-blink=false
cursor-theme="phinger-cursors"
enable-hot-corners=false
font-hinting="full"
gtk-theme="adw-gtk3-dark"
icon-theme="Papirus-Dark"
locate-pointer=false
menubar-detachable=false
menus-have-tearoff=false
monospace-font-name="Mononoki Nerd Font 11"
overlay-scrolling=true
show-battery-percentage=false
toolbar-detachable=false
toolbar-style="both"
[org/gnome/desktop/lockdown]
disable-user-switching=true
[org/gnome/desktop/media-handling]
automount=false
automount-open=false
autorun-never=true
[org/gnome/desktop/notifications]
show-banners=true
show-in-lock-screen=false
[org/gnome/desktop/peripherals/keyboard]
numlock-state=false
remember-numlock-state=false
[org/gnome/desktop/peripherals/mouse]
accel-profile="flat"
middle-click-emulation=false
[org/gnome/desktop/peripherals/pointingstick]
accel-profile="flat"
[org/gnome/desktop/peripherals/touchpad]
accel-profile="flat"
click-method="areas"
disable-while-typing=false
edge-scrolling-enabled=true
left-handed="mouse"
middle-click-emulation=true
send-events="enabled"
tap-and-drag=true
tap-and-drag-lock=false
tap-to-click=true
two-finger-scrolling-enabled=true
[org/gnome/desktop/peripherals/trackball]
accel-profile="flat"
middle-click-emulation=false
[org/gnome/desktop/privacy]
disable-sound-output=false
hide-identity=false
old-files-age=30
recent-files-max-age=1
remember-app-usage=false
remember-recent-files=true
remove-old-temp-files=true
remove-old-trash-files=true
report-technical-problems=false
send-software-usage-stats=false
show-full-name-in-top-bar=true
[org/gnome/desktop/screensaver]
color-shading-type="solid"
embedded-keyboard-enabled=false
idle-activation-enabled=true
lock-enabled=true
logout-enabled=false
picture-opacity=100
primary-color="#000000"
secondary-color="#000000"
show-full-name-in-top-bar=false
status-message-enabled=false
ubuntu-lock-on-suspend=true
user-switch-enabled=false
[org/gnome/desktop/search-providers]
disable-external=false
[org/gnome/desktop/sound]
allow-volume-above-100-percent=true
event-sounds=true
input-feedback-sounds=true
[org/gnome/desktop/thumbnailers]
disable-all=false
[org/gnome/desktop/wm/preferences]
action-double-click-titlebar="toggle-maximize"
action-middle-click-titlebar="toggle-shade"
action-right-click-titlebar="menu"
audible-bell=true
button-layout="appmenu:minimize,maximize,close"
focus-mode="click"
focus-new-windows="smart"
raise-on-click=true
[org/gnome/epiphany]
active-clear-data-items=0
ask-for-default=false
enable-caret-browsing=false
middle-click-opens-url=true
new-windows-in-tabs=true
restore-session-delaying-loads=true
restore-session-policy="crashed"
start-in-incognito-mode=false
use-google-search-suggestions=true
warn-on-close-unsubmitted-data=true
[org/gnome/gedit/preferences/editor]
auto-indent=true
auto-save=false
bracket-matching=true
display-line-numbers=true
highlight-current-line=true
insert-spaces=true
restore-cursor-position=false
search-highlighting=true
syntax-highlighting=true
tabs-size=4
[org/gnome/gedit/preferences/print]
print-header=true
print-line-numbers=1
print-syntax-highlighting=true
[org/gnome/gedit/preferences/ui]
bottom-panel-visible=false
show-tabs-mode="auto"
side-panel-visible=false
statusbar-visible=true
[org/gnome/gnome-session]
auto-save-session=false
auto-save-session-one-shot=false
logout-prompt=true
show-fallback-warning=false
[org/gnome/GWeather4]
temperature-unit="centigrade"
distance-unit="meters"
speed-unit="ms"
pressure-unit="hpa"
[org/gnome/logs]
ignore-warning=true
sort-order="descending-time"
[org/gnome/mutter]
attach-modal-dialogs=false
auto-maximize=true
center-new-windows=true
dynamic-workspaces=true
edge-tiling=true
[org/gnome/nautilus/preferences]
always-use-location-entry=true
click-policy="double"
confirm-trash=false
default-sort-in-reverse-order=false
default-sort-order="name"
install-mime-activation=false
migrated-gtk-settings=true
mouse-use-extra-buttons=true
open-folder-on-dnd-hover=true
show-create-link=true
show-delete-permanently=false
show-hidden-files=false
sort-directories-first=true
[org/gnome/nautilus/preferences/compression]
default-compression-format="zip"
[org/gnome/nautilus/preferences/list-view]
use-tree-view=false
[org/gnome/nautilus/preferences/window-state]
maximized=true
[org/gnome/settings-daemon/peripherals/keyboard]
numlock-state="off"
[org/gnome/settings-daemon/peripherals/touchscreen]
orientation-lock=false
[org/gnome/settings-daemon/plugins/color]
night-light-enabled=false
night-light-schedule-automatic=true
[org/gnome/settings-daemon/plugins/media-keys]
volume-step=5
[org/gnome/settings-daemon/plugins/power]
idle-dim=true
lid-close-suspend-with-external-monitor=false
power-saver-profile-on-low-battery=true
sleep-inactive-ac-type="nothing"
sleep-inactive-battery-type="nothing"
[org/gnome/settings-daemon/plugins/updates]
active=false
[org/gnome/settings-daemon/plugins/xsettings]
hinting="full"
[org/gnome/shell]
always-show-log-out=true
development-tools=true
disable-user-extensions=false
enabled-extensions=["appindicatorsupport@rgcjonas.gmail.com", "color-picker@tuberry", "drive-menu@gnome-shell-extensions.gcampax.github.com", "favourites-in-appgrid@harshadgavali.gitlab.org", "gnome-fuzzy-app-search@gnome-shell-extensions.Czarlie.gitlab.com", "gnome-ui-tune@itstime.tech", "impatience@gfxmonk.net", "pixel-saver@deadalnix.me", "places-menu@gnome-shell-extensions.gcampax.github.com", "transparent-window-moving@noobsai.github.com", "workspace-indicator@gnome-shell-extensions.gcampax.github.com"]
favorite-apps="[]"
[org/gnome/shell/extensions/appindicator]
icon-opacity=255
legacy-tray-enabled=true
tray-pos="right"
[org/gnome/shell/extensions/color-picker]
auto-copy=true
default-format=0
enable-format=true
enable-notify=true
enable-preview=true
enable-shortcut=true
enable-systray=true
menu-style=false
notify-style=1
persistent-mode=true
preview-style=0
[org/gnome/shell/extensions/gnome-fuzzy-app-search]
applications=true
[org/gnome/shell/extensions/gnome-ui-tune]
always-show-thumbnails=true
hide-search=true
increase-thumbnails-size="200%"
overview-firefox-pip=true
restore-thumbnails-background=true
[org/gnome/shell/extensions/net/gfxmonk/impatience]
speed-factor=0.5
[org/gnome/shell/extensions/transparent-window-moving]
transparent-on-moving=true
transparent-on-resizing=true
window-opacity=128
[org/gnome/shell/weather]
automatic-location=true
[org/gnome/shell/window-switcher]
app-icon-mode="both"
[org/gnome/software]
allow-updates=false
download-updates=false
download-updates-notify=false
enable-repos-dialog=true
installed-page-show-size=true
prompt-for-nonfree=false
refresh-when-metered=false
review-karma-required=0
show-nonfree-ui=false
show-only-free-apps=false
show-ratings=true
show-upgrade-prerelease=true
[org/gnome/system/location]
enabled=true
max-accuracy-level="exact"
[org/gnome/terminal/legacy]
always-check-default-terminal=true
confirm-close=true
default-show-menubar=true
menu-accelerator-enabled=true
mnemonics-enabled=false
new-tab-position="last"
new-terminal-mode="tab"
shell-integration-enabled=true
shortcuts-enabled=true
tab-policy="automatic"
tab-position="top"
theme-variant="dark"
[org/gnome/Terminal/Legacy/Profile]
audible-bell=true
cursor-blink-mode="off"
cursor-shape="block"
enable-sixel=true
encoding="UTF-8"
exit-action="close"
login-shell=true
rewrap-on-resize=true
scroll-on-keystroke=true
scroll-on-output=false
scrollback-unlimited=false
scrollbar-policy="always"
text-blink-mode="focused"
[org/gnome/tweaks]
show-extensions-notice=false
[org/gtk/settings/debug]
enable-inspector-keybinding=true
inspector-warning=false
[org/gtk/settings/file-chooser]
clock-format="24h"
location-mode="filename-entry"
show-hidden=false
show-size-column=true
show-type-column=true
sort-column="name"
sort-directories-first=true
sort-order="ascending"
startup-mode="cwd"
type-format="description"
[org/gtk/gtk2/settings/debug]
enable-inspector-keybinding=true
inspector-warning=false
[org/gtk/gtk2/settings/file-chooser]
clock-format="24h"
location-mode="filename-entry"
show-hidden=false
show-size-column=true
show-type-column=true
sort-column="name"
sort-directories-first=true
sort-order="ascending"
startup-mode="cwd"
type-format="description"
[org/gtk/gtk3/settings/debug]
enable-inspector-keybinding=true
inspector-warning=false
[org/gtk/gtk3/settings/file-chooser]
clock-format="24h"
location-mode="filename-entry"
show-hidden=false
show-size-column=true
show-type-column=true
sort-column="name"
sort-directories-first=true
sort-order="ascending"
startup-mode="cwd"
type-format="description"
[org/gtk/gtk4/settings/debug]
enable-inspector-keybinding=true
inspector-warning=false
[org/gtk/gtk4/settings/file-chooser]
clock-format="24h"
location-mode="filename-entry"
show-hidden=false
show-size-column=true
show-type-column=true
sort-column="name"
sort-directories-first=true
sort-order="ascending"
startup-mode="cwd"
type-format="description"
EOF
dconf update
cat > /etc/gtksettings.ini << EOF
[Settings]
gtk-application-prefer-dark-theme = 1
gtk-button-images = 1
gtk-can-change-accels = 0
gtk-cursor-blink = 0
gtk-cursor-theme-name = phinger-cursors
gtk-decoration-layout = icon,menu:minimize,maximize,close
gtk-enable-event-sounds = 1
gtk-enable-input-feedback-sounds = 1
gtk-enable-tooltips = 1
gtk-error-bell = 1
gtk-hint-font-metrics = 1
gtk-icon-theme-name = Papirus-Dark
gtk-menu-bar-popup-delay = 0
gtk-menu-images = 1
gtk-menu-popdown-delay = 0
gtk-menu-popup-delay = 0
gtk-overlay-scrolling = 1
gtk-primary-button-warps-slider = 1
gtk-recent-files-enabled = 1
gtk-recent-files-max-age = 1
gtk-show-input-method-menu = 1
gtk-show-unicode-menu = 1
gtk-theme-name = adw-gtk3-dark
gtk-toolbar-style = both
gtk-xft-antialias = 1
gtk-xft-hinting = 1
gtk-xft-hintstyle = hintfull
EOF
mkdir -p /etc/gtk-2.0 /etc/gtk-3.0 /etc/gtk-4.0
ln -f /etc/gtksettings.ini /etc/gtk-2.0/gtkrc
ln -f /etc/gtksettings.ini /etc/gtk-2.0/settings.ini
ln -f /etc/gtksettings.ini /etc/gtk-3.0/gtkrc
ln -f /etc/gtksettings.ini /etc/gtk-3.0/settings.ini
ln -f /etc/gtksettings.ini /etc/gtk-4.0/gtkrc
ln -f /etc/gtksettings.ini /etc/gtk-4.0/settings.ini
cat > /etc/gtkfilechooser.ini << EOF
[Filechooser Settings]
LocationMode=filename-entry
ShowHidden=false
ShowSizeColumn=true
SortColumn=name
SortOrder=ascending
StartupMode=cwd
EOF
ln -f /etc/gtkfilechooser.ini /etc/gtk-2.0/gtkfilechooser.ini
ln -f /etc/gtkfilechooser.ini /etc/gtk-3.0/gtkfilechooser.ini
ln -f /etc/gtkfilechooser.ini /etc/gtk-4.0/gtkfilechooser.ini
until curl --compressed -H "Cache-Control: no-cache, no-store, must-revalidate" -H "Expires: 0" -H "Pragma: no-cache" -L -o /etc/gtk.css "https://raw.githubusercontent.com/lassekongo83/adw-colors/main/themes/alpha-black/gtk.css?$(date +%s)"; do continue; done
ln -f /etc/gtk.css /etc/gtk-2.0/gtk.css
ln -f /etc/gtk.css /etc/gtk-3.0/gtk.css
ln -f /etc/gtk.css /etc/gtk-4.0/gtk.css
sed -i "s/^Inherits=Adwaita/Inherits=phinger-cursors/g" /usr/share/icons/default/index.theme
echo "NoDisplay=true" >> /usr/share/applications/avahi-discover.desktop
echo "NoDisplay=true" >> /usr/share/applications/bssh.desktop
echo "NoDisplay=true" >> /usr/share/applications/bvnc.desktop
echo "NoDisplay=true" >> /usr/share/applications/cmake-gui.desktop
echo "NoDisplay=true" >> /usr/share/applications/qv4l2.desktop
echo "NoDisplay=true" >> /usr/share/applications/qvidcap.desktop
echo "NoDisplay=true" >> /usr/share/applications/xgps.desktop
echo "NoDisplay=true" >> /usr/share/applications/xgpsspeed.desktop
if [ -e /usr/share/applications/gnome-network-panel.desktop ]; then echo "NoDisplay=true" >> /usr/share/applications/gnome-network-panel.desktop; fi
if [ -e /usr/share/applications/gnome-wifi-panel.desktop ]; then echo "NoDisplay=true" >> /usr/share/applications/gnome-wifi-panel.desktop; fi
if [ "$bluetoothbool" = "false" ]; then
if [ -e /usr/share/applications/bluetooth-sendto.desktop ]; then echo "NoDisplay=true" >> /usr/share/applications/bluetooth-sendto.desktop; fi
if [ -e /usr/share/applications/gnome-bluetooth-panel.desktop ]; then echo "NoDisplay=true" >> /usr/share/applications/gnome-bluetooth-panel.desktop; fi
fi
if [ "$lib32" = "true" ]; then
allpackages="$(pacman -Qq)"
for p in "${=allpackages}"; do
pacman -Si lib32-${p} && allpackages32="${allpackages32}lib32-${p} "
done
allpackages32="$(echo $allpackages32)"
until pacman --noconfirm --needed -S ${=allpackages32}multilib-devel; do continue; done
fi
echo -e "${yy}• Installing the systemd-boot bootloader...${cc}"
bootctl install
cat > /boot/loader/loader.conf << EOF
default floppyOS.conf
timeout ${sdboottimeout}
console-mode max
editor no
auto-firmware no
EOF
addbootentry() {
cat > /boot/loader/entries/$1.conf << EOF
title $2
linux /vmlinuz-$3
initrd /${cpu}-ucode.img
initrd /initramfs-$4.img
options clocksource=tsc hostname="${hostname}" kernel.kexec_load_disabled=1 l1tf=flush,nowarn loglevel=3 net.ipv4.tcp_fastopen=3 nvidia_drm.modeset=1 quiet rd.udev.log_level=3 root="${rootp}" rw systemd.show_status=auto tsc=reliable udev.log_level=3 vm.stat_interval=120 vm.vfs_cache_pressure=50${btbl}${pcsbl}${disablerfk}
EOF
sed -i "s/module_blacklist=btusb module_blacklist=pcspkr/module_blacklist=btusb,pcspkr/g" /boot/loader/entries/$1.conf
}
addbootentry floppyOS floppyOS linux-zen linux-zen
if [ "$fbinitramfs" = "true" ]; then
addbootentry floppyOS-fallback "floppyOS (fallback initramfs)" linux-zen linux-zen-fallback
fi
if [ "$vanillakernelbool" = "true" ]; then
addbootentry floppyOS-vanilla "floppyOS - vanilla kernel" linux linux
if [ "$fbinitramfs" = "true" ]; then
addbootentry floppyOS-vanilla-fallback "floppyOS - vanilla kernel (fallback initramfs)" linux linux-fallback
fi
fi
mv -f /usr/share/libalpm/hooks/00-informant.disabledhook /usr/share/libalpm/hooks/00-informant.hook
mv -f /usr/share/libalpm/hooks/90-mkinitcpio-install.disabledhook /usr/share/libalpm/hooks/90-mkinitcpio-install.hook
echo -e "${yy}• Generating the initial ramdisk (initramfs) using mkinitcpio...${cc}"
rm -f /boot/initramfs-linux-zen-fallback.img /boot/initramfs-linux-zen.img /boot/initramfs-linux-fallback.img /boot/initramfs-linux.img
mkinitcpio -P
echo -e "${gg}• Done!${cc}"
cd /
trap 2 20
passwd -l root
rm -f floppy-chroot.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment