fix xkb issues, change espanso formatting

This commit is contained in:
alisceon 2026-03-13 20:04:46 +01:00
parent ef0ae94080
commit a100acda87
4 changed files with 18 additions and 15 deletions

18
flake.lock generated
View file

@ -257,11 +257,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1773122722, "lastModified": 1773282481,
"narHash": "sha256-FIqHByVqxCprNjor1NqF80F2QQoiiyqanNNefdlvOg4=", "narHash": "sha256-b/GV2ysM8mKHhinse2wz+uP37epUrSE+sAKXy/xvBY4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "62dc67aa6a52b4364dd75994ec00b51fbf474e50", "rev": "fe416aaedd397cacb33a610b33d60ff2b431b127",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -295,11 +295,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1773339783, "lastModified": 1773428326,
"narHash": "sha256-07iRHomuUvJ7Mmp+F7qo68xIb+y3gy0o/B7kuR1K2Qc=", "narHash": "sha256-vu0CCPOMNwXF9M1aW517HL67lXgExR0A3KuWGKPdOxc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "1a4ca0d650fbfd4c58e1b1c2b153151fec77d6b2", "rev": "8d1130d6d780fa95338518911798662df04ca9f8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -316,11 +316,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1773339783, "lastModified": 1773428326,
"narHash": "sha256-07iRHomuUvJ7Mmp+F7qo68xIb+y3gy0o/B7kuR1K2Qc=", "narHash": "sha256-vu0CCPOMNwXF9M1aW517HL67lXgExR0A3KuWGKPdOxc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "1a4ca0d650fbfd4c58e1b1c2b153151fec77d6b2", "rev": "8d1130d6d780fa95338518911798662df04ca9f8",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,13 +1,14 @@
{ pkgs, repoRoot, ... }: { pkgs, lib, repoRoot, ... }:
{ {
services.espanso = { services.espanso = {
enable = true; enable = true;
waylandSupport = true; waylandSupport = true;
configs.default = { configs.default = {
toggle_key = "OFF"; toggle_key = "OFF";
search_shortcut = "OFF";
preserve_clipboard = true; preserve_clipboard = true;
show_notifications = true; show_notifications = true;
keyboard_layout.layout = "se"; keyboard_layout.layout = lib.mkDefault "se";
}; };
matches = { matches = {
base.matches = [ base.matches = [

View file

@ -1,4 +1,4 @@
{ pkgs, repoRoot, ... }: { pkgs, repoRoot, lib, ... }:
let let
commands = import ../../../../lib/commands.nix { inherit pkgs; }; commands = import ../../../../lib/commands.nix { inherit pkgs; };
inherit (commands) uwsm lock term notify nag dmenu espanso; inherit (commands) uwsm lock term notify nag dmenu espanso;
@ -54,7 +54,7 @@ in
pointer_accel = "0.5"; pointer_accel = "0.5";
}; };
"*" = { "*" = {
xkb_layout = "se,us"; xkb_layout = lib.mkDefault "se,us";
xkb_options = "grp:win_space_toggle"; xkb_options = "grp:win_space_toggle";
}; };
}; };
@ -121,7 +121,7 @@ in
"${key_mod}+${key_mod_misc}+Tab" = "workspace next"; "${key_mod}+${key_mod_misc}+Tab" = "workspace next";
"${key_mod}+${key_mod_misc}+Shift+Tab" = "workspace prev"; "${key_mod}+${key_mod_misc}+Shift+Tab" = "workspace prev";
"Mod4+space" = "exec ${notify} -t 2000 \"$(${pkgs.xonsh}/bin/xonsh ${repoRoot}/util/get_xkb.xsh)\""; "Mod4+space" = "exec ${notify} -t 2000 \"$(${pkgs.xonsh}/bin/xonsh ${repoRoot}/util/toggle_xkb.xsh)\"";
"${key_mod}+Shift+r" = "reload"; "${key_mod}+Shift+r" = "reload";
"${key_mod}+Ctrl+r" = "restart"; "${key_mod}+Ctrl+r" = "restart";
"${key_mod}+Backspace" = "exec ${nag} -m 'TuneD profiles:' -Z 'Performance' 'tuned-adm profile accelerator-performance' -Z 'Balanced' 'tuned-adm profile balanced' -Z 'Power Save' 'tuned-adm profile powersave'"; "${key_mod}+Backspace" = "exec ${nag} -m 'TuneD profiles:' -Z 'Performance' 'tuned-adm profile accelerator-performance' -Z 'Balanced' 'tuned-adm profile balanced' -Z 'Power Save' 'tuned-adm profile powersave'";

View file

@ -1,2 +1,4 @@
import re import re
_ = $(swaymsg input "type:keyboard" xkb_switch_layout next)
print("Layout: " + re.search(r'"xkb_active_layout_name": "(.+?)"', $(swaymsg -t get_inputs)).group(1)) print("Layout: " + re.search(r'"xkb_active_layout_name": "(.+?)"', $(swaymsg -t get_inputs)).group(1))