162 lines
3.6 KiB
Bash
Executable File
162 lines
3.6 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# colors for output
|
|
GREEN='\033[0;32m'
|
|
BLUE='\033[0;34m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m'
|
|
|
|
# helpers
|
|
info() {
|
|
printf '%b\n' "${BLUE}>>$1${NC}"
|
|
}
|
|
|
|
success() {
|
|
printf '%b\n' "${GREEN}>>$1${NC}"
|
|
}
|
|
|
|
error() {
|
|
printf '%b\n' "${RED}>>ERROR: $1${NC}" >&2
|
|
}
|
|
|
|
|
|
# 0. Check environment
|
|
|
|
if [ "$(id -u)" -eq 0 ]; then
|
|
error "do not run this installer as root"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
if [ ! -d "$HOME/labwc-opensuse" ]; then
|
|
error "labwc-opensuse directory not found in $HOME"
|
|
printf '%b\n' "${RED}>>Please clone the repository first:${NC}"
|
|
printf '%b\n' "${RED}>>git clone https://zenithcode.duckdns.org/s13bby/labwc-opensuse.git${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v sudo >/dev/null 2>&1; then
|
|
error "sudo is required"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
# 1. Begin
|
|
|
|
echo "┌──────────────────────────────────────┐"
|
|
echo "│ zenithcode.duckdns.org │"
|
|
echo "│ welcome to installer labwc-opensuse │"
|
|
echo "│ by s13bby │"
|
|
echo "└──────────────────────────────────────┘"
|
|
|
|
|
|
# 2. Install needed packages
|
|
|
|
info "installing needed packages..."
|
|
|
|
# power-profiles-daemon -- FOR NOTEBOOK ONLY
|
|
|
|
sudo zypper in \
|
|
opi \
|
|
htop \
|
|
blueman \
|
|
gcc \
|
|
gcc-c++ \
|
|
git \
|
|
polkit \
|
|
polkit-gnome \
|
|
curl \
|
|
cmake \
|
|
libcurl-devel \
|
|
opencv \
|
|
opencv-devel \
|
|
waybar \
|
|
mako \
|
|
swaybg \
|
|
wofi \
|
|
google-noto-fonts \
|
|
dejavu-fonts \
|
|
wl-clipboard \
|
|
xdg-desktop-portal \
|
|
xdg-desktop-portal-gtk \
|
|
pipewire \
|
|
wireplumber \
|
|
alsa-utils \
|
|
NetworkManager \
|
|
NetworkManager-applet \
|
|
NetworkManager-tui \
|
|
pcmanfm \
|
|
firefox \
|
|
playerctl \
|
|
jetbrains-mono-fonts \
|
|
power-profiles-daemon \
|
|
brightnessctl \
|
|
pavucontrol \
|
|
bluez \
|
|
grim \
|
|
ristretto
|
|
|
|
success "all packages installed (without swaylock-effects. install this package manualy"
|
|
|
|
|
|
# 3. Configure NetworkManager & power-profiles-daemon & bluetooth
|
|
|
|
info "configuring NetworkManager & power-profiles-daemon..."
|
|
|
|
sudo systemctl enable --now NetworkManager
|
|
sudo systemctl enable --now power-profiles-daemon
|
|
sudo systemctl enable --now bluetooth
|
|
success "NetworkManager & power-profiles-daemon & bluetooth enabled and running"
|
|
|
|
|
|
# 4. Copy configs
|
|
|
|
info "creating config directory..."
|
|
|
|
mkdir -p "$HOME/.config"
|
|
|
|
info "copying dotfiles..."
|
|
|
|
for config in alacritty swaylock labwc waybar wofi; do
|
|
if [ -d "$HOME/labwc-opensuse/configs/$config" ]; then
|
|
cp -r "$HOME/labwc-opensuse/configs/$config" "$HOME/.config/"
|
|
else
|
|
error "config directory not found: $config"
|
|
exit 1
|
|
fi
|
|
done
|
|
success "dotfiles copied"
|
|
|
|
|
|
# 5. Copy backgrounds
|
|
|
|
info "creating backgrounds directory..."
|
|
|
|
mkdir -p "$HOME/backgrounds/"
|
|
|
|
if [ -d "$HOME/labwc-opensuse/backgrounds" ]; then
|
|
cp -r "$HOME/labwc-opensuse/backgrounds/"* "$HOME/backgrounds/"
|
|
else
|
|
error "backgrounds directory not found"
|
|
exit 1
|
|
fi
|
|
|
|
success "backgrounds copied"
|
|
|
|
|
|
# 6. Done
|
|
|
|
echo
|
|
echo "┌──────────────────────────────────────┐"
|
|
echo "│ zenithcode.duckdns.org │"
|
|
echo "│ thanks for use my dotfiles │"
|
|
echo "│ mail: qaws3623@gmail.com by s13bby │"
|
|
echo "└──────────────────────────────────────┘"
|
|
|
|
info "please. install swaylock-effcts manually"
|
|
info "write >> opi swaylock-effects"
|
|
|
|
success ">>after install swaylock-effects:"
|
|
success " >>please reboot system<<"
|