GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — dotfiles/install.sh at main · Nefers12/dotfiles

Expand file tree

/

install.sh

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
81 lines (73 loc) · 2.83 KB
/

install.sh

Copy path

File metadata and controls

executable file
·
81 lines (73 loc) · 2.83 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
set -e
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
INSTALL_PACKAGES=false
INSTALL_SYSTEM=false
for arg in "$@"; do
case "$arg" in
-p|--packages) INSTALL_PACKAGES=true ;;
-s|--system) INSTALL_SYSTEM=true ;;
-h|--help)
echo "Usage: $0 [-p|--packages] [-s|--system]"
exit 0
;;
*)
echo "Unknown option: $arg" >&2
echo "Usage: $0 [-p|--packages] [-s|--system]" >&2
exit 1
;;
esac
done
TARGET_USER="${SUDO_USER:-$USER}"
TARGET_HOME="$(getent passwd "$TARGET_USER" 2>/dev/null | cut -d: -f6)"
TARGET_HOME="${TARGET_HOME:-$HOME}"
CONFIG_DIR="${XDG_CONFIG_HOME:-$TARGET_HOME/.config}"
echo "==> Target user: $TARGET_USER ($TARGET_HOME)"
echo "==> Linking dotfiles..."
mkdir -p "$CONFIG_DIR"
for dir in hypr quickshell wofi fastfetch fish micro; do
if [ -d "$REPO_DIR/dotfiles/$dir" ]; then
if [ -d "$CONFIG_DIR/$dir" ] && [ ! -L "$CONFIG_DIR/$dir" ]; then
echo " backing up existing $CONFIG_DIR/$dir to $CONFIG_DIR/${dir}.bak"
mv "$CONFIG_DIR/$dir" "$CONFIG_DIR/${dir}.bak"
fi
ln -sfn "$REPO_DIR/dotfiles/$dir" "$CONFIG_DIR/$dir"
echo " linked $dir -> $CONFIG_DIR/$dir"
fi
done
if [ "$INSTALL_PACKAGES" = true ]; then
echo "==> Installing packages..."
sudo pacman -S --needed - < "$REPO_DIR/packages/pacman-core.txt"
if command -v paru >/dev/null 2>&1; then
paru -S --needed - < "$REPO_DIR/packages/aur.txt"
elif command -v yay >/dev/null 2>&1; then
yay -S --needed - < "$REPO_DIR/packages/aur.txt"
fi
sudo systemctl enable --now ratbagd.service 2>/dev/null || true
fi
if [ "$INSTALL_SYSTEM" = true ]; then
echo "==> Copying system configs..."
sudo mkdir -p /etc/sddm.conf.d
for conf in "$REPO_DIR/system/sddm-"*.conf; do
[ -f "$conf" ] || continue
conf_name="$(basename "$conf")"
if [ "$conf_name" = "sddm-autologin.conf" ]; then
if grep -q "^User=" "$conf"; then
sed "s/^User=.*/User=$TARGET_USER/" "$conf" | sudo tee "/etc/sddm.conf.d/$conf_name" >/dev/null
else
awk -v u="$TARGET_USER" '/^\[Autologin\]/{print; print "User="u; next}1' "$conf" | sudo tee "/etc/sddm.conf.d/$conf_name" >/dev/null
fi
else
sudo cp "$conf" /etc/sddm.conf.d/
fi
done
if [ -f "$REPO_DIR/system/environment" ] && command -v lspci >/dev/null 2>&1 && lspci | grep -qi nvidia; then
sudo cp "$REPO_DIR/system/environment" /etc/environment
fi
if [ -f "$REPO_DIR/system/bluetooth-main.conf" ]; then
sudo mkdir -p /etc/bluetooth
sudo cp "$REPO_DIR/system/bluetooth-main.conf" /etc/bluetooth/main.conf
fi
sudo systemctl enable ratbagd.service 2>/dev/null || true
fi
echo "==> Done!"
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.