From 63b2e693bf896c256757d0c628809fa79caaddd8 Mon Sep 17 00:00:00 2001 From: Colin Henry Date: Sun, 30 Nov 2025 14:30:15 -0800 Subject: [PATCH] add scripts --- scripts/packages.sh | 8 +++++++ scripts/update-xdm.sh | 52 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100755 scripts/update-xdm.sh diff --git a/scripts/packages.sh b/scripts/packages.sh index b094b35..2fcf76b 100755 --- a/scripts/packages.sh +++ b/scripts/packages.sh @@ -143,6 +143,14 @@ if is_linux; then log_info "Installing xload" install_package xload x11-apps xorg-xload fi + + # XDM display manager + if command_exists xdm; then + log_success "xdm already installed" + else + log_info "Installing xdm" + install_package xdm + fi fi # Install TPM (Tmux Plugin Manager) diff --git a/scripts/update-xdm.sh b/scripts/update-xdm.sh new file mode 100755 index 0000000..03316dc --- /dev/null +++ b/scripts/update-xdm.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/../lib/common.sh" + +log_info "Updating XDM configuration" + +if ! is_linux; then + log_error "XDM is only available on Linux" + exit 1 +fi + +# Determine XDM config directory based on distro +if [ -d "/etc/X11/xdm" ]; then + XDM_DIR="/etc/X11/xdm" +elif [ -d "/etc/xdm" ]; then + XDM_DIR="/etc/xdm" +else + log_error "XDM config directory not found" + log_info "Expected /etc/X11/xdm or /etc/xdm" + exit 1 +fi + +CONFIG_SOURCE="$SCRIPT_DIR/../config/xdm" + +if [ ! -d "$CONFIG_SOURCE" ]; then + log_error "Source XDM config not found at $CONFIG_SOURCE" + exit 1 +fi + +log_info "Copying XDM configuration from $CONFIG_SOURCE to $XDM_DIR" + +# Copy files +for file in Xresources Xsetup Xstartup; do + if [ -f "$CONFIG_SOURCE/$file" ]; then + log_info "Copying $file" + maybe_sudo cp "$CONFIG_SOURCE/$file" "$XDM_DIR/$file" + + # Make scripts executable + if [ "$file" = "Xsetup" ] || [ "$file" = "Xstartup" ]; then + maybe_sudo chmod +x "$XDM_DIR/$file" + fi + else + log_warn "$file not found in $CONFIG_SOURCE" + fi +done + +log_success "XDM configuration updated" +log_info "" +log_info "To apply changes, restart XDM:" +log_info " sudo systemctl restart xdm"