2023-05-30 22:07:01 +00:00
#!/bin/bash
################################################################################
#
2024-04-14 01:26:42 +00:00
# opensuse-setup.sh
2023-05-30 22:07:01 +00:00
# Interactive post-install setup script for OpenSUSE installations
#
################################################################################
################################################################################
#
# Constants
#
################################################################################
2023-06-02 15:46:34 +00:00
########################################
# OpenSUSE patterns
PATTERNS = (
# (Base system)
patterns-base-apparmor
patterns-base-base
patterns-base-enhanced_base
2023-06-14 20:17:53 +00:00
# (Base fonts)
patterns-fonts-fonts
2023-06-02 15:46:34 +00:00
# (Desktop environment)
patterns-gnome-gnome_basic
)
2023-05-30 22:07:01 +00:00
########################################
# Zypper packages
# To remove
2023-06-02 12:50:54 +00:00
RM = (
2024-04-14 01:26:42 +00:00
yast2-* nautilus-share nautilus-sendto MozillaFirefox-branding-openSUSE
2023-06-02 12:50:54 +00:00
)
2023-05-30 22:07:01 +00:00
# To remove (and prevent reinstallation of)
2023-06-02 12:50:54 +00:00
AL = (
2023-06-02 18:42:00 +00:00
gnome-clocks gnome-packagekit gnome-software tigervnc xterm yast2
2023-06-02 12:50:54 +00:00
)
2023-05-30 22:07:01 +00:00
# To install
2023-06-02 12:50:54 +00:00
IN = (
# (Necessary packages)
2023-09-07 22:01:22 +00:00
git-core flatpak opi podman
2023-06-02 12:50:54 +00:00
2023-09-07 22:01:22 +00:00
# (Display)
2023-10-13 13:04:10 +00:00
papirus-icon-theme fira-code-fonts gdouros-symbola-fonts google-noto-sans-cjk-fonts google-noto-coloremoji-fonts noto-fonts fetchmsttfonts
2023-06-02 12:50:54 +00:00
# (Shell utilities)
2024-04-14 01:26:42 +00:00
fish fzf ispell zenity fortune toilet cowsay wmctrl libnotify-tools ripgrep jq
2023-06-02 12:50:54 +00:00
# (Programs)
emacs inkscape gimp shotcut audacity geary nextcloud-desktop steam blender
2023-09-07 22:00:40 +00:00
# (Firefox w/o OpenSUSE branding)
MozillaFirefox-branding-upstream MozillaFirefox
2023-06-02 12:50:54 +00:00
# (GNOME utilities)
2024-04-14 01:26:42 +00:00
loupe dconf-editor baobab totem menulibre Fragments rsvg-thumbnailer gnome-session-wayland gnome-characters gnome-disk-utility gnome-font-viewer gnome-dictionary gnome-logs gnome-screenshot gnome-weather
2023-06-02 12:50:54 +00:00
2023-10-13 13:03:58 +00:00
# (Dependencies)
webp-pixbuf-loader
2023-06-02 12:50:54 +00:00
# (Misc.)
distribution-logos-openSUSE distribution-logos-openSUSE-icons distribution-logos-openSUSE-Tumbleweed
)
2023-05-30 22:07:01 +00:00
########################################
# Flatpak packages
2023-06-02 12:50:54 +00:00
FLATPAK_PACKAGES = (
com.discordapp.Discord
com.spotify.Client
com.github.tchx84.Flatseal
org.nickvision.tagger
)
2023-05-30 22:07:01 +00:00
########################################
# GNOME extensions
2023-06-02 12:50:54 +00:00
GNOME_EXTENSIONS = (
AlphabeticalAppGrid@stuarthayhurst
color-picker@tuberry
)
2023-05-30 22:07:01 +00:00
2023-06-14 20:18:24 +00:00
########################################
# Junk files
JUNK_FILES = (
.inputrc
.i18n
.bashrc
.xim-template
bin/
)
2023-05-30 22:07:01 +00:00
########################################
2023-06-02 15:46:34 +00:00
# URLs
2023-06-02 18:42:18 +00:00
PACKMAN_REPO_URL = "https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/"
2023-06-02 15:46:34 +00:00
FLATHUB_REMOTE_URL = "https://flathub.org/repo/flathub.flatpakrepo"
2024-04-14 01:26:42 +00:00
REPOS_API_URL = "https://git.tty.dog/api/v1/repos/search"
2023-05-30 22:07:01 +00:00
################################################################################
#
# Pre-setup prompts
#
################################################################################
########################################
# Pre-setup
# Ensure we're not running as root
2024-04-14 01:26:42 +00:00
if [ [ " ${ EUID } " = = 0 ] ] ; then
2023-05-30 22:07:01 +00:00
echo "DO NOT RUN THIS SCRIPT AS ROOT!"
echo "Please run this script as a regular user."
exit 1
fi
2023-06-02 19:22:54 +00:00
# Ensure PackageKit is not running so that it doesn't interrupt us
sudo systemctl stop packagekit
2023-06-02 15:46:34 +00:00
# Ensure "dialog" is installed
echo "Installing dialog utility..."
sudo zypper --non-interactive in dialog
2023-05-30 22:07:01 +00:00
########################################
# Prompt for system chassis
system_chassis = $( hostnamectl chassis)
function string_eq ( )
{
2023-06-02 15:46:34 +00:00
[ [ " ${ 1 } " = = " ${ 2 } " ] ] && echo ON || echo OFF
2023-05-30 22:07:01 +00:00
}
function prompt_chassis_type ( )
{
2023-06-02 15:46:34 +00:00
entry = $( dialog --title "Chassis Type" --stdout --no-cancel --erase-on-exit \
--radiolist "Confirm the chassis type for this system:" 0 0 0 \
"Desktop" "Stationary form factor" $( string_eq " ${ system_chassis } " "desktop" ) \
"Laptop" "Clamshell form factor" $( string_eq " ${ system_chassis } " "laptop" ) \
"Tablet" "Touchscreen form factor" $( string_eq " ${ system_chassis } " "tablet" ) \
"Convertible" "Hybrid form factor" $( string_eq " ${ system_chassis } " "convertible" ) )
2023-05-30 22:07:01 +00:00
# Ensure entry is lowercase
entry = ${ entry ,, }
case " ${ entry } " in
"desktop" | "laptop" | "convertible" | "tablet" )
if
2023-06-02 15:46:34 +00:00
dialog --title "Chassis Type" --defaultno --yesno " Use ${ entry } as chassis type? " 0 0
2023-05-30 22:07:01 +00:00
then
system_chassis = " ${ entry } "
return 0
else
return 1
fi
; ;
*)
2023-06-02 15:46:34 +00:00
dialog --title "Chassis Type" --msgbox "Please choose a chassis type for this system." 0 0
2023-05-30 22:07:01 +00:00
return 1
; ;
esac
}
# Repeatedly show the prompt until we receive valid input
until prompt_chassis_type; do : ; done
# Set chassis type
echo " Setting chassis type to ${ system_chassis } "
sudo hostnamectl chassis " ${ system_chassis } "
########################################
# Prompt for system name
2023-06-02 12:50:54 +00:00
system_name = $( hostnamectl hostname)
2023-05-30 22:07:01 +00:00
function prompt_system_name ( )
{
2023-06-02 15:46:34 +00:00
entry = $( dialog --title "System Name" --stdout --no-cancel --erase-on-exit \
--inputbox "All lowercase letters, no spaces or symbols:" 0 0 \
" ${ system_name } " )
2023-05-30 22:07:01 +00:00
# Filter all non-letter characters out of the user's entry
entry = ${ entry //[^[ : alpha : ]]/ }
# Ensure entry is lowercase
entry = ${ entry ,, }
case " ${ entry } " in
"" )
2023-06-02 15:46:34 +00:00
dialog --title "Chassis Type" --msgbox "Please enter a name for this system." 0 0
2023-05-30 22:07:01 +00:00
return 1
; ;
*)
if
2023-06-02 15:46:34 +00:00
dialog --title "Chassis Type" --defaultno --yesno " Use ${ entry } as system name? " 0 0
2023-05-30 22:07:01 +00:00
then
system_name = " ${ entry } "
return 0
else
return 1
fi
; ;
esac
}
# Repeatedly show the prompt until we receive valid input
until prompt_system_name; do : ; done
# Set hostname and pretty hostname
echo " Setting hostname to ${ system_name } ... "
sudo hostnamectl hostname " ${ system_name } "
echo " Setting pretty hostname to ${ system_name ^ } "
sudo hostnamectl hostname --pretty " ${ system_name ^ } "
########################################
# Prompt for optional additions
optional_additions = ""
function prompt_optional_additions ( )
{
2023-06-02 19:26:45 +00:00
ENTRY = $( dialog --title "Optional Additions" --stdout --no-cancel --erase-on-exit --single-quoted --output-separator '|' \
2023-06-02 15:46:34 +00:00
--checklist "Select any additional configuration changes that you would like applied to the system:" 0 0 0 \
"Xournal++" "Install Xournal++ for taking handwritten notes" OFF \
"EasyEffects" "Install EasyEffects for applying effects (e.g. equalizers) to system audio devices" OFF \
2023-06-02 16:14:32 +00:00
"Media Control Key Shortcuts" "Set up media control keyboard shortcuts (for systems without dedicated media control keys)" OFF \
"Power Button Screen Lock Override" "Override the power button's default behavior with a screen lock shortcut (for tablets and some convertibles)" OFF )
2023-05-30 22:07:01 +00:00
case " ${ ENTRY } " in
"" )
if
2023-06-02 19:26:45 +00:00
dialog --title "Chassis Type" --defaultno --yesno "Apply only baseline system configuration?" 0 0
2023-05-30 22:07:01 +00:00
then
return 0
else
return 1
fi
; ;
*)
if
2023-06-02 15:46:34 +00:00
ADDITIONS_LIST = $( echo " ${ ENTRY } " | sed "s/|/\\\\n * /g" | sed "s/'//g" )
2023-06-02 19:26:45 +00:00
dialog --title "Chassis Type" --defaultno --yesno " Confirm your selection of the following additions:\n ${ ADDITIONS_LIST } " 0 0
2023-05-30 22:07:01 +00:00
then
optional_additions = " ${ ENTRY } "
return 0
else
return 1
fi
; ;
esac
}
# Repeatedly show the prompt until we receive valid input
until prompt_optional_additions; do : ; done
2023-06-02 16:14:32 +00:00
################################################################################
#
# Feature detection
#
################################################################################
2023-06-02 17:21:34 +00:00
detected_features = ( )
2023-06-02 17:20:46 +00:00
# Mobile system detection
case " ${ system_chassis } " in
"latop" | "convertible" | "tablet" )
2023-06-02 17:42:47 +00:00
detected_features += ( 'Mobile' )
2023-06-02 17:23:03 +00:00
; ;
2023-06-02 17:20:46 +00:00
esac
# x86-64-v3 CPU support detection
CPU_FLAGS = $( cat /proc/cpuinfo | grep flags | head -n 1 | cut -d: -f2)
if
2023-06-14 19:49:22 +00:00
echo ${ CPU_FLAGS } | awk '/avx/&&/avx2/&&/bmi1/&&/bmi2/&&/f16c/&&/fma/&&/abm/&&/movbe/&&/xsave/ {found=1} END {exit !found}'
2023-06-02 17:20:46 +00:00
then
2023-06-02 17:42:47 +00:00
detected_features += ( 'x86-64-v3' )
2023-06-02 17:20:46 +00:00
fi
2023-06-02 16:14:32 +00:00
# Touchpad detection
if
cat /proc/bus/input/devices | grep -i Touchpad
then
detected_features += ( 'Touchpad' )
fi
# Windows multi-boot detection
if
sudo grep menuentry /boot/grub2/grub.cfg | grep -Po ".*Windows.*"
then
detected_features += ( 'Windows' )
fi
2023-05-30 22:07:01 +00:00
################################################################################
#
# Package setup
#
################################################################################
########################################
# Package operations
echo "Setting up packages..."
2023-06-02 17:42:47 +00:00
2023-06-02 18:44:50 +00:00
sudo zypper --non-interactive install ${ PATTERNS [@] }
2023-06-02 17:42:47 +00:00
if [ [ " ${ detected_features [@] } " = = *"Mobile" * ] ] ; then
2023-06-02 18:44:50 +00:00
sudo zypper --non-interactive install patterns-desktop-mobile
2023-06-02 17:42:47 +00:00
fi
if [ [ " ${ detected_features [@] } " = = *"x86-64-v3" * ] ] ; then
2023-06-02 18:44:50 +00:00
sudo zypper --non-interactive install patterns-glibc-hwcaps-x86_64_v3
2023-06-02 17:42:47 +00:00
fi
2023-06-02 18:42:18 +00:00
sudo zypper --non-interactive remove ${ RM [@] } ${ AL [@] }
sudo zypper --non-interactive addlock ${ AL [@] }
sudo zypper --non-interactive install ${ IN [@] }
# Install any codecs not hosted by OpenSUSE
2023-06-02 19:35:18 +00:00
sudo zypper --non-interactive --gpg-auto-import-keys addrepo -cfp 90 " ${ PACKMAN_REPO_URL } " packman
2023-09-07 22:01:34 +00:00
sudo zypper --non-interactive --gpg-auto-import-keys install --from packman ffmpeg gstreamer-plugins-{ good,bad,ugly,libav} libavcodec-full pipewire-aptx
sudo zypper --non-interactive --gpg-auto-import-keys dist-upgrade --from packman --allow-vendor-change
2023-05-30 22:07:01 +00:00
2023-06-15 01:02:46 +00:00
# FIX: ispell-american doesn't properly install its dictionary files the first time around, for some reason
sudo zypper --non-interactive install --force ispell-american
2023-05-30 22:07:01 +00:00
########################################
# Flatpak operations
echo "Setting up Flatpak remotes..."
2023-06-02 15:46:34 +00:00
2023-05-30 22:07:01 +00:00
sudo flatpak remote-add --if-not-exists flathub " ${ FLATHUB_REMOTE } "
echo "Setting up Flatpak packages..."
2023-06-02 12:50:54 +00:00
sudo flatpak install --noninteractive ${ FLATPAK_PACKAGES [@] }
2023-05-30 22:07:01 +00:00
########################################
# (OPTIONAL) Extra packages
if [ [ " ${ optional_additions } " = = *"Xournal++" * ] ] ; then
echo "Installing Xournal++..."
2023-06-02 18:44:50 +00:00
sudo zypper --non-interactive addlock texlive
sudo zypper --non-interactive install xournalpp
2023-05-30 22:07:01 +00:00
fi
if [ [ " ${ optional_additions } " = = *"EasyEffects" * ] ] ; then
echo "Installing EasyEffects..."
2023-06-02 18:44:50 +00:00
sudo zypper --non-interactive install easyeffects
2023-05-30 22:07:01 +00:00
fi
################################################################################
#
# System configuration
#
################################################################################
########################################
# GRUB configuration
# Silence GRUB
echo "Configuring GRUB..."
2023-06-02 17:48:26 +00:00
echo " # Automatically added by opensuse-personalizer.sh
2023-05-30 22:07:01 +00:00
GRUB_TIMEOUT = 0
GRUB_HIDDEN_TIMEOUT = 0
GRUB_QUIET = true
GRUB_HIDDEN_TIMEOUT_QUIET = true" | sudo tee --append /etc/default/grub
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
########################################
# PolicyKit configuration
# Create a local policy that unlocks basic networking settings for users
echo "Configuring PolicyKit..."
sudo mkdir -p /etc/polkit/localauthority/50-local.d/
echo " [Allow users to modify system network settings]
Identity = unix-group:users
Action = org.freedesktop.NetworkManager.settings.modify.system
ResultAny = auth_admin_keep
ResultInactive = auth_admin_keep
ResultActive = yes" | sudo tee /etc/polkit/localauthority/50-local.d/10-NetworkManager.pkla
################################################################################
#
# GNOME keyboard shortcuts
#
################################################################################
echo "Configuring GNOME keyboard shortcuts..."
########################################
# Navigation
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Primary><Super>Left']"
2023-09-07 22:00:59 +00:00
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Primary><Super>Right']"
2023-05-30 22:07:01 +00:00
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-left "['<Primary><Shift><Super>Left']"
2023-09-07 22:00:59 +00:00
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-right "['<Primary><Shift><Super>Right']"
2023-05-30 22:07:01 +00:00
# Swap "switch applications" (grouped alt+tab) for "switch windows" (non-grouped alt+tab) shortcuts
gsettings set org.gnome.shell.window-switcher current-workspace-only false
2023-06-02 18:55:50 +00:00
gsettings set org.gnome.desktop.wm.keybindings switch-windows " $( gsettings get org.gnome.desktop.wm.keybindings switch-applications) "
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward " $( gsettings get org.gnome.desktop.wm.keybindings switch-applications-backward) "
gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "[]"
2023-05-30 22:07:01 +00:00
########################################
# (OPTIONAL) Media
if [ [ " ${ optional_additions } " = = *"Media Control Key Shortcuts" * ] ] ; then
gsettings set org.gnome.settings-daemon.plugins.media-keys mic-mute "['<Super>Home']"
gsettings set org.gnome.settings-daemon.plugins.media-keys next "['<Control><Super>Page_Down']"
2023-09-07 22:06:00 +00:00
gsettings set org.gnome.settings-daemon.plugins.media-keys play "['<Control><Super>End']"
2023-05-30 22:07:01 +00:00
gsettings set org.gnome.settings-daemon.plugins.media-keys previous "['<Control><Super>Page_Up']"
gsettings set org.gnome.settings-daemon.plugins.media-keys volume-down "['<Super>Page_Down']"
gsettings set org.gnome.settings-daemon.plugins.media-keys volume-mute "['<Super>End']"
gsettings set org.gnome.settings-daemon.plugins.media-keys volume-up "['<Super>Page_Up']"
fi
########################################
# Windows
gsettings set org.gnome.desktop.wm.keybindings close "['<Super>w']"
gsettings set org.gnome.desktop.wm.keybindings toggle-fullscreen "['<Super>f']"
########################################
# Custom shortcuts
# Helper function (because gsettings doesn't make this simple)
function add_custom_gnome_keybinding ( )
{
EXISTING_KEYBINDINGS = $( gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings)
KEYBINDING_INDEX = $( expr $( echo $EXISTING_KEYBINDINGS | grep -oE '[0-9]+' | sort -n | tail -n 1) + 1)
KEYBINDING_PATH = /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${ KEYBINDING_INDEX } /
2023-06-02 12:50:54 +00:00
if [ [ " $EXISTING_KEYBINDINGS " = = "@as []" ] ] ; then
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings " [' ${ KEYBINDING_PATH } '] "
else
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings " $( echo ${ EXISTING_KEYBINDINGS } | sed s/.$//) , ' ${ KEYBINDING_PATH } '] "
fi
2023-05-30 22:07:01 +00:00
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:${ KEYBINDING_PATH } name " ${ 1 } "
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:${ KEYBINDING_PATH } command " ${ 2 } "
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:${ KEYBINDING_PATH } binding " ${ 3 } "
}
# Add custom shortcuts
add_custom_gnome_keybinding "Launch Terminal" "gnome-terminal" "<Super>Return"
2024-04-14 01:26:42 +00:00
add_custom_gnome_keybinding "Launch System Monitor" "gnome-system-monitor" "<Shift><Control>Escape"
2023-05-30 22:07:01 +00:00
add_custom_gnome_keybinding "Toggle Night Light" "gnome-toggle-night-light" "<Alt><Super>n"
# (OPTIONAL) Add custom shortcuts
2023-06-02 16:14:32 +00:00
if [ [ " ${ detected_features [@] } " = = *"Touchpad" * ] ] ; then
2023-05-30 22:07:01 +00:00
add_custom_gnome_keybinding "Toggle Touchpad Lock" "gnome-toggle-touchpad-lock" "<Alt><Super>t"
fi
if [ [ " ${ optional_additions } " = = *"Power Button Screen Lock Override" * ] ] ; then
add_custom_gnome_keybinding "Lock Screen" "gdm-lock-screen" "PowerOff"
fi
################################################################################
#
2023-06-15 00:45:36 +00:00
# GNOME preferences configuration
2023-05-30 22:07:01 +00:00
#
################################################################################
2023-06-15 00:45:36 +00:00
echo "Configuring GNOME preferences..."
2023-05-30 22:07:01 +00:00
2023-09-07 22:01:09 +00:00
gsettings set org.gnome.desktop.peripherals.mouse speed -0.995
2023-05-30 22:07:01 +00:00
gsettings set org.gnome.desktop.interface icon-theme "Papirus"
2023-06-02 12:50:54 +00:00
2023-05-30 22:07:01 +00:00
gsettings set org.gnome.desktop.interface clock-format '24h'
2023-06-02 12:50:54 +00:00
gsettings set org.gnome.desktop.interface clock-show-date true
gsettings set org.gnome.desktop.interface clock-show-weekday true
2023-05-30 22:07:01 +00:00
gsettings set org.gnome.desktop.interface font-name "Cantarell 10"
gsettings set org.gnome.desktop.interface document-font-name "Cantarell 10"
gsettings set org.gnome.desktop.interface monospace-font-name "Fira Code 10"
2024-04-14 01:26:42 +00:00
gsettings set org.gnome.desktop.wm.preferences auto-raise true
2023-06-15 00:45:36 +00:00
gsettings set org.gnome.desktop.wm.preferences action-middle-click-titlebar "minimize"
2023-06-14 20:18:34 +00:00
gsettings set org.gnome.desktop.notifications show-in-lock-screen false
2023-06-02 12:50:54 +00:00
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true
gsettings set org.gnome.settings-daemon.plugins.color night-light-temperature 3700
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-automatic false
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-from 22
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-to 6
2023-05-30 22:07:01 +00:00
################################################################################
#
# GNOME app folder configuration
#
################################################################################
echo "Configuring GNOME app folders..."
2023-06-02 12:50:54 +00:00
########################################
# Favorites
2023-06-02 18:55:50 +00:00
gsettings set org.gnome.shell favorite-apps "['org.gnome.Terminal.desktop', 'firefox.desktop', 'emacsclient.desktop', 'org.gnome.Geary.desktop', 'org.gnome.Nautilus.desktop']"
2023-06-02 12:50:54 +00:00
2023-05-30 22:07:01 +00:00
########################################
# Utilities folder
UTILITIES_FOLDER_PATH = /org/gnome/desktop/app-folders/folders/Utilities/
gsettings set org.gnome.desktop.app-folders folder-children "['Utilities']"
gsettings set org.gnome.desktop.app-folders.folder:${ UTILITIES_FOLDER_PATH } name "X-GNOME-Utilities.directory"
gsettings set org.gnome.desktop.app-folders.folder:${ UTILITIES_FOLDER_PATH } translate true
2023-06-02 12:50:54 +00:00
gsettings set org.gnome.desktop.app-folders.folder:${ UTILITIES_FOLDER_PATH } categories "[]"
2023-10-30 20:10:14 +00:00
gsettings set org.gnome.desktop.app-folders.folder:${ UTILITIES_FOLDER_PATH } apps "['org.gnome.FileRoller.desktop', 'org.gnome.Characters.desktop', 'ca.desrt.dconf-editor.desktop', 'org.gnome.Dictionary.desktop', 'org.gnome.baobab.desktop', 'org.gnome.DiskUtility.desktop', 'org.gnome.Evince.desktop', 'com.github.wwmm.easyeffects.desktop', 'org.gnome.Extensions.desktop', 'com.github.tchx84.Flatseal.desktop', 'org.gnome.font-viewer.desktop', 'de.haeckerfelix.Fragments.desktop', 'org.gnome.Loupe.desktop', 'org.gnome.Logs.desktop', 'menulibre.desktop', 'org.gnome.Screenshot.desktop', 'gnome-system-monitor.desktop', 'org.nickvision.tagger.desktop', 'org.gnome.tweaks.desktop', 'uefi-firmware-settings.desktop', 'org.gnome.Totem.desktop']"
2023-05-30 22:07:01 +00:00
################################################################################
#
# GNOME extension setup
#
################################################################################
echo "Setting up GNOME extensions..."
2023-06-02 12:50:54 +00:00
for EXTENSION in " ${ GNOME_EXTENSIONS [@] } " ; do
2023-05-30 22:07:01 +00:00
busctl --user call org.gnome.Shell.Extensions /org/gnome/Shell/Extensions org.gnome.Shell.Extensions InstallRemoteExtension s ${ EXTENSION }
done
2023-06-14 20:18:24 +00:00
################################################################################
#
# Junk file removal
#
################################################################################
echo "Removing junk files..."
for JUNK_FILE in " ${ JUNK_FILES [@] } " ; do
rm -r " ${ HOME } / ${ JUNK_FILE } "
done
2023-05-30 22:07:01 +00:00
################################################################################
#
# Personal configuration files and scripts
#
################################################################################
2024-04-14 01:26:42 +00:00
########################################
# Projects folder setup
echo "Setting up Projects folder..."
# Ensure ${HOME}/Projects exists and set it as the working directory
PROJECTS_DIR = ${ HOME } /Projects
if [ ! -d ${ PROJECTS_DIR } ] ; then
mkdir ${ PROJECTS_DIR }
gio set ${ PROJECTS_DIR } metadata::custom-icon-name folder-code
fi
# Perform a blobless clone of all public repos at git.tty.dog
API_URL = "https://git.tty.dog/api/v1/repos/search"
for CLONE_URL in $( curl -s " ${ API_URL } ?uid=1 " | jq -r ".data.[].clone_url" ) ; do
git clone --no-checkout --filter= blob:none " ${ CLONE_URL } " ${ PROJECTS_DIR }
done
########################################
# Dotfiles
echo "Setting up dotfiles..."
# Download dotfiles
DOTFILES_SOURCE_DIR = ${ PROJECTS_DIR } /dot-files
git -C ${ DOTFILES_SOURCE_DIR } checkout
# Link application entries
mkdir -p ${ HOME } /.local/share/applications
ln -s ${ DOTFILES_SOURCE_DIR } /applications/* ${ HOME } /.local/share/applications
# Link scripts
mkdir -p ${ HOME } /.local/bin
ln -s ${ DOTFILES_SOURCE_DIR } /bin/* ${ HOME } /.local/bin
# Copy configuration files
mkdir -p ${ HOME } /.config
cp -r ${ DOTFILES_SOURCE_DIR } /config/* ${ HOME } /.config/
# (OPTIONAL) Remove unneeded files, depending on features selected
if [ [ " ${ detected_features [@] } " != *'Touchpad' * ] ] ; then
rm ${ HOME } /.local/bin/gnome-toggle-touchpad-lock
fi
if [ [ " ${ detected_features [@] } " != *'Windows' * ] ] ; then
rm ${ HOME } /.local/share/applications/windows.desktop
rm ${ HOME } /.local/bin/reboot-windows
fi
2023-05-30 22:07:01 +00:00
########################################
# Emacs
2023-06-02 12:50:54 +00:00
echo "Setting up Emacs..."
# Remove any vendor-provided Emacs configuration files
rm ${ HOME } /.emacs ${ HOME } /.emacs.d/init.el
2024-04-14 01:26:42 +00:00
# Download and link Emacs configuration
2023-06-02 12:50:54 +00:00
EMACS_CONFIG_DIR = ${ HOME } /.config/emacs
2024-04-14 01:26:42 +00:00
EMACS_SOURCE_DIR = ${ PROJECTS_DIR } /dot-emacs
2023-06-02 12:50:54 +00:00
mkdir -p ${ EMACS_CONFIG_DIR }
2024-04-14 01:26:42 +00:00
git -C ${ EMACS_SOURCE_DIR } checkout
ln -s ${ EMACS_SOURCE_DIR } /init.el ${ EMACS_CONFIG_DIR } /init.el
# Download and link Tempel templates for Emacs...
TEMPEL_CONFIG_DIR = ${ HOME } /.config/emacs/templates
TEMPEL_SOURCE_DIR = ${ PROJECTS_DIR } /tempel-templates
git -C ${ TEMPEL_SOURCE_DIR } checkout
ln -s ${ TEMPEL_SOURCE_DIR } ${ TEMPEL_CONFIG_DIR }
2023-06-02 12:50:54 +00:00
# Enable and start Emacs daemon
systemctl --user enable emacs.service
systemctl --user start emacs.service
2023-05-30 22:07:01 +00:00
########################################
# Fish
2023-06-02 12:50:54 +00:00
echo "Setting up Fish..."
2024-04-14 01:26:42 +00:00
# Download and link Fish configuration
2023-06-02 12:50:54 +00:00
FISH_CONFIG_DIR = ${ HOME } /.config/fish
2024-04-14 01:26:42 +00:00
FISH_SOURCE_DIR = ${ PROJECTS_DIR } /dot-fish
2023-06-02 12:50:54 +00:00
mkdir -p ${ FISH_CONFIG_DIR }
2024-04-14 01:26:42 +00:00
git -C ${ FISH_SOURCE_DIR } checkout
ln -s ${ FISH_SOURCE_DIR } /config.fish ${ FISH_CONFIG_DIR } /config.fish
2023-05-30 22:07:01 +00:00
2023-06-02 12:50:54 +00:00
# Set Fish as default shell
sudo chsh ${ USER } -s $( which fish)
2023-05-30 22:07:01 +00:00
################################################################################
#
# Post-setup suggestions
#
################################################################################
2023-06-02 15:46:34 +00:00
echo "
Personalization complete!
Recommended next steps:
• Log in to Firefox Sync
• Configure Nextcloud client
2023-06-02 18:55:50 +00:00
$( if [ [ " ${ optional_additions } " = = *"EasyEffects" * ] ] ; then echo " • Install an audio device profile from" ; echo " https://autoeq.app" ; echo; fi )
2023-06-02 15:46:34 +00:00
• Install a Wireguard VPN profile from
https://mullvad.net/en/account/#/wireguard-config/?platform= linux
• Configure display settings and run 'gdm-update-display-settings'
• Run 'themer' to install/update unofficial libadwaita themes
2023-06-02 16:24:34 +00:00
A copy of these recommendations has been saved to ${ HOME } /next-steps" | tee ${ HOME } /next-steps