This repository contains an Ansible playbook to automate the installation and configuration of a Sway desktop environment with wpgtk theming integration.
- Automated installation of Sway window manager and related components
- wpgtk integration for cohesive theming across all applications
- Pre-configured dotfiles following best practices
- Multi-distribution support: Fedora, Ubuntu/Debian, Arch Linux, openSUSE, and Fedora rpm-ostree variants (e.g., Silverblue, Kinoite)
- Modular role-based design for easy customization
- Sway: Tiling Wayland compositor
- Waybar: Highly customizable status bar
- Ulauncher: Application launcher with wpgtk theme
- Kitty: Modern, GPU-accelerated terminal emulator
- wpgtk: Wallpaper and theming tool for consistent color schemes
- Additional utilities: swaylock, swayidle, grim, slurp, wf-recorder, and more
- A supported Linux distribution (Fedora, Fedora rpm-ostree variants, Ubuntu/Debian, Arch Linux, or openSUSE)
- Python 3 installed
- Ansible installed (version 2.9 or higher)
- Sudo privileges for installing system packages
git clone https://github.com/GeoDerp/My-Sway-Build.git
cd My-Sway-BuildFedora:
sudo dnf install ansible -yUbuntu/Debian:
sudo apt update
sudo apt install ansible -yArch Linux:
sudo pacman -S ansibleopenSUSE:
sudo zypper install ansibleFedora rpm-ostree variants (Silverblue/Kinoite/etc.):
sudo rpm-ostree install ansibleAfter installing Ansible, install the required collections:
ansible-galaxy collection install -r requirements.ymlRun the complete setup:
ansible-playbook playbook.ymlOr run specific roles using tags:
# Install only system dependencies
ansible-playbook playbook.yml --tags dependencies
# Install only wpgtk
ansible-playbook playbook.yml --tags wpgtk
# Install Sway window manager
ansible-playbook playbook.yml --tags sway
# Install Waybar
ansible-playbook playbook.yml --tags waybar
# Install Ulauncher
ansible-playbook playbook.yml --tags ulauncher
# Install Kitty terminal
ansible-playbook playbook.yml --tags kittyAfter installation, you need to add wallpapers and apply a theme:
-
Add a wallpaper:
wpg -a /path/to/your/wallpaper.jpg
-
Apply the theme:
wpg -s /path/to/your/wallpaper.jpg
-
The following configs are registered as wpgtk templates:
~/.config/sway/config~/.config/waybar/style.css~/.config/kitty/kitty.conf~/.config/ulauncher/user-themes/wpgtk-theme/theme.css
How wpgtk templates work: Config files use template variables like {color0}, {color15}, {active}, {inactive}, etc. When you run wpg -s, wpgtk replaces these with actual hex colors from your chosen wallpaper's color scheme. This ensures consistent theming across all applications.
To start Sway, simply run:
swayOr add it to your login shell for auto-start (modify ~/.bash_profile):
if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then
exec sway
fiSee the Sway config for complete keybinding documentation.
Alt + Return: Open terminalAlt + d: Launch application launcher (ulauncher)Alt + Shift + q: Kill focused windowAlt + Shift + r: Reload Sway configurationSuper + l: Lock screenAlt + Shift + c: Open FirefoxAlt + Shift + w: Change wallpaper (random)Alt + 1-0: Switch to workspace 1-10Alt + Shift + 1-0: Move window to workspace 1-10Print: Take screenshotPrint + Shift: Take screenshot of selected region
.
├── ansible.cfg # Ansible configuration
├── inventory.yml # Inventory file
├── playbook.yml # Main playbook
├── roles/ # Ansible roles
│ ├── system_dependencies/
│ ├── wpgtk/
│ ├── sway/
│ ├── waybar/
│ ├── ulauncher/
│ └── kitty/
├── Backup-.configs/ # Dotfiles and configurations
│ ├── sway/
│ ├── waybar/
│ ├── ulauncher/
│ └── kitty/
└── README.md
All configuration files are stored in the Backup-.configs/ directory:
- Sway:
Backup-.configs/sway/config - Waybar:
Backup-.configs/waybar/configandstyle.css - Ulauncher:
Backup-.configs/ulauncher/user-themes/wpgtk-theme/ - Kitty:
Backup-.configs/kitty/kitty.conf
After modifying these files, run the playbook again to apply changes:
ansible-playbook playbook.ymlTo add a new component:
- Create a new role directory:
mkdir -p roles/myapp/{tasks,defaults,files} - Add tasks in
roles/myapp/tasks/main.yml - Add the role to
playbook.yml - Run the playbook with the new role
If wpgtk is not in your PATH after installation, add this to your ~/.bashrc:
export PATH="$HOME/.local/bin:$PATH"Check the logs:
journalctl -xe | grep swayCommon issues:
- Missing graphics drivers
- Incorrect display configuration
- Conflicting desktop environments
Ensure waybar is installed and the config is valid:
waybar -c ~/.config/waybar/config -s ~/.config/waybar/style.cssIf colors aren't updating after adding a wallpaper:
-
Check if wpgtk is available:
wpg --version
-
Manually reapply the theme:
wpg -s /path/to/your/wallpaper.jpg
-
Verify template files are registered:
wpg -t
This usually happens when the wallpaper variables aren't properly expanded. Ensure:
- You've applied a wpgtk theme at least once
- The lock wallpaper exists:
ls ~/.config/wpg/wallpapers/*.lock.png - Run the playbook again to regenerate configs:
ansible-playbook playbook.yml
This occurs when wpgtk hasn't processed the template yet. The config uses wpgtk template variables (e.g., {color0}, {color15}) that need to be replaced with actual hex colors.
Solution:
- Apply a wpgtk theme to process all templates:
wpg -s /path/to/wallpaper.jpg - This will replace template variables with hex colors from your wallpaper's color scheme
- If the error persists, check that kitty.conf is registered as a wpgtk template:
wpg -t | grep kitty
The Ansible playbook automatically registers kitty.conf as a wpgtk template, so colors will update whenever you change themes.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Sway - Tiling Wayland compositor
- wpgtk - Wallpaper and theming tool
- Waybar - Highly customizable Wayland bar
- Ulauncher - Application launcher
GeoDerp
If you encounter any issues or have questions, please open an issue on GitHub.