Skip to content

Instantly share code, notes, and snippets.

@felikcat
Created October 14, 2023 08:12
Show Gist options
  • Save felikcat/ae4d80bd6af49f336b0bbd3bb15bc469 to your computer and use it in GitHub Desktop.
Save felikcat/ae4d80bd6af49f336b0bbd3bb15bc469 to your computer and use it in GitHub Desktop.
Dux -> GNOME installer
FREETYPE_PROPERTIES="cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"
QT_QPA_PLATFORMTHEME=qt5ct
QT_AUTO_SCREEN_SCALE_FACTOR=1
#!/bin/bash
set +H
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${SCRIPT_DIR}" && GIT_DIR=$(git rev-parse --show-toplevel)
source "${GIT_DIR}/scripts/GLOBAL_IMPORTS.sh"
source "${GIT_DIR}/configs/settings.sh"
ConfigGDM() {
GDM_CONF="/etc/gdm/custom.conf"
_move2bkup "${GDM_CONF}" &&
\cp "${cp_flags}" "${GIT_DIR}"/files/etc/gdm/custom.conf "/etc/gdm/"
sed -i "s/AutomaticLogin=~GNOME.sh~/AutomaticLogin=${YOUR_USER}/" "${GDM_CONF}"
[[ ${gdm_auto_login} -eq 1 ]] &&
sed -i "s/AutomaticLoginEnable=.*/AutomaticLoginEnable=True/" "${GDM_CONF}"
[[ ${gdm_disable_wayland} -eq 1 ]] &&
sed -i '/^#WaylandEnable/s/^#//' "${GDM_CONF}"
systemctl disable entrance.service lightdm.service lxdm.service xdm.service tdm.service sddm.service >&/dev/null || :
SERVICES+=(gdm.service)
}
# At one point it was required to install these before the rest of GNOME.
PKGS=(gdm libnm libnma)
_pkgs_add
PKGS=()
# gst-plugins-good -> Required for: Animated setting previews, such as Mouse & Touchpad -> Scroll Direction.
# Language support list for the spell checking: https://archlinux.org/packages/?q=hunspell-
# xdg-user-dirs: Some XDG compliant programs rely on this.
PKGS+=(ttf-liberation ttf-carlito ttf-caladea ttf-hack inter-font
gnome-themes-extra gnome-shell gnome-session gnome-control-center networkmanager gst-plugins-base gst-plugins-good
gsettings-desktop-schemas flatpak xdg-desktop-portal xdg-desktop-portal-gtk ibus xdg-desktop-portal-gnome xdg-user-dirs
gnome-clocks gnome-weather gnome-logs
konsole kconfig dconf-editor seahorse
qt5-wayland qt6-wayland
nuspell hunspell-en_us)
ConfigGDM
_pkgs_add
_pkgs_aur_add
ConfigNetworkmanager() {
local DIR="etc/NetworkManager/conf.d"
# Use openresolv instead of systemd-resolvconf.
\cp "${cp_flags}" "${GIT_DIR}"/files/"${DIR}"/rc-manager.conf "/${DIR}/"
# Use dnsmasq instead of systemd-resolved.
\cp "${cp_flags}" "${GIT_DIR}"/files/"${DIR}"/dns.conf "/${DIR}/"
# Tell NetworkManager to use iwd by default for increased WiFi reliability and speed.
\cp "${cp_flags}" "${GIT_DIR}/files/etc/NetworkManager/conf.d/wifi_backend.conf" "/${DIR}/"
SERVICES+=(NetworkManager.service)
# These conflict with NetworkManager.
systemctl disable connman.service systemd-networkd.service iwd.service >&/dev/null || :
}
ConfigNetworkmanager
# shellcheck disable=SC2086
systemctl enable "${SERVICES[@]}"
#!/bin/bash
set +H
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${SCRIPT_DIR}" && GIT_DIR=$(git rev-parse --show-toplevel)
source "${GIT_DIR}/scripts/GLOBAL_IMPORTS.sh"
source "${GIT_DIR}/configs/settings.sh"
if [[ ${IS_CHROOT} -eq 1 ]]; then
echo -e "\nERROR: Do not run this script inside a chroot!\n"
exit 1
fi
PKGS+=(kvantum qt6-svg qt5ct qt6ct papirus-icon-theme)
[[ ${gnome_extension_appindicator} -eq 1 ]] &&
PKGS+=(lib32-libappindicator-gtk2 lib32-libappindicator-gtk3 libappindicator-gtk2 libappindicator-gtk3 gnome-shell-extension-appindicator)
# mutter-x11-scaling = Fractional scaling support for Xorg.
PKGS_AUR+=(papirus-folders mutter-x11-scaling adw-gtk3-git)
_pkgs_add
_pkgs_aur_add
papirus-folders -C brown --theme Papirus-Dark
ExternalGnomeSettings() {
cat << 'EOF' >>"/home/${YOUR_USER}/.zshrc"
# Make files in '~/.config/environment.d' apply.
/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator >&/dev/null
EOF
_move2bkup /home/"${YOUR_USER}"/.gtkrc-2.0
_move2bkup /home/"${YOUR_USER}"/.config/{environment.d,gtk-3.0,gtk-4.0,Kvantum,qt5ct,qt6ct} &&
mkdir "${mkdir_flags}" /home/"${YOUR_USER}"/.config/{environment.d,Kvantum,qt5ct,qt6ct}
\cp "${cp_flags}" "${GIT_DIR}"/files/home/.gtkrc-2.0 "/home/${YOUR_USER}/"
\cp "${cp_flags}" "${GIT_DIR}"/files/home/.config/environment.d/gnome.conf "/home/${YOUR_USER}/.config/environment.d/"
\cp "${cp_flags}" "${GIT_DIR}"/files/home/.config/qt5ct/qt5ct.conf "/home/${YOUR_USER}/.config/qt5ct/"
\cp "${cp_flags}" "${GIT_DIR}"/files/home/.config/qt6ct/qt6ct.conf "/home/${YOUR_USER}/.config/qt6ct/"
kwriteconfig5 --file /home/"${YOUR_USER}"/.config/Kvantum/kvantum.kvconfig --group "General" --key "theme" "KvGnomeDark"
kwriteconfig5 --file /home/"${YOUR_USER}"/.config/konsolerc --group "UiSettings" --key "ColorScheme" "KvGnomeDark"
kwriteconfig5 --file /home/"${YOUR_USER}"/.config/konsolerc --group "UiSettings" --key "WindowColorScheme" "KvGnomeDark"
}
ExternalGnomeSettings
GnomeSettings() {
local SCHEMA="org.gnome.desktop"
gsettings set "${SCHEMA}".interface document-font-name "Inter Regular 11"
gsettings set "${SCHEMA}".interface font-name "Inter Regular 11"
# KDE = font size 11, GNOME = font size 10.
gsettings set "${SCHEMA}".interface monospace-font-name "Hack 10"
gsettings set "${SCHEMA}".interface font-antialiasing "grayscale"
gsettings set "${SCHEMA}".interface font-hinting "none"
gsettings set "${SCHEMA}".interface color-scheme "prefer-dark"
gsettings set "${SCHEMA}".interface gtk-theme "adw-gtk3-dark"
gsettings set "${SCHEMA}".interface icon-theme "Papirus-Dark"
gsettings set "${SCHEMA}".interface enable-animations "${gnome_animations}"
gsettings set "${SCHEMA}".peripherals.mouse accel-profile "${gnome_mouse_accel_profile}"
gsettings set "${SCHEMA}".privacy remember-app-usage "${gnome_remember_app_usage}"
gsettings set "${SCHEMA}".privacy remember-recent-files "${gnome_remember_recent_files}"
[[ ${gnome_no_idle} -eq 1 ]] &&
gsettings set "${SCHEMA}".session idle-delay "0"
}
GnomeSettings
if [[ ${gnome_no_window_shadows} -eq 1 ]]; then
if ! grep -q "decoration {box-shadow: none;}" /home/"${YOUR_USER}"/.config/gtk-3.0/gtk.css; then
touch /home/"${YOUR_USER}"/.config/gtk-3.0/gtk.css
cat << 'EOF' >>"/home/${YOUR_USER}/.config/gtk-3.0/gtk.css"
decoration {box-shadow: none;}
EOF
fi
fi
gsettings set org.gnome.shell disable-user-extensions "true"
# scale-monitor-framebuffer = Fractional scaling; 100%, 125%, 150%, etc.
# -> Allows increasing display scaling by steps of 25% instead of 100%.
# -> Downside is it increases GPU load, leading to more power usage.
#
# kms-modifiers = hardware accelerated Xwayland on NVIDIA.
# -> See: https://download.nvidia.com/XFree86/Linux-x86_64/530.41.03/README/xwayland.html
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer','kms-modifiers','x11-randr-fractional-scaling']" || :
gsettings set org.gnome.mutter center-new-windows "${gnome_center_new_windows}"
# Required for ~/.config/environment.d/gnome.conf to take effect without rebooting.
whiptail --yesno "A logout is required to complete the GNOME rice.\nLogout now?" 0 0 &&
loginctl terminate-user "${YOUR_USER}"
# === Desktop Environment: GNOME ===
# GNOME Display Manager: auto-start and login into GNOME; recommended if using LUKS.
gdm_auto_login="1"
# It's not recommended to run the stock GNOME.
allow_gnome_rice="1"
if [[ ${allow_gnome_rice} -eq 1 ]]; then
gnome_animations="false" # true, false
gnome_mouse_accel_profile="flat" # flat, adaptive, default
gnome_remember_app_usage="false" # true, false
gnome_remember_recent_files="false" # true, false
gnome_center_new_windows="true" # true, false
# Support for tray icons; some programs still rely on it.
gnome_extension_appindicator="1"
# Disable automatically turning off the screen/display.
gnome_no_idle="1"
# Disables drop-down shadows that draw under currently active windows.
gnome_no_window_shadows="1"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment