Files
roid/install
T

64 lines
3.1 KiB
Bash
Raw Normal View History

2026-06-02 17:42:56 +03:00
#!/bin/sh
# Roid: barebones Void Linux setup script for Termux environment
# includes sound support via PulseAudio server
# and X11 graphics support via Termux-X11 server
# Set NOX=y to disable graphics package installation
# and NOEXTRAS=y to disable extra CLI package installation
# (or BAREBONES=y to disable both at once)
# Created by Luxferre in 2026, released into the public domain
# Non-GUI packages
BASE_PKGS='base-container-full void-repo-nonfree base-devel curl git nano mc pulseaudio alsa-plugins-pulseaudio'
EXTRA_PKGS='libcurl-devel dtach fzf tcl tcllib tcltls janet jpm expect zip p7zip unrar rlwrap jq yq miller htop the_silver_searcher gnupg pass progress discount aria2 rsync aerc netcat socat websocat nmap lynx ImageMagick mpg123 mpv sox ffmpeg dumbplay yt-dlp'
# GUI packages
2026-06-02 18:16:06 +03:00
X11_PKGS='xcursor-themes xcursor-vanilla-dmz-aa setxkbmap xkb-switch xdg-utils xdg-user-dirs xsel xss-lock xdotool xrandr xmodmap harfbuzz-devel imlib2-devel gd-devel openssl-devel freetype-devel libxkbcommon-devel xcb-util-keysyms-devel'
2026-06-02 17:42:56 +03:00
X_APPS='dbus mesa mesa-dri mesa-demos mesa-vaapi glxinfo dex i3 i3lock i3status i3cat i3wsr rofi autotiling scrot dunst picom feh volumeicon'
FONT_PKGS='noto-fonts-ttf noto-fonts-ttf-extra noto-fonts-cjk noto-fonts-emoji noto-fonts-ttf-variable liberation-fonts-ttf font-firacode fonts-roboto-ttf'
GUI_PKGS="$X11_PKGS $FONT_PKGS $X_APPS"
if [ "$BAREBONES" = "y" ]; then
NOX=y
NOEXTRAS=y
fi
[ -z "$NOX" ] && NOX=n
[ -z "$NOEXTRAS" ] && NOEXTRAS=n
echo 'Setting up host environment...'
pkg upgrade -y
pkg install -y proot-distro pulseaudio
cat >> $HOME/.profile <<'EOF'
pulseaudio --start --exit-idle-time=-1 # ROID_INST
pacmd load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1 # ROID_INST
EOF
if [ "$NOX" = "n" ]; then
pkg install -y x11-repo
pkg install -y termux-x11-nightly virglrenderer-android
echo 'virgl_test_server_android & # ROID_INST' >> $HOME/.profile
fi
cat >> $HOME/.bashrc <<'EOF'
alias void="proot-distro login -P -e TERMUX_HOME=$HOME void-glibc-full" # ROID_INST
alias voidrun='proot-distro run -P void-glibc-full --' # ROID_INST
alias roidclean='killall pulseaudio virgl_test_server_android' # ROID_INST
EOF
echo 'Installing Void Linux...'
proot-distro install ghcr.io/void-linux/void-glibc-full
echo 'Base distro setup...'
proot-distro run void-glibc-full -- sh -c "xbps-install -Suyy && xbps-install -Sy $BASE_PKGS"
if [ "$NOEXTRAS" = "n" ]; then
echo 'Extra package setup...'
proot-distro run void-glibc-full -- sh -c "xbps-install -Suy && xbps-install -Sy $EXTRA_PKGS"
fi
if [ "$NOX" = "n" ]; then
echo 'GUI setup...'
proot-distro run void-glibc-full -- sh -c "xbps-install -Suyy && xbps-install -Sy $GUI_PKGS"
fi
echo 'Post-installation steps (CLI)...'
proot-distro run void-glibc-full -e TERMUX_HOME=$HOME -- sh $HOME/roid/postinstall-cli
if [ "$NOX" = "n" ]; then
echo 'Post-installation steps (GUI)...'
proot-distro run void-glibc-full -- sh -c "ln -s $TMPDIR/.virgl_test /tmp/"
proot-distro run void-glibc-full -e TERMUX_HOME=$HOME -- sh $HOME/roid/postinstall-gui
fi
echo 'Done. Restart the Termux shell to take effect, then type void to start the OS'