-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
142 lines (106 loc) · 3.6 KB
/
setup.sh
File metadata and controls
142 lines (106 loc) · 3.6 KB
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
#!/bin/bash
set -e
echo "[*] Installing i3wm environment + Polybar + essentials..."
sudo pacman -Syu --noconfirm
sudo pacman -S --noconfirm \
i3-gaps polybar rofi feh picom \
lxappearance arc-gtk-theme papirus-icon-theme ttf-dejavu ttf-font-awesome \
xclip xdotool xorg-server xorg-xinit xorg-xset xorg-xrandr \
pavucontrol pulseaudio playerctl pamixer \
network-manager-applet nm-connection-editor \
brightnessctl acpi acpid \
thunar gvfs gvfs-mtp tumbler xfce4-power-manager \
flameshot nitrogen xfce4-terminal
echo "[*] Enabling services..."
sudo systemctl enable --now acpid NetworkManager
echo "[*] Creating config directories..."
mkdir -p ~/.config/{i3,polybar,rofi,gtk-3.0,picom}
mkdir -p ~/Pictures/Wallpapers
echo "[*] Downloading wallpaper..."
curl -sfLo ~/Pictures/Wallpapers/default.jpg https://wallpapercave.com/wp/wp12488922.png || echo "Wallpaper download failed, skipping."
echo "[*] Writing i3 config..."
cat > ~/.config/i3/config <<'EOF'
set $mod Mod4
font pango:DejaVu Sans Mono 10
exec_always --no-startup-id feh --bg-fill ~/Pictures/Wallpapers/default.jpg
exec_always --no-startup-id picom --config ~/.config/picom/picom.conf
exec --no-startup-id nm-applet
exec --no-startup-id xfce4-power-manager
exec --no-startup-id ~/.config/polybar/launch.sh
bindsym $mod+Return exec xfce4-terminal
bindsym $mod+d exec rofi -show drun
bindsym $mod+Shift+q kill
bindsym $mod+Shift+e exec --no-startup-id i3-msg exit
# Sound controls
bindsym XF86AudioRaiseVolume exec pamixer -i 5
bindsym XF86AudioLowerVolume exec pamixer -d 5
bindsym XF86AudioMute exec pamixer -t
# Brightness controls
bindsym XF86MonBrightnessUp exec brightnessctl set +10%
bindsym XF86MonBrightnessDown exec brightnessctl set 10%-
# Screenshots
bindsym Print exec flameshot gui
# Focus new windows on current workspace
focus_follows_mouse no
EOF
echo "[*] Writing picom config..."
cat > ~/.config/picom/picom.conf <<'EOF'
backend = "glx";
vsync = true;
shadow = true;
fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
inactive-opacity = 0.92;
active-opacity = 1.0;
frame-opacity = 0.8;
corner-radius = 10;
EOF
echo "[*] Writing GTK settings..."
cat > ~/.config/gtk-3.0/settings.ini <<EOF
[Settings]
gtk-theme-name=Arc-Dark
gtk-icon-theme-name=Papirus
gtk-font-name=DejaVu Sans 10
EOF
echo "[*] Writing Polybar launch script..."
cat > ~/.config/polybar/launch.sh <<'EOF'
#!/bin/bash
killall -q polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 0.1; done
polybar example &
EOF
chmod +x ~/.config/polybar/launch.sh
echo "[*] Writing Polybar config..."
cat > ~/.config/polybar/config <<'EOF'
[bar/example]
width = 100%
height = 28
background = #222222
foreground = #bbbbbb
font-0 = DejaVu Sans Mono:size=10;0
modules-left = date volume pulseaudio
modules-center =
modules-right = cpu memory
[module/date]
type = internal/date
format = %Y-%m-%d %H:%M:%S
[module/volume]
type = internal/volume
format-volume = %volume%%
format-muted = muted
[module/pulseaudio]
type = internal/pulseaudio
format = %volume%%
EOF
echo "[*] Setting up auto-start i3 with startx on TTY login..."
# Add startx to ~/.bash_profile if not present
if ! grep -q "startx" ~/.bash_profile 2>/dev/null; then
echo -e "\n# Start X (i3) automatically on TTY login\n[[ -z \$DISPLAY && \$XDG_VTNR -eq 1 ]] && exec startx\n" >> ~/.bash_profile
fi
# Make sure ~/.xinitrc exists and runs i3
if ! grep -q "exec i3" ~/.xinitrc 2>/dev/null; then
echo "exec i3" >> ~/.xinitrc
fi
echo "[✓] Setup complete! Reboot, login on tty1, and i3 + polybar will start automatically."
echo "If you want graphical login manager (LightDM, GDM etc.), let me know to configure properly."