arch-full first commit
This commit is contained in:
160
v2/arch-full.sh
Executable file
160
v2/arch-full.sh
Executable file
@@ -0,0 +1,160 @@
|
||||
#!/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() { sudo pacman -Rs --noconfirm "$@"; }
|
||||
|
||||
say_yellow "Starting full setup..."
|
||||
|
||||
# Run minimal first
|
||||
bash "$SCRIPT_DIR/arch-minimal.sh"
|
||||
|
||||
# Add extra packages
|
||||
install_packages arandr catfish galculator networkmanager network-manager-applet networkmanager-openvpn numlockx pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol playerctl gparted xfce4-indicator-plugin xfce4-pulseaudio-plugin xfce4-clipman-plugin
|
||||
|
||||
# Ensure NetworkManager manages all interfaces
|
||||
echo "Setting NetworkManager to manage all interfaces..."
|
||||
sudo cp /etc/network/interfaces /etc/network/interfaces.bak.$(date +%s)
|
||||
sudo tee /etc/network/interfaces > /dev/null <<'EOF'
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
EOF
|
||||
sudo sed -i 's/^managed=.*/managed=true/' /etc/NetworkManager/NetworkManager.conf || \
|
||||
echo -e "[ifupdown]\nmanaged=true" | sudo tee -a /etc/NetworkManager/NetworkManager.conf
|
||||
sudo systemctl restart NetworkManager
|
||||
|
||||
# Enable pipewire
|
||||
sudo systemctl --user enable pipewire pipewire-pulse wireplumber
|
||||
|
||||
########################################
|
||||
# XFCE-specific configuration
|
||||
########################################
|
||||
if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then
|
||||
echo
|
||||
say_cyan "Applying XFCE defaults: fonts, browser, and terminal..."
|
||||
|
||||
# Ensure xfconf-query exists (for XFCE settings)
|
||||
if ! command -v xfconf-query >/dev/null 2>&1; then
|
||||
say_yellow "xfconf-query not found — installing xfce4-settings..."
|
||||
install_packages xfce4-settings
|
||||
fi
|
||||
|
||||
# set fonts
|
||||
# Wait for xfconf to be available (only needed if running inside the same session)
|
||||
if command -v xfconf-query >/dev/null 2>&1; then
|
||||
# Interface font (UI)
|
||||
xfconf-query -c xsettings -p /Gtk/FontName -s "RobotoMono Nerd Font Regular 10"
|
||||
# Monospace font (terminals, editors)
|
||||
xfconf-query -c xsettings -p /Gtk/MonospaceFontName -s "RobotoMono Nerd Font Mono Regular 10"
|
||||
|
||||
say_green "XFCE fonts updated successfully!"
|
||||
else
|
||||
say_yellow "xfconf-query not found — skipping XFCE font config (will apply at first login)."
|
||||
fi
|
||||
|
||||
# Set browser default
|
||||
if command -v chromium >/dev/null 2>&1; then
|
||||
mkdir -p "$HOME/.config/xfce4/"
|
||||
HELPERS_FILE="$HOME/.config/xfce4/helpers.rc"
|
||||
|
||||
# Ensure the helpers file exists
|
||||
touch "$HELPERS_FILE"
|
||||
|
||||
# Update or insert browser entry
|
||||
if grep -q '^WebBrowser=' "$HELPERS_FILE"; then
|
||||
sed -i 's|^WebBrowser=.*|WebBrowser=chromium|' "$HELPERS_FILE"
|
||||
else
|
||||
echo "WebBrowser=chromium" >> "$HELPERS_FILE"
|
||||
fi
|
||||
say_green "XFCE defeault browser set to chromium!"
|
||||
fi
|
||||
|
||||
# Set default terminal
|
||||
if command -v alacritty >/dev/null 2>&1; then
|
||||
mkdir -p "$HOME/.config/xfce4/"
|
||||
HELPERS_FILE="$HOME/.config/xfce4/helpers.rc"
|
||||
|
||||
touch "$HELPERS_FILE"
|
||||
|
||||
# TerminalEmulator entry
|
||||
if grep -q '^TerminalEmulator=' "$HELPERS_FILE"; then
|
||||
sed -i 's|^TerminalEmulator=.*|TerminalEmulator=alacritty|' "$HELPERS_FILE"
|
||||
else
|
||||
echo "TerminalEmulator=alacritty" >> "$HELPERS_FILE"
|
||||
fi
|
||||
|
||||
# TerminalEmulatorCommand entry
|
||||
if grep -q '^TerminalEmulatorCommand=' "$HELPERS_FILE"; then
|
||||
sed -i 's|^TerminalEmulatorCommand=.*|TerminalEmulatorCommand=alacritty|' "$HELPERS_FILE"
|
||||
else
|
||||
echo "TerminalEmulatorCommand=alacritty" >> "$HELPERS_FILE"
|
||||
fi
|
||||
say_green "XFCE defeault terminal set to alacritty!"
|
||||
fi
|
||||
fi
|
||||
|
||||
###############################################
|
||||
# Copy settings to HOME
|
||||
###############################################
|
||||
SOURCE_DIR="$SCRIPT_DIR/config-files/arch"
|
||||
DEST_DIR="$HOME"
|
||||
|
||||
# 1. Verify source directory exists
|
||||
if [ ! -d "$SOURCE_DIR" ]; then
|
||||
echo "Error: Source directory '$SOURCE_DIR' not found. Skipping XFCE config."
|
||||
# Use exit 1 if this is critical, or just exit 0 to continue the main script
|
||||
# exit 1
|
||||
fi
|
||||
|
||||
say_yellow "Applying XFCE configuration directly to $DEST_DIR..."
|
||||
|
||||
# 2. Use shopt for dotfiles, then copy recursively and forcefully
|
||||
shopt -s dotglob
|
||||
cp -vrf "$SOURCE_DIR"/* "$DEST_DIR"/
|
||||
shopt -u dotglob
|
||||
|
||||
# 3. Clean up session cache if desired (e.g., if copying existing settings)
|
||||
say_yellow "Clearing session cache..."
|
||||
rm -rf "$HOME/.cache/sessions/"
|
||||
|
||||
say_yellow "XFCE configuration applied. User can log in now."
|
||||
|
||||
# End of script
|
||||
say_green "Full setup completed."
|
||||
1
v2/config-files/arch/.config/test.txt
Normal file
1
v2/config-files/arch/.config/test.txt
Normal file
@@ -0,0 +1 @@
|
||||
TEST-FILE
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.1" encoding="UTF-8"?>
|
||||
|
||||
<channel name="xfce4-panel" version="1.0">
|
||||
<property name="configver" type="int" value="2"/>
|
||||
<property name="panels" type="array">
|
||||
<value type="int" value="1"/>
|
||||
<property name="dark-mode" type="bool" value="true"/>
|
||||
<property name="panel-1" type="empty">
|
||||
<property name="position" type="string" value="p=6;x=0;y=0"/>
|
||||
<property name="length" type="uint" value="100"/>
|
||||
<property name="position-locked" type="bool" value="true"/>
|
||||
<property name="icon-size" type="uint" value="16"/>
|
||||
<property name="size" type="uint" value="26"/>
|
||||
<property name="plugin-ids" type="array">
|
||||
<value type="int" value="11"/>
|
||||
<value type="int" value="2"/>
|
||||
<value type="int" value="3"/>
|
||||
<value type="int" value="4"/>
|
||||
<value type="int" value="5"/>
|
||||
<value type="int" value="13"/>
|
||||
<value type="int" value="12"/>
|
||||
<value type="int" value="6"/>
|
||||
<value type="int" value="7"/>
|
||||
<value type="int" value="8"/>
|
||||
<value type="int" value="9"/>
|
||||
<value type="int" value="10"/>
|
||||
</property>
|
||||
</property>
|
||||
</property>
|
||||
<property name="plugins" type="empty">
|
||||
<property name="plugin-2" type="string" value="tasklist">
|
||||
<property name="grouping" type="uint" value="1"/>
|
||||
</property>
|
||||
<property name="plugin-3" type="string" value="separator">
|
||||
<property name="expand" type="bool" value="true"/>
|
||||
<property name="style" type="uint" value="0"/>
|
||||
</property>
|
||||
<property name="plugin-4" type="string" value="pager"/>
|
||||
<property name="plugin-5" type="string" value="separator">
|
||||
<property name="style" type="uint" value="0"/>
|
||||
</property>
|
||||
<property name="plugin-6" type="string" value="systray">
|
||||
<property name="square-icons" type="bool" value="true"/>
|
||||
<property name="known-legacy-items" type="array">
|
||||
<value type="string" value="ethernet network connection “wired connection 1” active"/>
|
||||
</property>
|
||||
</property>
|
||||
<property name="plugin-7" type="string" value="separator">
|
||||
<property name="style" type="uint" value="0"/>
|
||||
</property>
|
||||
<property name="plugin-8" type="string" value="clock"/>
|
||||
<property name="plugin-9" type="string" value="separator">
|
||||
<property name="style" type="uint" value="0"/>
|
||||
</property>
|
||||
<property name="plugin-10" type="string" value="actions"/>
|
||||
<property name="plugin-11" type="string" value="whiskermenu"/>
|
||||
<property name="plugin-12" type="string" value="xfce4-clipman-plugin"/>
|
||||
<property name="plugin-13" type="string" value="battery"/>
|
||||
</property>
|
||||
</channel>
|
||||
Reference in New Issue
Block a user