diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 00000000..f5ff96a5 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,120 @@ +# GitHub Actions Workflows + +This directory contains the GitHub Actions workflows for the MangoWC project. + +## Workflows + +### build.yml + +**Purpose**: Builds the project to ensure code changes compile successfully. + +**Triggers**: + +- Push to `main` or `master` branch (only when code files change) +- Pull requests to `main` or `master` branch (only when code files change) +- Manual dispatch (workflow_dispatch) + +**Path filters** (only runs when these change): + +- Source files: `**.c`, `**.h`, `**.cpp`, `**.scm` +- Build files: `meson.build`, `meson_options.txt`, `flake.nix` +- Protocol definitions: `protocols/**` +- Workflow file itself: `.github/workflows/build.yml` + +**What it does**: + +1. Runs in Arch Linux container (archlinux:latest) +2. Updates system and installs all dependencies via pacman +3. Installs wlroots from official Arch repositories +4. Installs scenefx from AUR (Arch User Repository) +5. Configures the project with meson +6. Builds the project with ninja +7. Verifies the executables were created + +**Build Strategy**: + +- Uses Arch Linux for up-to-date system packages +- All dependencies installed via pacman or AUR (no source builds) +- wlroots installed from official Arch repositories +- scenefx installed from AUR + +**Dependencies**: + +- Arch Linux container (archlinux:latest) +- Meson build system +- Ninja build tool +- All system packages from pacman (wayland, libinput, wlroots, mesa, etc.) +- scenefx from AUR + +### docs.yml + +**Purpose**: Validates markdown documentation for style and formatting consistency. + +**Triggers**: + +- Push to `main` or `master` branch (only when markdown files change) +- Pull requests to `main` or `master` branch (only when markdown files change) +- Manual dispatch (workflow_dispatch) + +**Path filters** (only runs when these change): + +- Markdown files: `**.md` +- Workflow file itself: `.github/workflows/docs.yml` + +**What it does**: + +- Lints markdown files in the repository using markdownlint-cli2 +- Checks for common markdown formatting issues +- Ensures documentation follows consistent style guidelines +- Excludes dependency directories (wayland, wlroots, scenefx) to only lint + repository files + +### lock.yml + +**Purpose**: Automatically locks inactive issues and PRs to keep the repository + clean. + +**Triggers**: + +- Scheduled daily at 12:30 UTC +- Manual dispatch + +**What it does**: + +- Locks issues, PRs, and discussions that have been closed for 30 days +- Adds a comment explaining why the thread was locked + +### stale.yml + +**Purpose**: Automatically closes issues that have been manually marked as stale. + +**Triggers**: + +- Scheduled daily at 12:30 UTC + +**What it does**: + +- Closes issues marked with the "stale" label after 7 days of inactivity +- Adds "automatic-closing" label when closing +- Does not automatically mark issues as stale (only processes manually marked ones) + +## Development Notes + +The build workflow ensures that: + +- Only runs when actual code or build configuration changes +- All dependencies are properly installed +- The project compiles without errors +- Both main executables (`mango` and `mmsg`) are built successfully + +The docs workflow ensures that: + +- Only runs when markdown documentation changes +- Documentation follows consistent formatting +- Markdown files are well-formed and free of common issues + +If the build workflow fails, check: + +1. Dependencies are up to date in the workflow file +2. wlroots and scenefx versions match requirements in meson.build +3. Build configuration in meson.build hasn't changed diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..664fc5f6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,98 @@ +name: Build + +on: + push: + branches: [main, master] + paths: + - '**.c' + - '**.h' + - '**.cpp' + - '**.scm' + - 'meson.build' + - 'meson_options.txt' + - 'flake.nix' + - 'protocols/**' + - '.github/workflows/build.yml' + pull_request: + branches: [main, master] + paths: + - '**.c' + - '**.h' + - '**.cpp' + - '**.scm' + - 'meson.build' + - 'meson_options.txt' + - 'flake.nix' + - 'protocols/**' + - '.github/workflows/build.yml' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: archlinux:latest + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Update system and install dependencies + run: | + # Update package database + pacman -Syu --noconfirm + + # Install build tools and all dependencies + pacman -S --noconfirm \ + base-devel \ + git \ + meson \ + ninja \ + wayland \ + wayland-protocols \ + libinput \ + libxkbcommon \ + pcre2 \ + pixman \ + libdrm \ + libxcb \ + xcb-util-wm \ + xorg-xwayland \ + hwdata \ + libliftoff \ + libdisplay-info \ + seatd \ + mesa \ + wlroots0.19 \ + pkg-config + + - name: Install scenefx from AUR + run: | + # Install scenefx from AUR since it's not in official repos + # Create a non-root user for makepkg (AUR requires non-root) + useradd -m -G wheel builder + echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + + # Clone and build scenefx from AUR as builder user + cd /home/builder + su - builder -c "git clone https://aur.archlinux.org/scenefx0.4.git" + cd scenefx0.4 + su - builder -c "cd /home/builder/scenefx0.4 && makepkg -si --noconfirm" + + - name: Configure meson + run: | + # Download meson subprojects if needed + meson subprojects download || true + meson setup build/ --prefix=/usr + + - name: Build project + run: | + ninja -C build/ + + - name: Build summary + run: | + echo "✅ Build completed successfully!" + echo "Built executables:" + ls -lh build/mango build/mmsg diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..45743f5d --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,35 @@ +name: Documentation + +on: + push: + branches: [main, master] + paths: + - '**.md' + - '.github/workflows/docs.yml' + pull_request: + branches: [main, master] + paths: + - '**.md' + - '.github/workflows/docs.yml' + workflow_dispatch: + +jobs: + markdown-lint: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Lint markdown files + uses: DavidAnson/markdownlint-cli2-action@v18 + with: + globs: | + *.md + .github/**/*.md + !**/node_modules/** + !**/wayland/** + !**/wlroots/** + !**/scenefx/** diff --git a/.markdownlintrc b/.markdownlintrc deleted file mode 100644 index a487a13d..00000000 --- a/.markdownlintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "default": true, - "MD013": { - "line_length": 150, - "code_blocks": false, - "tables": false - }, - "MD033": { - "allowed_elements": ["div", "img"] - } -} diff --git a/README.md b/README.md index eadd0a05..e1659d2b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Mango Wayland Compositor -
- MangoWC Logo -
+![MangoWC Logo](https://github.com/DreamMaoMao/mangowc/blob/main/assets/mango-transparency-256.png) This project's development is based on [dwl](https://codeberg.org/dwl/dwl/). @@ -105,20 +103,17 @@ tag 1, or tag 2, or both tags 1 and 2 simultaneously. MangoWC supports 9 different layouts: -| Layout | Description | Best For | -|-----------------------|---------------------------------|-----------------------| -| **tile** | Master-stack tiling | General multitasking | -| | (left master, right stack) | | -| **scroller** | Horizontal scrolling columns | Wide content, | -| | | terminals | -| **monocle** | One window fullscreen at a time | Focus, | -| | | presentations | -| **grid** | Windows arranged in grid | Many small windows | -| **deck** | Stack of windows, one visible | Cycling through tasks | -| **center_tile** | Master centered, stack on sides | Symmetrical layout | -| **vertical_tile** | Master top, stack bottom | Wide monitors | -| **vertical_scroller** | Vertical scrolling rows | Document review | -| **vertical_grid** | Vertical grid arrangement | Vertical content | +| Layout | Description | Best For | +|--------|-------------|----------| +| **tile** | Master-stack tiling | General multitasking | +| **scroller** | Horizontal scrolling columns | Wide content, terminals | +| **monocle** | One window fullscreen at a time | Focus, presentations | +| **grid** | Windows arranged in grid | Many small windows | +| **deck** | Stack of windows, one visible | Cycling through tasks | +| **center_tile** | Master centered, stack on sides | Symmetrical layout | +| **vertical_tile** | Master top, stack bottom | Wide monitors | +| **vertical_scroller** | Vertical scrolling rows | Document review | +| **vertical_grid** | Vertical grid arrangement | Vertical content | **Switch layouts:** @@ -630,7 +625,10 @@ sudo ninja -C build install - Dependencies ```bash -yay -S rofi foot xdg-desktop-portal-wlr swaybg waybar wl-clip-persist cliphist wl-clipboard wlsunset xfce-polkit swaync pamixer wlr-dpms sway-audio-idle-inhibit-git swayidle dimland-git brightnessctl swayosd wlr-randr grim slurp satty swaylock-effects-git wlogout sox +yay -S rofi foot xdg-desktop-portal-wlr swaybg waybar wl-clip-persist \ + cliphist wl-clipboard wlsunset xfce-polkit swaync pamixer wlr-dpms \ + sway-audio-idle-inhibit-git swayidle dimland-git brightnessctl swayosd \ + wlr-randr grim slurp satty swaylock-effects-git wlogout sox ``` ### Dms @@ -638,7 +636,9 @@ yay -S rofi foot xdg-desktop-portal-wlr swaybg waybar wl-clip-persist cliphist w - Dependencies ```bash -yay -S foot xdg-desktop-portal-wlr swaybg wl-clip-persist cliphist wl-clipboard sway-audio-idle-inhibit-git brightnessctl grim slurp satty matugen-bin dms-shell-git +yay -S foot xdg-desktop-portal-wlr swaybg wl-clip-persist cliphist \ + wl-clipboard sway-audio-idle-inhibit-git brightnessctl grim slurp satty \ + matugen-bin dms-shell-git ``` @@ -811,7 +811,7 @@ At present, I can only accept sponsorship through an encrypted connection. If you find this project helpful to you, you can offer sponsorship in the following ways. -image +![image](https://github.com/user-attachments/assets/8c860317-90d2-4071-971d-f1a92b674469) Thanks to the following friends for their sponsorship of this project