summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Nystrom <sam@samnystrom.dev>2025-11-27 17:26:46 -0500
committerSam Nystrom <sam@samnystrom.dev>2025-11-27 17:26:46 -0500
commitb83a4973d6979c6c05d2a0af2c806d786f346545 (patch)
tree72ec8077c7b0fbd198323f1d5414170baa431b2f
parent99ffa06bb2cf312f0d705fc9932afe03ed48bb5f (diff)
add waywall config
-rw-r--r--.config/waywall/flake.lock61
-rw-r--r--.config/waywall/flake.nix57
-rw-r--r--.config/waywall/init.lua224
-rw-r--r--.config/waywall/resources/bubble_pie.pngbin0 -> 2436 bytes
-rw-r--r--.config/waywall/resources/measuring_overlay.pngbin0 -> 11882 bytes
-rw-r--r--.config/waywall/resources/tall_bg.pngbin0 -> 41553 bytes
-rw-r--r--.config/waywall/resources/thin_bg.pngbin0 -> 75567 bytes
-rw-r--r--.config/waywall/resources/wide_bg.pngbin0 -> 68803 bytes
8 files changed, 342 insertions, 0 deletions
diff --git a/.config/waywall/flake.lock b/.config/waywall/flake.lock
new file mode 100644
index 0000000..128df5b
--- /dev/null
+++ b/.config/waywall/flake.lock
@@ -0,0 +1,61 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1763966396,
+ "narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "5ae3b07d8d6527c42f17c876e404993199144b6a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/.config/waywall/flake.nix b/.config/waywall/flake.nix
new file mode 100644
index 0000000..a463acc
--- /dev/null
+++ b/.config/waywall/flake.nix
@@ -0,0 +1,57 @@
+{
+ description = "Ninjabrain Bot - Minecraft speedrunning utility";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs = { self, nixpkgs, flake-utils }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+
+ ninjabrain-bot = pkgs.stdenv.mkDerivation {
+ pname = "ninjabrain-bot";
+ version = "1.5.1";
+
+ src = pkgs.fetchurl {
+ url = "https://github.com/Ninjabrain1/Ninjabrain-Bot/releases/download/1.5.1/Ninjabrain-Bot-1.5.1.jar";
+ sha256 = "sha256-Rxu9A2EiTr69fLBUImRv+RLC2LmosawIDyDPIaRcrdw=";
+ };
+
+ dontUnpack = true;
+
+ nativeBuildInputs = [ pkgs.makeWrapper ];
+
+ installPhase = ''
+ mkdir -p $out/bin $out/share/ninjabrain-bot
+ cp $src $out/share/ninjabrain-bot/ninjabrain-bot.jar
+
+ makeWrapper ${pkgs.jre8}/bin/java $out/bin/ninjabrain-bot \
+ --add-flags "-Dawt.useSystemAAFontSettings=on" \
+ --add-flags "-jar $out/share/ninjabrain-bot/ninjabrain-bot.jar" \
+ --prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath [
+ pkgs.libxkbcommon
+ pkgs.xorg.libX11
+ pkgs.xorg.libXt
+ ]}
+ '';
+
+ meta = with pkgs.lib; {
+ description = "Stronghold calculator for Minecraft speedrunning";
+ homepage = "https://github.com/Ninjabrain1/Ninjabrain-Bot";
+ license = licenses.mit;
+ platforms = platforms.linux;
+ };
+ };
+ in
+ {
+ packages.default = ninjabrain-bot;
+ apps.default = {
+ type = "app";
+ program = "${ninjabrain-bot}/bin/ninjabrain-bot";
+ };
+ }
+ );
+}
diff --git a/.config/waywall/init.lua b/.config/waywall/init.lua
new file mode 100644
index 0000000..853ac64
--- /dev/null
+++ b/.config/waywall/init.lua
@@ -0,0 +1,224 @@
+local waywall = require("waywall")
+local helpers = require("waywall.helpers")
+
+local Scene = require("waywork.scene")
+local Modes = require("waywork.modes")
+local Keys = require("waywork.keys")
+local Processes = require("waywork.processes")
+
+local scene = Scene.SceneManager.new(waywall)
+local ModeManager = Modes.ModeManager.new(waywall)
+
+local waywall_config_path = os.getenv("HOME") .. "/.config/waywall"
+
+--[[
+celeste menu colors:
+
+light pink: ff92b1
+lavender: 9768e4
+med green: 419462
+pale yellow: ffff99
+gray blue: 759cb2
+dark gray blue: 36527c
+dark gray: 3b566b
+cyan: 53cfde
+brick red: ba5358
+med yellow: fff672
+royal purple: 8d24ed
+pale pink: eb82ff
+sky blue: 54b0ff
+cornflower blue: 606de7
+gold: ffea42
+med blue: 448ede
+deep red: 8a2939
+brightish red: f53c4c
+
+--]]
+
+local bg_color = "#ffffff"
+
+local pie_colors = {
+ entities = { pie = "#e446c4", text = "#e145c2", out = "#f225fc" },
+ unspecified = { pie = "#46ce66", text = "#45cc65", out = "#56f440" },
+ blockEntities = { pie = "#ec6e4e", text = "#e96d4d", out = "#f48769" },
+ destroyProgress = { pie = "#cc6c46", text = "#ca6b45", out = "#c78b56" },
+ mob_spawner = { pie = "#4ee4cc", text = "#4de1ca", out = "#63f9fb" },
+ chest = { pie = "#c66ee4", text = "#c46de1", out = "#e75dfc" },
+}
+
+local normal_sens = 12.800000599064097
+local tall_sens = 0.8634803836976988
+
+local pie_dst = { x = 1200, y = 400, w = 340, h = 340 }
+local percent_dst = { x = 1280, y = 800, w = 34 * 6, h = 25 * 6 }
+local eye_dst = { x = 30, y = 340, w = 700, h = 400 }
+
+local f3_root = { x = 1200, y = 150 }
+local f3_scale = 5
+local f3_text_color = "#48106e"
+
+function add_f3_scene(name, row, col, len, groups)
+ scene:register(name, {
+ kind = "mirror",
+ options = {
+ src = { x = col * 6 + 1, y = row * 9 + 1, w = len * 6, h = 9 },
+ dst = { x = f3_root.x, y = f3_root.y, w = len * 6 * f3_scale, h = 9 * f3_scale },
+ color_key = {
+ input = "#dddddd",
+ output = f3_text_color,
+ },
+ depth = 1,
+ },
+ groups = groups,
+ })
+ f3_root.y = f3_root.y + 9 * f3_scale
+end
+
+add_f3_scene("c_counter", 3, 0, 11, { "thin", "tall" })
+add_f3_scene("e_counter", 4, 0, 8, { "thin", "tall" })
+
+for _, name in ipairs({ "wide", "thin", "tall" }) do
+ scene:register(name .. "_bg", {
+ kind = "image",
+ path = waywall_config_path .. "/resources/" .. name .. "_bg.png",
+ options = {
+ dst = { x = 0, y = 0, w = 1920, h = 1080 },
+ },
+ groups = { name },
+ })
+end
+
+scene:register("bubble", {
+ kind = "image",
+ path = waywall_config_path .. "/resources/bubble_pie.png",
+ options = {
+ dst = pie_dst,
+ depth = -1
+ },
+ groups = { "thin", "tall" },
+})
+
+for name, colors in pairs(pie_colors) do
+ scene:register("thin_pie_" .. name, {
+ kind = "mirror",
+ options = {
+ src = { x = 9, y = 680, w = 321, h = 160 },
+ dst = pie_dst,
+ color_key = { input = colors.pie, output = colors.out },
+ },
+ groups = { "thin" },
+ })
+
+ scene:register("tall_pie_" .. name, {
+ kind = "mirror",
+ options = {
+ src = { x = 9, y = 15984, w = 321, h = 160 },
+ dst = pie_dst,
+ color_key = { input = colors.pie, output = colors.out },
+ },
+ groups = { "tall" },
+ })
+ scene:register("thin_percent_" .. name, {
+ kind = "mirror",
+ options = {
+ src = { x = 247, y = 859, w = 34, h = 25 },
+ dst = percent_dst,
+ color_key = { input = colors.text, output = colors.out },
+ depth = 1,
+ },
+ groups = { "thin" },
+ })
+ scene:register("tall_percent_" .. name, {
+ kind = "mirror",
+ options = {
+ src = { x = 247, y = 16163, w = 34, h = 25 },
+ dst = percent_dst,
+ color_key = { input = colors.text, output = colors.out },
+ depth = 1,
+ },
+ groups = { "tall" },
+ })
+end
+
+scene:register("eye_measure", {
+ kind = "mirror",
+ options = {
+ src = { x = 140, y = 7902, w = 60, h = 580 },
+ dst = eye_dst,
+ },
+ groups = { "tall" },
+})
+
+scene:register("eye_overlay", {
+ kind = "image",
+ path = waywall_config_path .. "/resources/measuring_overlay.png",
+ options = { dst = eye_dst },
+ groups = { "tall" },
+})
+
+ModeManager:define("thin", {
+ width = 340,
+ height = 1080,
+ on_enter = function() scene:enable_group("thin", true) end,
+ on_exit = function() scene:enable_group("thin", false) end,
+})
+
+ModeManager:define("tall", {
+ width = 340,
+ height = 16384,
+ on_enter = function()
+ scene:enable_group("tall", true)
+ waywall.set_sensitivity(tall_sens)
+ end,
+ on_exit = function()
+ scene:enable_group("tall", false)
+ waywall.set_sensitivity(normal_sens)
+ end,
+ toggle_guard = function() return not waywall.get_key("F3") end,
+})
+
+ModeManager:define("wide", {
+ width = 1920,
+ height = 300,
+ on_enter = function() scene:enable_group("wide", true) end,
+ on_exit = function() scene:enable_group("wide", false) end,
+})
+
+local ninbot_path = waywall_config_path .. "/result/bin/ninjabrain-bot"
+local ensure_ninbot = Processes.ensure_application(waywall, ninbot_path)("[Nn]injabrain.*\\.jar")
+
+return {
+ input = {
+ layout = "us",
+ variant = "colemak_dh",
+ repeat_rate = 40,
+ repeat_delay = 300,
+ sensitivity = normal_sens,
+ confine_pointer = false,
+ remaps = {
+ ["MB5"] = "F3",
+ ["Enter"] = "Esc",
+ },
+ },
+ theme = {
+ background = bg_color,
+ ninb_anchor = "bottomright",
+ ninb_opacity = 1.0,
+ },
+ experimental = {
+ debug = false,
+ jit = false,
+ tearing = false,
+ scene_add_text = true,
+ },
+ actions = Keys.actions({
+ ["*-F2"] = function() return ModeManager:toggle("thin") end,
+ ["*-F4"] = function() return ModeManager:toggle("tall") end,
+ ["*-apostrophe"] = function() return ModeManager:toggle("wide") end,
+ ["*-Alt_L"] = function()
+ ensure_ninbot()
+ helpers.toggle_floating()
+ end,
+ ["*-Shift-f"] = waywall.toggle_fullscreen,
+ }),
+}
diff --git a/.config/waywall/resources/bubble_pie.png b/.config/waywall/resources/bubble_pie.png
new file mode 100644
index 0000000..b721bbf
--- /dev/null
+++ b/.config/waywall/resources/bubble_pie.png
Binary files differ
diff --git a/.config/waywall/resources/measuring_overlay.png b/.config/waywall/resources/measuring_overlay.png
new file mode 100644
index 0000000..eb3a666
--- /dev/null
+++ b/.config/waywall/resources/measuring_overlay.png
Binary files differ
diff --git a/.config/waywall/resources/tall_bg.png b/.config/waywall/resources/tall_bg.png
new file mode 100644
index 0000000..873ad11
--- /dev/null
+++ b/.config/waywall/resources/tall_bg.png
Binary files differ
diff --git a/.config/waywall/resources/thin_bg.png b/.config/waywall/resources/thin_bg.png
new file mode 100644
index 0000000..8e8e617
--- /dev/null
+++ b/.config/waywall/resources/thin_bg.png
Binary files differ
diff --git a/.config/waywall/resources/wide_bg.png b/.config/waywall/resources/wide_bg.png
new file mode 100644
index 0000000..e353758
--- /dev/null
+++ b/.config/waywall/resources/wide_bg.png
Binary files differ