Add wlcs to justfile, add tag in wlcs config

This commit is contained in:
Ottatop 2024-04-27 00:29:27 -05:00
parent 8c0bce7191
commit b8098f4d45
3 changed files with 36 additions and 17 deletions

View file

@ -1,15 +0,0 @@
#!/bin/sh
WLCS_SHA=26c5a8cfef265b4ae021adebfec90d758c08792e
if [ -f "./wlcs/wlcs" ] && [ "$(cd wlcs; git rev-parse HEAD)" = "${WLCS_SHA}" ] ; then
echo "WLCS commit 26c5a8c is already compiled"
else
echo "Compiling WLCS"
git clone https://github.com/canonical/wlcs
cd wlcs || exit
# checkout a specific revision
git reset --hard "${WLCS_SHA}"
cmake -DWLCS_BUILD_ASAN=False -DWLCS_BUILD_TSAN=False -DWLCS_BUILD_UBSAN=False -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .
make
fi

View file

@ -78,6 +78,7 @@ install-protos-root:
# [root] Install the Lua library (requires Luarocks)
install-lua-lib-root:
#!/usr/bin/env bash
set -euxo pipefail
cd "{{rootdir}}/api/lua"
luarocks make --lua-version "{{lua_version}}"
@ -92,3 +93,29 @@ run *args:
# Run `cargo test`
test *args:
cargo test {{args}}
compile-wlcs:
#!/usr/bin/env bash
set -euxo pipefail
WLCS_SHA=26c5a8cfef265b4ae021adebfec90d758c08792e
cd "{{rootdir}}"
if [ -f "./wlcs/wlcs" ] && [ "$(cd wlcs; git rev-parse HEAD)" = "${WLCS_SHA}" ] ; then
echo "WLCS commit 26c5a8c is already compiled"
else
echo "Compiling WLCS"
git clone https://github.com/canonical/wlcs
cd wlcs || exit
# checkout a specific revision
git reset --hard "${WLCS_SHA}"
cmake -DWLCS_BUILD_ASAN=False -DWLCS_BUILD_TSAN=False -DWLCS_BUILD_UBSAN=False -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .
make
fi
wlcs *args: compile-wlcs
#!/usr/bin/env bash
set -euxo pipefail
cargo build -p wlcs_pinnacle
RUST_BACKTRACE=1 RUST_LOG=warn ./wlcs/wlcs target/debug/libwlcs_pinnacle.so {{args}}

View file

@ -1,13 +1,20 @@
use pinnacle::state::Pinnacle;
mod inner {
use pinnacle_api::layout::{CyclingLayoutManager, MasterStackLayout};
use pinnacle_api::output::OutputSetup;
use pinnacle_api::window::rules::{WindowRule, WindowRuleCondition};
use pinnacle_api::ApiModules;
#[pinnacle_api::config(modules)]
async fn main() {
#[allow(unused_variables)]
let ApiModules { layout, window, .. } = modules;
let ApiModules {
layout,
window,
output,
..
} = modules;
output.setup([OutputSetup::new_with_matcher(|_| true).with_tags(["1"])]);
window.add_window_rule(
WindowRuleCondition::default().all(vec![]),