summaryrefslogtreecommitdiff
path: root/arch/install.sh
blob: 648a26cfe0cbc0c057bce4cf98b771c3522889f2 (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/usr/bin/env bash
set -euo pipefail

# Usage: ./install.sh [-y]
#   -y  Auto-accept all optional component prompts

AUTO_YES=false
while getopts "y" opt; do
    case $opt in
        y) AUTO_YES=true ;;
    esac
done

ask() {
    # ask <prompt> — returns 0 (yes) or 1 (no). Always yes if -y was passed.
    if $AUTO_YES; then return 0; fi
    read -rp "$1 [y/N] " ans
    [[ "${ans,,}" == "y" ]]
}

# ── Core WM ───────────────────────────────────────────────────────────────────
pacman_packages=(
  hyprland
  hyprlock
  hypridle
  xdg-desktop-portal-hyprland
  xdg-desktop-portal-gtk
  polkit-gnome
)

# ── Audio ─────────────────────────────────────────────────────────────────────
pacman_packages+=(
  pipewire
  pipewire-alsa
  pipewire-pulse
  pipewire-jack
  wireplumber
  pamixer
  playerctl
  pavucontrol
  easyeffects
)

# ── Display / input ───────────────────────────────────────────────────────────
pacman_packages+=(
  grim
  slurp
  wl-clipboard
  brightnessctl
  ydotool
  chafa
  obs-studio
)

# ── Notifications ─────────────────────────────────────────────────────────────
pacman_packages+=(
  mako
  libnotify
)

# ── Launcher ──────────────────────────────────────────────────────────────────
pacman_packages+=(
  bemenu
  bemenu-wayland
)

# ── Shell / CLI ───────────────────────────────────────────────────────────────
pacman_packages+=(
  fish
  tmux
  starship
  zoxide
  fzf
  ripgrep
  fd
  bat
  eza
  btop
  yazi
  direnv
  tealdeer
  jq
  cliphist
)

# ── Fonts ─────────────────────────────────────────────────────────────────────
pacman_packages+=(
  ttf-jetbrains-mono-nerd
  noto-fonts
  noto-fonts-emoji
  noto-fonts-cjk
)

# ── GTK / cursor ──────────────────────────────────────────────────────────────
pacman_packages+=(
  papirus-icon-theme
  gnome-themes-extra
  gnome-keyring
  gsettings-desktop-schemas
)

# ── Bluetooth ─────────────────────────────────────────────────────────────────
pacman_packages+=(
  bluez
  bluez-utils
)

# ── Network / misc ────────────────────────────────────────────────────────────
pacman_packages+=(
  networkmanager
  openssh
  wget
  socat
  curl
  git
)

# ── AUR packages ──────────────────────────────────────────────────────────────
aur_packages=(
  ghostty           # terminal
  sesh              # tmux session manager
  eww               # bar
  adw-gtk3          # GTK theme
  bibata-cursor-theme
  wl-kbptr          # keyboard pointer (Super+G / Super+M binds)
  pinfo             # info page viewer (used in fish aliases)
  asusctl                # keyboard backlight
  wallust                # dynamic color generation from wallpaper
  hyprland-workspaces    # eww workspace widget with active-state JSON
  socat                  # Hyprland IPC streaming (eww deflisten scripts)
)

# ── Install core ──────────────────────────────────────────────────────────────
echo "==> Installing pacman packages..."
sudo pacman -S --needed "${pacman_packages[@]}"

echo "==> Installing AUR packages (via yay)..."
yay -S --needed "${aur_packages[@]}"

# ── Optional: Spotify + Spicetify ────────────────────────────────────────────
echo ""
if ask "==> Install Spotify + Spicetify (wallust auto-theming)?"; then
    yay -S --needed spotify spicetify-cli

    echo "==> Fixing Spotify permissions for Spicetify..."
    sudo chmod a+wr /opt/spotify
    sudo chmod -R a+wr /opt/spotify/Apps

    echo "==> Applying Spicetify wallust theme..."
    spicetify config current_theme wallust color_scheme Base
    spicetify backup apply

    echo "  Spotify + Spicetify installed and themed."
fi

# ── Optional: Neovim dev environment ─────────────────────────────────────────
echo ""
if ask "==> Install Neovim dev environment (LSP, formatters, linters)?"; then
    sudo pacman -S --needed \
        neovim \
        clang \
        lua-language-server \
        stylua \
        python-black \
        python-isort \
        cppcheck \
        ruff

    yay -S --needed \
        pyright \
        haskell-language-server

    echo "==> Stowing nvim config..."
    cd ~/dotfiles/arch && stow nvim

    echo "  Neovim dev environment installed."
    echo "  Open nvim and run :Lazy to install plugins."
fi

# ── Groups ────────────────────────────────────────────────────────────────────
# input  → ydotool (/dev/uinput access)
# video  → brightnessctl (screen + keyboard backlight without sudo)
echo ""
echo "==> Adding $(whoami) to groups: input, video..."
sudo usermod -aG input,video "$(whoami)"

echo ""
echo "==> Done. Next steps:"
echo "    cd ~/dotfiles/arch"
echo "    rm ~/.config/hypr/hyprland.conf   # remove autogenerated config"
echo "    stow hyprland ghostty eww fish git scripts wallust spicetify nvim"
echo "    chsh -s /usr/bin/fish"
echo "    Log out and back in for group changes to take effect"