Skip to main content

Overview

The install.sh script is a dependency installer specifically designed for Config-Sway on Arch Linux systems using pacman. It installs all required packages for the Sway window manager environment and then automatically runs the update.sh script to apply the configuration files.
This script is designed for Arch Linux and uses pacman as the package manager. It will skip package installation on other distributions.

Location

./install.sh
Located in the root directory of the Config-Sway repository.

Usage

./install.sh
The script requires no arguments or options. It will:
  1. Check if pacman is available
  2. Install required packages using sudo pacman -S --needed
  3. Automatically execute update.sh to apply dotfiles

What It Does

Step-by-Step Execution

  1. Repository Detection
    • Determines the repository directory using BASH_SOURCE
    • Sets REPO_DIR for locating other scripts
  2. Package Installation
    • Checks if pacman is available
    • Verifies sudo access
    • Installs all packages from the predefined list using --needed flag (skips already installed packages)
  3. Automatic Configuration
    • Locates and executes update.sh to apply dotfiles
    • Handles both executable and non-executable update.sh files

Installed Packages

The script installs the following package categories:

Window Manager & Environment

sway
package
Tiling Wayland compositor
swaybg
package
Wallpaper utility for Wayland
waybar
package
Highly customizable status bar
mako
package
Notification daemon for Wayland
kitty
package
GPU-accelerated terminal emulator
rofi
package
Application launcher and window switcher
flameshot
package
Screenshot tool
network-manager-applet
package
Network management GUI

Wayland Portals & Capture

xdg-desktop-portal
package
Desktop integration framework
xdg-desktop-portal-wlr
package
Wayland portal backend
xdg-desktop-portal-gtk
package
GTK portal implementation
grim
package
Screenshot utility for Wayland

Synchronization

rsync
package
File synchronization tool (required by update.sh)

System Utilities

brightnessctl
package
Brightness control utility
playerctl
package
Media player controller
blueman
package
Bluetooth manager
swaylock
package
Screen locker for Wayland

Terminal & User Experience

ranger
package
Console file manager
lsd
package
Modern ls replacement
bat
package
Cat clone with syntax highlighting
fastfetch
package
System information tool

Audio & Notifications

mpc
package
Music Player Daemon client
alsa-utils
package
ALSA utilities
libnotify
package
Desktop notification library

Error Handling

No sudo Available

If sudo is not installed, the script will display a warning and skip package installation:
Aviso: no existe sudo; se omite instalación de paquetes.

sudo Requires Password

If sudo requires password authentication that cannot be satisfied non-interactively:
Aviso: sudo requiere contraseña. Ejecuta manualmente:
  sudo pacman -S --needed [packages...]

Non-Arch Systems

If pacman is not available (non-Arch systems):
Aviso: pacman no está disponible, se omite instalación de paquetes.

Exit Codes

The script uses set -euo pipefail for strict error handling:
  • 0: Success (all packages installed and update.sh executed)
  • Non-zero: Error during package installation or update.sh execution

Examples

Standard Installation

cd ~/Config-Sway
./install.sh
Output:
Instalando paquetes necesarios con pacman (sudo pacman -S --needed)...
[...package installation output...]
Dependencias listas.
Para aplicar los dotfiles: /home/user/Config-Sway/update.sh
Ejecutando update.sh...
[...update.sh output...]

Manual Package Installation

If you need to install packages manually:
sudo pacman -S --needed sway swaybg waybar mako kitty rofi \
  flameshot network-manager-applet xdg-desktop-portal \
  xdg-desktop-portal-wlr xdg-desktop-portal-gtk grim rsync \
  brightnessctl playerctl blueman swaylock ranger lsd bat \
  fastfetch mpc alsa-utils libnotify
  • update.sh - Synchronizes configuration files (automatically called by install.sh)

Notes

  • The --needed flag ensures pacman only installs packages that are not already present
  • The script automatically detects its own location, so it can be run from any directory
  • After package installation, update.sh is automatically executed to complete the setup
  • Script uses strict error handling (set -euo pipefail) to catch issues early

Source Code

View the full source: install.sh (62 lines) Author: Fravelz

Build docs developers (and LLMs) love