287 lines
7.9 KiB
Bash
287 lines
7.9 KiB
Bash
#!/bin/bash
|
|
|
|
# Arch Linux Desktop Applications Module
|
|
# Handles desktop applications, fonts, and user applications
|
|
|
|
arch_install_desktop_base() {
|
|
if ! role_enabled "DESKTOP_BASE"; then
|
|
return 0
|
|
fi
|
|
|
|
log SECTION "Installing desktop base applications"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install base desktop applications?"; then
|
|
local desktop_packages=(
|
|
cameractrls feh
|
|
)
|
|
|
|
install_packages "${desktop_packages[@]}"
|
|
|
|
# Essential Flatpak applications
|
|
local flatpak_apps=(
|
|
"com.discordapp.Discord"
|
|
"com.behringer.XAirEdit"
|
|
"com.github.vikdevelop.timer"
|
|
"io.github.efogdev.mpris-timer"
|
|
"org.remmina.Remmina"
|
|
)
|
|
|
|
for app in "${flatpak_apps[@]}"; do
|
|
install_flatpak_apps "$app"
|
|
done
|
|
|
|
# Brave browser from AUR
|
|
install_aur_packages brave-bin
|
|
|
|
log SUCCESS "Desktop base applications installed $(show_timer $section_start)"
|
|
fi
|
|
}
|
|
|
|
arch_install_fonts() {
|
|
if ! role_enabled "DESKTOP_BASE"; then
|
|
return 0
|
|
fi
|
|
|
|
log SECTION "Installing fonts"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install additional fonts?"; then
|
|
local font_packages=(
|
|
noto-fonts poppler-data adobe-source-code-pro-fonts
|
|
ttf-liberation ttf-dejavu
|
|
)
|
|
|
|
install_packages "${font_packages[@]}"
|
|
|
|
log SUCCESS "Fonts installed $(show_timer $section_start)"
|
|
fi
|
|
}
|
|
|
|
arch_install_desktop_work() {
|
|
if ! role_enabled "DESKTOP_WORK"; then
|
|
return 0
|
|
fi
|
|
|
|
log SECTION "Installing desktop work applications"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install work applications (KiCad, FreeCad, etc.)?"; then
|
|
# Applications from official repos
|
|
local work_packages=(
|
|
kicad freecad
|
|
)
|
|
|
|
install_packages "${work_packages[@]}"
|
|
|
|
# Work applications from Flatpak
|
|
local work_flatpaks=(
|
|
"org.kde.krita"
|
|
"com.prusa3d.PrusaSlicer"
|
|
"com.jgraph.drawio.desktop"
|
|
"org.gimp.GIMP"
|
|
)
|
|
|
|
for app in "${work_flatpaks[@]}"; do
|
|
install_flatpak_apps "$app"
|
|
done
|
|
|
|
log SUCCESS "Desktop work applications installed $(show_timer $section_start)"
|
|
fi
|
|
}
|
|
|
|
arch_install_media_apps() {
|
|
if ! role_enabled "DESKTOP_BASE"; then
|
|
return 0
|
|
fi
|
|
|
|
log SECTION "Installing media applications"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install media applications (video, image viewers, etc.)?"; then
|
|
local media_packages=(
|
|
mpv vlc imv imagemagick
|
|
)
|
|
|
|
install_packages "${media_packages[@]}"
|
|
|
|
# Media Flatpak applications
|
|
local media_flatpaks=(
|
|
"org.videolan.VLC"
|
|
"org.kde.kdenlive"
|
|
)
|
|
|
|
for app in "${media_flatpaks[@]}"; do
|
|
if confirm "Install $(basename $app)?"; then
|
|
install_flatpak_apps "$app"
|
|
fi
|
|
done
|
|
|
|
log SUCCESS "Media applications installed $(show_timer $section_start)"
|
|
fi
|
|
}
|
|
|
|
arch_install_office_apps() {
|
|
if ! role_enabled "DESKTOP_BASE"; then
|
|
return 0
|
|
fi
|
|
|
|
log SECTION "Installing office applications"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install office applications?"; then
|
|
local office_flatpaks=(
|
|
"org.libreoffice.LibreOffice"
|
|
"com.github.jeromerobert.pdfarranger"
|
|
)
|
|
|
|
for app in "${office_flatpaks[@]}"; do
|
|
if confirm "Install $(basename $app)?"; then
|
|
install_flatpak_apps "$app"
|
|
fi
|
|
done
|
|
|
|
log SUCCESS "Office applications installed $(show_timer $section_start)"
|
|
fi
|
|
}
|
|
|
|
arch_install_system_utilities() {
|
|
if ! role_enabled "DESKTOP_BASE"; then
|
|
return 0
|
|
fi
|
|
|
|
log SECTION "Installing system utilities"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install system utilities (file managers, etc.)?"; then
|
|
local utility_packages=(
|
|
thunar thunar-archive-plugin thunar-media-tags-plugin
|
|
file-roller gparted
|
|
)
|
|
|
|
install_packages "${utility_packages[@]}"
|
|
|
|
log SUCCESS "System utilities installed $(show_timer $section_start)"
|
|
fi
|
|
}
|
|
|
|
arch_install_communication() {
|
|
if ! role_enabled "DESKTOP_BASE"; then
|
|
return 0
|
|
fi
|
|
|
|
log SECTION "Installing communication applications"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install communication apps (beyond Discord)?"; then
|
|
local comm_flatpaks=(
|
|
"com.slack.Slack"
|
|
"org.signal.Signal"
|
|
"us.zoom.Zoom"
|
|
)
|
|
|
|
for app in "${comm_flatpaks[@]}"; do
|
|
if confirm "Install $(basename $app)?"; then
|
|
install_flatpak_apps "$app"
|
|
fi
|
|
done
|
|
|
|
log SUCCESS "Communication applications installed $(show_timer $section_start)"
|
|
fi
|
|
}
|
|
|
|
arch_install_development_gui() {
|
|
if ! role_enabled "DESKTOP_BASE" || (! role_enabled "CODE" && ! role_enabled "DEVELOPMENT"); then
|
|
return 0
|
|
fi
|
|
|
|
log SECTION "Installing GUI development tools"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install GUI development tools?"; then
|
|
local dev_gui_flatpaks=(
|
|
"com.visualstudio.code"
|
|
"com.jetbrains.IntelliJ-IDEA-Community"
|
|
)
|
|
|
|
for app in "${dev_gui_flatpaks[@]}"; do
|
|
if confirm "Install $(basename $app)?"; then
|
|
install_flatpak_apps "$app"
|
|
fi
|
|
done
|
|
|
|
log SUCCESS "GUI development tools installed $(show_timer $section_start)"
|
|
fi
|
|
}
|
|
|
|
arch_setup_desktop_environment() {
|
|
if ! role_enabled "DESKTOP_BASE"; then
|
|
return 0
|
|
fi
|
|
|
|
log SECTION "Setting up desktop environment"
|
|
local section_start=$(date +%s)
|
|
|
|
# Setup XDG directories
|
|
mkdir -p ~/Desktop ~/Documents ~/Downloads ~/Music ~/Pictures ~/Videos
|
|
|
|
# Set up mime types and default applications
|
|
if command_exists xdg-settings; then
|
|
# Set default browser if Brave is installed
|
|
if command_exists brave; then
|
|
xdg-settings set default-web-browser brave-browser.desktop
|
|
fi
|
|
fi
|
|
|
|
log SUCCESS "Desktop environment configured $(show_timer $section_start)"
|
|
}
|
|
|
|
# Special applications for specific hostnames
|
|
arch_install_hostname_specific() {
|
|
local hostname="${SYSTEM_INFO[HOSTNAME]}"
|
|
|
|
case "$hostname" in
|
|
"CMBOX")
|
|
log SECTION "Installing CMBOX-specific applications"
|
|
if confirm "Install CMBOX-specific apps?"; then
|
|
# CMBOX might need specific tools for work
|
|
local cmbox_flatpaks=("com.obsproject.Studio")
|
|
for app in "${cmbox_flatpaks[@]}"; do
|
|
install_flatpak_apps "$app"
|
|
done
|
|
fi
|
|
;;
|
|
"LABBOX")
|
|
log SECTION "Installing LABBOX-specific applications"
|
|
if confirm "Install LABBOX-specific apps?"; then
|
|
# Lab-specific GUI tools
|
|
local lab_packages=("wireshark-qt")
|
|
install_packages "${lab_packages[@]}"
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# Main function to run all desktop setup
|
|
arch_setup_desktop() {
|
|
if ! role_enabled "DESKTOP_BASE"; then
|
|
log INFO "Desktop roles not enabled - skipping desktop setup"
|
|
return 0
|
|
fi
|
|
|
|
arch_install_desktop_base
|
|
arch_install_fonts
|
|
arch_install_desktop_work
|
|
arch_install_media_apps
|
|
arch_install_office_apps
|
|
arch_install_system_utilities
|
|
arch_install_communication
|
|
arch_install_development_gui
|
|
arch_setup_desktop_environment
|
|
arch_install_hostname_specific
|
|
}
|
|
|
|
# Source guard
|
|
if [ -z "$ARCH_DESKTOP_LOADED" ]; then
|
|
ARCH_DESKTOP_LOADED=true
|
|
fi |