From 9eb698234182101a94aa110fdc641c423f5b4adb Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 1 Jun 2025 14:55:05 -0500 Subject: [PATCH] feat: refactored espanso config --- .../gui/apps/tools/espanso/config/base.nix | 7 ---- .../apps/tools/espanso/config/characters.nix | 10 +++++ .../gui/apps/tools/espanso/config/debate.nix | 29 ++++++++++++- .../gui/apps/tools/espanso/config/logic.nix | 21 +++++++++- .../gui/apps/tools/espanso/config/numbers.nix | 41 +++++++++++++++++++ .../apps/tools/espanso/config/superscript.nix | 13 ------ .../home/gui/apps/tools/espanso/default.nix | 26 ++++++------ .../gui/desktop/hypr/land/config/monitor.nix | 10 ++++- .../home/gui/desktop/hypr/land/default.nix | 2 +- 9 files changed, 123 insertions(+), 36 deletions(-) delete mode 100755 modules/home/gui/apps/tools/espanso/config/base.nix create mode 100755 modules/home/gui/apps/tools/espanso/config/numbers.nix delete mode 100755 modules/home/gui/apps/tools/espanso/config/superscript.nix diff --git a/modules/home/gui/apps/tools/espanso/config/base.nix b/modules/home/gui/apps/tools/espanso/config/base.nix deleted file mode 100755 index 65bb056..0000000 --- a/modules/home/gui/apps/tools/espanso/config/base.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ matchHelper, ... }: -[ - (matchHelper ":up" "↑") - (matchHelper ":down" "↓") - (matchHelper ":left" "←") - (matchHelper ":right" "→") -] diff --git a/modules/home/gui/apps/tools/espanso/config/characters.nix b/modules/home/gui/apps/tools/espanso/config/characters.nix index aad8e1b..d118c16 100755 --- a/modules/home/gui/apps/tools/espanso/config/characters.nix +++ b/modules/home/gui/apps/tools/espanso/config/characters.nix @@ -3,4 +3,14 @@ (matchHelper ":delta" "Δ") (matchHelper ":emdash" "—") (matchHelper ":degree" "°") + (matchHelper ":+-" "±") + (matchHelper ":<=" "≤") + (matchHelper ":>=" "≥") + (matchHelper ":copyright" "©") + (matchHelper ":restricted" "®") + (matchHelper ":trademark" "™") + (matchHelper ":up" "↑") + (matchHelper ":down" "↓") + (matchHelper ":left" "←") + (matchHelper ":right" "→") ] diff --git a/modules/home/gui/apps/tools/espanso/config/debate.nix b/modules/home/gui/apps/tools/espanso/config/debate.nix index 7ac3c8f..94dcc40 100755 --- a/modules/home/gui/apps/tools/espanso/config/debate.nix +++ b/modules/home/gui/apps/tools/espanso/config/debate.nix @@ -1,8 +1,35 @@ { matchHelper, ... }: [ - (matchHelper ":ntt" '' + (matchHelper ":ntt1" '' World A) Animals farmed for food. World B) Humans farmed for food. All else equal, what is true of world A that is untrue of world B, that if made true of world B, would make world B permissible?'') + (matchHelper ":ntt2" '' + P1) For all things, if a being has moral worth, then we should not exploit it to any greater degree than we would tolerate for trait-adjusted humans. + (∀x(Px→¬Qx)) + + P2) If animals don’t have moral worth, then there exists a trait that is absent in animals such that if it were absent in humans, humans wouldn’t have moral worth. + (¬Pa→∃t(Rta→(Rth→¬Ph))) + + P3) There doesn’t exist a trait that is absent in animals such that if it were absent in humans, humans wouldn’t have moral worth. + (¬∃t(Rta→(Rth→¬Ph))) + + C) Therefore, we should not exploit animals to any greater degree than we would tolerate for trait-adjusted humans. + (∴¬Qa)'') + (matchHelper ":transid" '' + P1) Someone is a woman if, and only if, someone possesses a sufficiently greater sum of weighted traits that more closely associate with large gametes than weighted traits that associate with small gametes and someone is over 18 years of age. + (∀x(Px↔Rx∧Wx)) + + P2) Someone is a man if, and only if, someone possesses a sufficiently greater sum of weighted traits that more closely associate with small gametes than weighted traits that associate with large gametes and someone is over 18 years of age. + (∀x(Qx↔Sx∧Wx)) + + P3) A trans person of the male sex possesses a sufficiently greater sum of weighted traits that more closely associate with large gametes than weighted traits that associate with small gametes and a trans person with small gametes is over 18 years of age. + (Ra∧Wa) + + P4)A trans person of the female sex possesses a sufficiently greater sum of weighted traits that more closely associate with small gametes than weighted traits that associate with large gametes and a trans person with large gametes is over 18 years of age. + (Sg∧Wg) + + C) Therefore, a trans person of the male sex is a woman and a trans person with female sex is a man. + (∴Pa∧Qg)'') ] diff --git a/modules/home/gui/apps/tools/espanso/config/logic.nix b/modules/home/gui/apps/tools/espanso/config/logic.nix index 7adec9d..519b391 100755 --- a/modules/home/gui/apps/tools/espanso/config/logic.nix +++ b/modules/home/gui/apps/tools/espanso/config/logic.nix @@ -4,8 +4,27 @@ (matchHelper ":conj" "∧") (matchHelper ":disj" "∨") (matchHelper ":imp" "→") - (matchHelper ":bicon" "↔") + (matchHelper ":iff" "↔") (matchHelper ":forall" "∀") (matchHelper ":exist" "∃") (matchHelper ":therefore" "∴") + (matchHelper ":because" "∵") + (matchHelper ":nexist" "∄") + (matchHelper ":nand" "⊼") + (matchHelper ":nor" "⊽") + (matchHelper ":xor" "⊕") + (matchHelper ":xnor" "⊙") + (matchHelper ":notimp" "↛") + (matchHelper ":notiff" "↮") + (matchHelper ":models" "⊨") + (matchHelper ":notmodels" "⊭") + (matchHelper ":proves" "⊢") + (matchHelper ":notproves" "⊬") + (matchHelper ":forces" "⊩") + (matchHelper ":notforces" "⊮") + (matchHelper ":top" "⊤") + (matchHelper ":bottom" "⊥") + (matchHelper ":dashv" "⊣") + (matchHelper ":necessary" "□") + (matchHelper ":possible" "◇") ] diff --git a/modules/home/gui/apps/tools/espanso/config/numbers.nix b/modules/home/gui/apps/tools/espanso/config/numbers.nix new file mode 100755 index 0000000..b7cea6a --- /dev/null +++ b/modules/home/gui/apps/tools/espanso/config/numbers.nix @@ -0,0 +1,41 @@ +{ matchHelper, ... }: +[ + (matchHelper ":super1" "¹") + (matchHelper ":super2" "²") + (matchHelper ":super3" "³") + (matchHelper ":super4" "⁴") + (matchHelper ":super5" "⁵") + (matchHelper ":super6" "⁶") + (matchHelper ":super7" "⁷") + (matchHelper ":super8" "⁸") + (matchHelper ":super9" "⁹") + (matchHelper ":super0" "⁰") + (matchHelper ":sub1" "₁") + (matchHelper ":sub2" "₂") + (matchHelper ":sub3" "₃") + (matchHelper ":sub4" "₄") + (matchHelper ":sub5" "₅") + (matchHelper ":sub6" "₆") + (matchHelper ":sub7" "₇") + (matchHelper ":sub8" "₈") + (matchHelper ":sub9" "₉") + (matchHelper ":sub0" "₀") + (matchHelper ":1/2" "½") + (matchHelper ":1/3" "⅓") + (matchHelper ":2/3" "⅔") + (matchHelper ":1/4" "¼") + (matchHelper ":3/4" "¾") + (matchHelper ":1/5" "⅕") + (matchHelper ":2/5" "⅖") + (matchHelper ":3/5" "⅗") + (matchHelper ":4/5" "⅘") + (matchHelper ":1/6" "⅙") + (matchHelper ":5/6" "⅚") + (matchHelper ":1/7" "⅐") + (matchHelper ":1/8" "⅛") + (matchHelper ":3/8" "⅜") + (matchHelper ":5/8" "⅝") + (matchHelper ":7/8" "⅞") + (matchHelper ":1/9" "⅑") + (matchHelper ":1/10" "⅒") +] diff --git a/modules/home/gui/apps/tools/espanso/config/superscript.nix b/modules/home/gui/apps/tools/espanso/config/superscript.nix deleted file mode 100755 index c119ac5..0000000 --- a/modules/home/gui/apps/tools/espanso/config/superscript.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ matchHelper, ... }: -[ - (matchHelper ":ss1" "¹") - (matchHelper ":ss2" "²") - (matchHelper ":ss3" "³") - (matchHelper ":ss4" "⁴") - (matchHelper ":ss5" "⁵") - (matchHelper ":ss6" "⁶") - (matchHelper ":ss7" "⁷") - (matchHelper ":ss8" "⁸") - (matchHelper ":ss9" "⁹") - (matchHelper ":ss0" "⁰") -] diff --git a/modules/home/gui/apps/tools/espanso/default.nix b/modules/home/gui/apps/tools/espanso/default.nix index ef636ac..7cbd4ea 100755 --- a/modules/home/gui/apps/tools/espanso/default.nix +++ b/modules/home/gui/apps/tools/espanso/default.nix @@ -1,28 +1,30 @@ { flake, + lib, pkgs, ... }: let - matchHelper = trigger: replace: { trigger = trigger; replace = replace; }; - configPath = ./config; + configs = { + url = { inherit flake matchHelper; }; + logic = { inherit matchHelper; }; + debate = { inherit matchHelper; }; + characters = { inherit matchHelper; }; + academic = { inherit matchHelper; }; + numbers = { inherit matchHelper; }; + email = { inherit flake matchHelper; }; + }; + baseMatches = { - matches = - [ ] - ++ (import (configPath + /base.nix) { inherit matchHelper; }) - ++ (import (configPath + /url.nix) { inherit flake matchHelper; }) - ++ (import (configPath + /logic.nix) { inherit matchHelper; }) - ++ (import (configPath + /debate.nix) { inherit matchHelper; }) - ++ (import (configPath + /characters.nix) { inherit matchHelper; }) - ++ (import (configPath + /academic.nix) { inherit matchHelper; }) - ++ (import (configPath + /superscript.nix) { inherit matchHelper; }) - ++ (import (configPath + /email.nix) { inherit flake matchHelper; }); + matches = lib.concatMap (name: import (configPath + "/${name}.nix") configs.${name}) ( + builtins.attrNames configs + ); }; in { diff --git a/modules/home/gui/desktop/hypr/land/config/monitor.nix b/modules/home/gui/desktop/hypr/land/config/monitor.nix index fbd1df1..df77e9c 100755 --- a/modules/home/gui/desktop/hypr/land/config/monitor.nix +++ b/modules/home/gui/desktop/hypr/land/config/monitor.nix @@ -1,6 +1,14 @@ +{ flake, osConfig, ... }: let + inherit (flake.config.machines) devices; + + deimos = devices.deimos.name; + host = osConfig.networking.hostName; + + deviceLogic = if host == deimos then "1" else "1"; + monitorSettings = [ - "eDP-1,highres@highrr,0x0,1" + "eDP-1,highres@highrr,0x0,${deviceLogic}" ]; in monitorSettings diff --git a/modules/home/gui/desktop/hypr/land/default.nix b/modules/home/gui/desktop/hypr/land/default.nix index 879c095..d77e245 100755 --- a/modules/home/gui/desktop/hypr/land/default.nix +++ b/modules/home/gui/desktop/hypr/land/default.nix @@ -20,7 +20,7 @@ let misc = import (configPath + /misc.nix); windowrulev2 = import (configPath + /windowrulev2.nix); xwayland = import (configPath + /xwayland.nix); - monitor = import (configPath + /monitor.nix); + monitor = import (configPath + /monitor.nix) { inherit flake osConfig; }; }; in {