Skip to content

Commit

Permalink
chore: fix readme conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
levnikmyskin committed Jun 12, 2024
2 parents 37af21d + 8ca5fb7 commit 0de606b
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/actions/setup_base/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Taken from Hyprland repo
name: "Setup base"

inputs:
INSTALL_XORG_PKGS:
description: 'Install xorg dependencies'
required: false
default: false
branch:
description: 'Hyprland branch to checkout'
required: false
default: 'main'
hyprwayland:
description: 'Hyprwayland branch to checkout'
required: false
default: 'main'

runs:
using: "composite"
steps:
- name: Get required pacman pkgs
shell: bash
run: |
sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf
pacman --noconfirm --noprogressbar -Syyu
pacman --noconfirm --noprogressbar -Sy \
base-devel \
cairo \
clang \
cmake \
cpio \
git \
glm \
glslang \
go \
hyprlang \
hyprcursor \
jq \
libc++ \
libdisplay-info \
libdrm \
libepoxy \
libfontenc \
libglvnd \
libinput \
libliftoff \
libxcvt \
libxfont2 \
libxkbcommon \
libxkbfile \
lld \
meson \
ninja \
pango \
pixman \
pkgconf \
pugixml \
scdoc \
seatd \
systemd \
tomlplusplus \
wayland \
wayland-protocols \
xcb-util-errors \
xcb-util-renderutil \
xcb-util-wm \
xcb-util \
xcb-util-image \
libzip \
librsvg
- name: Get hyprwayland-scanner-git
shell: bash
run: |
git clone https://github.com/hyprwm/hyprwayland-scanner --recursive
cd hyprwayland-scanner
git checkout ${{ inputs.hyprwayland }} && git submodule update --recursive --init
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
cmake --install build
- name: Get Xorg pacman pkgs
shell: bash
if: inputs.INSTALL_XORG_PKGS == 'true'
run: |
pacman --noconfirm --noprogressbar -Sy \
xorg-fonts-encodings \
xorg-server-common \
xorg-setxkbmap \
xorg-xkbcomp \
xorg-xwayland
- name: Get Hyprland
shell: bash
run: |
git clone https://github.com/hyprwm/Hyprland.git --recursive
cd Hyprland
git checkout ${{ inputs.branch }} && git submodule update --recursive --init
# Fix an issue with actions/checkout where the checkout repo is not mark as safe
- name: Mark directory as safe for git
shell: bash
run: |
git config --global --add safe.directory /__w/Hyprland/Hyprland
53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build hyprland-virtual-desktops

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
gcc_main:
name: 'Build hyprland-virtual-desktops (main)'
runs-on: ubuntu-latest
container:
image: archlinux
steps:
- name: Checkout repository action
uses: actions/checkout@v4
with:
sparse-checkout: .github/actions


- name: Setup base on main
uses: ./.github/actions/setup_base
if: github.ref == 'refs/heads/main'|| github.base_ref == 'main'
with:
INSTALL_XORG_PKGS: true
branch: 'v0.40.0'
hyprwayland: 'v0.3.4'

- name: Setup base on dev
uses: ./.github/actions/setup_base
if: github.ref == 'refs/heads/dev'|| github.base_ref == 'dev'
with:
INSTALL_XORG_PKGS: true
branch: 'main'

- name: Compile Hyprland
shell: bash
run: |
cd Hyprland
make all
make install
- name: Build hyprland-virtual-desktops
env:
PKG_CONFIG_PATH: "/usr/local/share/pkgconfig/"
run: |
make all
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
You are on the `dev` branch. This branch unconsistently gather updates and fixes to follow `hyprland-git`. By unconsistently, I mean that there is NO GUARANTEE that this branch will work with `hyprland-git` at any given time.
This plugin **DOES NOT** support `hyprland-git`, please refrain from opening issues if virtual-desktop does not compile with the latest commit on hyprland. Feel free to contribute to this branch via PRs though.


Feel free to join our [matrix room](https://matrix.to/#/#hypr-virtual-desktops:matrix.org)!

>>>>>>> main
## Table of contents
- [Virtual desktops for Hyprland ](#virtual-desktops-for-hyprland-)
- [Table of contents](#table-of-contents)
Expand Down
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,15 @@ std::string printLayoutDispatch(eHyprCtlOutputFormat format, std::string arg) {
"monitors": [
)#",
activeDesk->name, layout.size());
int index = 0;
for (auto const& [mon, wid] : layout) {
out += std::format(R"#({{
"monitorId": {},
"workspace": {}
}})#",
mon->ID, wid);
if (++index < layout.size())
out += ",";
}
out += "]\n}";
}
Expand Down

0 comments on commit 0de606b

Please sign in to comment.