summaryrefslogtreecommitdiff
path: root/.config/waywall/init.lua
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 /.config/waywall/init.lua
parent99ffa06bb2cf312f0d705fc9932afe03ed48bb5f (diff)
add waywall config
Diffstat (limited to '.config/waywall/init.lua')
-rw-r--r--.config/waywall/init.lua224
1 files changed, 224 insertions, 0 deletions
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,
+ }),
+}