summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/niri
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/niri')
-rw-r--r--accounts/gkleen@sif/niri/default.nix264
-rw-r--r--accounts/gkleen@sif/niri/mako.nix4
2 files changed, 147 insertions, 121 deletions
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix
index bf997b7d..35a3d799 100644
--- a/accounts/gkleen@sif/niri/default.nix
+++ b/accounts/gkleen@sif/niri/default.nix
@@ -3,6 +3,7 @@ let
3 cfg = config.programs.niri; 3 cfg = config.programs.niri;
4 4
5 kdl = flakeInputs.niri-flake.lib.kdl; 5 kdl = flakeInputs.niri-flake.lib.kdl;
6 sleaf = name: arg: kdl.node name [arg] [];
6 7
7 niri = cfg.package; 8 niri = cfg.package;
8 terminal = lib.getExe config.programs.kitty.package; 9 terminal = lib.getExe config.programs.kitty.package;
@@ -134,7 +135,7 @@ let
134 135
135 windows_json="$(niri msg -j windows)" 136 windows_json="$(niri msg -j windows)"
136 active_workspace="$(jq -r '.[] | select(.is_focused) | .workspace_id' <<<"$windows_json")" 137 active_workspace="$(jq -r '.[] | select(.is_focused) | .workspace_id' <<<"$windows_json")"
137 window_ix="$(gojq -r --arg active_workspace "$active_workspace" '.[] | select('"$window_select"') | "\(.title)\u0000icon\u001f\(.app_id)"' <<<"$windows_json" | fuzzel --log-level=warning --dmenu --index)" 138 window_ix="$(gojq -r --arg active_workspace "$active_workspace" '.[] | select('"$window_select"') | "\(.title)\u0000icon\u001f\(.app_id)"' <<<"$windows_json" | fuzzel --width=60 --log-level=warning --dmenu --index)"
138 # shellcheck disable=SC2016 139 # shellcheck disable=SC2016
139 window_json="$(gojq -rc --arg active_workspace "$active_workspace" --arg window_ix "$window_ix" 'map(select('"$window_select"')) | .[($window_ix | tonumber)]' <<<"$windows_json")" 140 window_json="$(gojq -rc --arg active_workspace "$active_workspace" --arg window_ix "$window_ix" 'map(select('"$window_select"')) | .[($window_ix | tonumber)]' <<<"$windows_json")"
140 141
@@ -449,8 +450,8 @@ in {
449 { title = "^Access Request.*"; } 450 { title = "^Access Request.*"; }
450 { title = ".*Passkey credentials$"; } 451 { title = ".*Passkey credentials$"; }
451 ]; 452 ];
452 windowRuleExtra = [ 453 windowRuleExtra = with kdl; [
453 (kdl.leaf "open-focused" false) 454 (sleaf "open-focused" false)
454 ]; 455 ];
455 key = "Mod+Control+P"; 456 key = "Mod+Control+P";
456 app-id = "org.keepassxc.KeePassXC"; 457 app-id = "org.keepassxc.KeePassXC";
@@ -477,6 +478,20 @@ in {
477 app-id = "com.github.wwmm.easyeffects"; 478 app-id = "com.github.wwmm.easyeffects";
478 spawn = [ "easyeffects" ]; 479 spawn = [ "easyeffects" ];
479 } 480 }
481 { name = "time";
482 key = "Mod+Control+K";
483 app-id = "chrome-kimai.yggdrasil.li__-Default";
484 spawn = [ (toString (pkgs.resholve.writeScript "kimai" {
485 interpreter = pkgs.runtimeShell;
486 inputs = [ pkgs.dex ];
487 execer = [ "cannot:${lib.getExe pkgs.dex}" ];
488 } ''
489 exec dex $HOME/.local/state/nix/profile/share/applications/kimai.desktop
490 '')) ];
491 windowRuleExtra = with kdl; [
492 (sleaf "block-out-from" "screencast")
493 ];
494 }
480 ]; 495 ];
481 programs.niri.config = 496 programs.niri.config =
482 let 497 let
@@ -486,10 +501,12 @@ in {
486 then v 501 then v
487 else null; 502 else null;
488 opt-props = lib.filterAttrs (lib.const (value: value != null)); 503 opt-props = lib.filterAttrs (lib.const (value: value != null));
504 normalize-nodes = nodes: lib.remove null (lib.flatten nodes);
489 in 505 in
490 [ (flag "prefer-no-csd") 506 normalize-nodes [
507 (flag "prefer-no-csd")
491 508
492 (leaf "screenshot-path" "~/screenshots/%Y-%m-%dT%H:%M:%S.png") 509 (sleaf "screenshot-path" "~/screenshots/%Y-%m-%dT%H:%M:%S.png")
493 510
494 (plain "hotkey-overlay" [ 511 (plain "hotkey-overlay" [
495 (flag "skip-at-startup") 512 (flag "skip-at-startup")
@@ -497,27 +514,27 @@ in {
497 514
498 (plain "input" [ 515 (plain "input" [
499 (plain "keyboard" [ 516 (plain "keyboard" [
500 (leaf "repeat-delay" 300) 517 (sleaf "repeat-delay" 300)
501 (leaf "repeat-rate" 50) 518 (sleaf "repeat-rate" 50)
502 519
503 (plain "xkb" [ 520 (plain "xkb" [
504 (leaf "layout" "us,us") 521 (sleaf "layout" "us,us")
505 (leaf "variant" "dvp,") 522 (sleaf "variant" "dvp,")
506 (leaf "options" "compose:caps,grp:win_space_toggle") 523 (sleaf "options" "compose:caps,grp:win_space_toggle")
507 ]) 524 ])
508 ]) 525 ])
509 526
510 (flag "workspace-auto-back-and-forth") 527 (flag "workspace-auto-back-and-forth")
511 # (leaf "focus-follows-mouse" {}) 528 # (sleaf "focus-follows-mouse" {})
512 # (flag "warp-mouse-to-focus") 529 # (flag "warp-mouse-to-focus")
513 530
514 # (plain "touchpad" [ (flag "off") ]) 531 # (plain "touchpad" [ (flag "off") ])
515 (plain "trackball" [ 532 (plain "trackball" [
516 (leaf "scroll-method" "on-button-down") 533 (sleaf "scroll-method" "on-button-down")
517 (leaf "scroll-button" 278) 534 (sleaf "scroll-button" 278)
518 ]) 535 ])
519 (plain "touch" [ 536 (plain "touch" [
520 (leaf "map-to-output" "eDP-1") 537 (sleaf "map-to-output" "eDP-1")
521 ]) 538 ])
522 ]) 539 ])
523 540
@@ -525,7 +542,7 @@ in {
525 (plain "hot-corners" [(flag "off")]) 542 (plain "hot-corners" [(flag "off")])
526 ]) 543 ])
527 544
528 (plain "environment" (lib.mapAttrsToList leaf { 545 (plain "environment" (lib.mapAttrsToList sleaf {
529 NIXOS_OZONE_WL = "1"; 546 NIXOS_OZONE_WL = "1";
530 QT_QPA_PLATFORM = "wayland"; 547 QT_QPA_PLATFORM = "wayland";
531 QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; 548 QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
@@ -538,47 +555,47 @@ in {
538 SUDO_ASKPASS = lib.getExe pkgs.kdePackages.ksshaskpass; 555 SUDO_ASKPASS = lib.getExe pkgs.kdePackages.ksshaskpass;
539 })) 556 }))
540 557
541 (node "output" "eDP-1" [ 558 (node "output" ["eDP-1"] [
542 (leaf "scale" 1.5) 559 (sleaf "scale" 1.5)
543 (leaf "position" { x = 0; y = 0; }) 560 (sleaf "position" { x = 0; y = 0; })
544 ]) 561 ])
545 (node "output" "Ancor Communications Inc ASUS PB287Q 0x0000DD9B" [ 562 (node "output" ["Ancor Communications Inc ASUS PB287Q 0x0000DD9B"] [
546 (leaf "scale" 1.5) 563 (sleaf "scale" 1.5)
547 (leaf "position" { x = 2560; y = 0; }) 564 (sleaf "position" { x = 2560; y = 0; })
548 ]) 565 ])
549 (node "output" "HP Inc. HP 727pu CN4417143K" [ 566 (node "output" ["HP Inc. HP 727pu CN4417143K"] [
550 (leaf "mode" "2560x1440@119.998") 567 (sleaf "mode" "2560x1440@119.998")
551 (leaf "scale" 1) 568 (sleaf "scale" 1)
552 (leaf "position" { x = 2560; y = 0; }) 569 (sleaf "position" { x = 2560; y = 0; })
553 (flag "variable-refresh-rate") 570 (flag "variable-refresh-rate")
554 ]) 571 ])
555 572
556 (plain "debug" [ 573 (plain "debug" [
557 (leaf "render-drm-device" "/dev/dri/by-path/pci-0000:00:02.0-render") 574 (sleaf "render-drm-device" "/dev/dri/by-path/pci-0000:00:02.0-render")
558 ]) 575 ])
559 576
560 (plain "animations" [ 577 (plain "animations" [
561 (leaf "slowdown" 0.5) 578 (sleaf "slowdown" 0.5)
562 (plain "workspace-switch" [(flag "off")]) 579 (plain "workspace-switch" [(flag "off")])
563 ]) 580 ])
564 581
565 (plain "layout" [ 582 (plain "layout" [
566 (leaf "gaps" 8) 583 (sleaf "gaps" 8)
567 (plain "struts" [ 584 (plain "struts" [
568 (leaf "left" 26) 585 (sleaf "left" 26)
569 (leaf "right" 26) 586 (sleaf "right" 26)
570 (leaf "top" 0) 587 (sleaf "top" 0)
571 (leaf "bottom" 0) 588 (sleaf "bottom" 0)
572 ]) 589 ])
573 (plain "border" [ 590 (plain "border" [
574 (leaf "width" 2) 591 (sleaf "width" 2)
575 (leaf "active-gradient" { 592 (sleaf "active-gradient" {
576 from = "hsla(195 100% 45% 1)"; 593 from = "hsla(195 100% 45% 1)";
577 to = "hsla(155 100% 37.5% 1)"; 594 to = "hsla(155 100% 37.5% 1)";
578 angle = 29; 595 angle = 29;
579 relative-to = "workspace-view"; 596 relative-to = "workspace-view";
580 }) 597 })
581 (leaf "inactive-gradient" { 598 (sleaf "inactive-gradient" {
582 from = "hsla(0 0% 27.7% 1)"; 599 from = "hsla(0 0% 27.7% 1)";
583 to = "hsla(0 0% 23% 1)"; 600 to = "hsla(0 0% 23% 1)";
584 angle = 29; 601 angle = 29;
@@ -589,29 +606,29 @@ in {
589 (flag "off") 606 (flag "off")
590 ]) 607 ])
591 608
592 (plain "preset-column-widths" (map (prop: leaf "proportion" prop) [ 609 (plain "preset-column-widths" (map (prop: sleaf "proportion" prop) [
593 (1. / 4.) (1. / 3.) (1. / 2.) (2. / 3.) (3. / 4.) (1.) 610 (1. / 4.) (1. / 3.) (1. / 2.) (2. / 3.) (3. / 4.) (1.)
594 ])) 611 ]))
595 (plain "default-column-width" [ (leaf "proportion" (1. / 2.)) ]) 612 (plain "default-column-width" [ (sleaf "proportion" (1. / 2.)) ])
596 (plain "preset-window-heights" (map (prop: leaf "proportion" prop) [ 613 (plain "preset-window-heights" (map (prop: sleaf "proportion" prop) [
597 (1. / 3.) (1. / 2.) (2. / 3.) (1.) 614 (1. / 3.) (1. / 2.) (2. / 3.) (1.)
598 ])) 615 ]))
599 616
600 (flag "always-center-single-column") 617 (flag "always-center-single-column")
601 618
602 (plain "tab-indicator" [ 619 (plain "tab-indicator" [
603 (leaf "gap" 4) 620 (sleaf "gap" 4)
604 (leaf "width" 8) 621 (sleaf "width" 8)
605 (leaf "gaps-between-tabs" 4) 622 (sleaf "gaps-between-tabs" 4)
606 (flag "place-within-column") 623 (flag "place-within-column")
607 (leaf "length" { total-proportion = 1.; }) 624 (sleaf "length" { total-proportion = 1.; })
608 (leaf "active-gradient" { 625 (sleaf "active-gradient" {
609 from = "hsla(195 100% 60% 0.75)"; 626 from = "hsla(195 100% 60% 0.75)";
610 to = "hsla(155 100% 50% 0.75)"; 627 to = "hsla(155 100% 50% 0.75)";
611 angle = 29; 628 angle = 29;
612 relative-to = "workspace-view"; 629 relative-to = "workspace-view";
613 }) 630 })
614 (leaf "inactive-gradient" { 631 (sleaf "inactive-gradient" {
615 from = "hsla(0 0% 42% 0.66)"; 632 from = "hsla(0 0% 42% 0.66)";
616 to = "hsla(0 0% 35% 0.66)"; 633 to = "hsla(0 0% 35% 0.66)";
617 angle = 29; 634 angle = 29;
@@ -625,130 +642,121 @@ in {
625 ]) 642 ])
626 643
627 (map (name: 644 (map (name:
628 (node "workspace" name [ 645 (node "workspace" [name] [
629 (leaf "open-on-output" "eDP-1") 646 (sleaf "open-on-output" "eDP-1")
630 ]) 647 ])
631 ) (map ({name, ...}: name) cfg.scratchspaces)) 648 ) (map ({name, ...}: name) cfg.scratchspaces))
632 (map (name: 649 (map (name:
633 (leaf "workspace" name) 650 (sleaf "workspace" name)
634 ) ["comm" "web" "vid" "bmr"]) 651 ) ["comm" "web" "vid" "bmr"])
635 652
636 (plain "window-rule" [ 653 (plain "window-rule" [
637 (leaf "clip-to-geometry" true) 654 (sleaf "clip-to-geometry" true)
638 ]) 655 ])
639 656
640 (plain "window-rule" [ 657 (plain "window-rule" [
641 (leaf "match" { is-floating = true; }) 658 (sleaf "match" { is-floating = true; })
642 (leaf "geometry-corner-radius" 8) 659 (sleaf "geometry-corner-radius" 8)
643 (plain "shadow" [ (flag "on") ]) 660 (plain "shadow" [ (flag "on") ])
644 ]) 661 ])
645 662
646 (plain "window-rule" [ 663 (plain "window-rule" [
647 (leaf "match" { app-id = "^org\\.keepassxc\\.KeePassXC$"; }) 664 (sleaf "match" { app-id = "^org\\.keepassxc\\.KeePassXC$"; })
648 (leaf "block-out-from" "screencast") 665 (sleaf "block-out-from" "screencast")
649 ]) 666 ])
650 (plain "window-rule" [ 667 (plain "window-rule" (normalize-nodes [
651 (map (title: 668 (map (title:
652 (leaf "match" { app-id = "^org\\.keepassxc\\.KeePassXC$"; inherit title; }) 669 (sleaf "match" { app-id = "^org\\.keepassxc\\.KeePassXC$"; inherit title; })
653 ) ["^Unlock Database.*" "^Access Request.*" ".*Passkey credentials$"]) 670 ) ["^Unlock Database.*" "^Access Request.*" ".*Passkey credentials$" "Browser Access Request$"])
654 (leaf "open-focused" true) 671 (sleaf "open-focused" true)
655 (leaf "open-floating" true) 672 (sleaf "open-floating" true)
656 ]) 673 ]))
657 674
658 (map ({ name, match, exclude, windowRuleExtra, ... }: 675 (map ({ name, match, exclude, windowRuleExtra, ... }:
659 (optional-node (match != []) (plain "window-rule" [ 676 (optional-node (match != []) (plain "window-rule" (normalize-nodes [
660 (map (leaf "match") match) 677 (map (sleaf "match") match)
661 (map (leaf "exclude") exclude) 678 (map (sleaf "exclude") exclude)
662 (leaf "open-on-workspace" name) 679 (sleaf "open-on-workspace" name)
663 (leaf "open-maximized" true) 680 (sleaf "open-maximized" true)
664 windowRuleExtra 681 windowRuleExtra
665 ])) 682 ])))
666 ) cfg.scratchspaces) 683 ) cfg.scratchspaces)
667 684
668 (plain "window-rule" [ 685 (plain "window-rule" [
669 (leaf "match" { app-id = "^emacs$"; }) 686 (sleaf "match" { app-id = "^emacs$"; })
670 (leaf "match" { app-id = "^firefox$"; }) 687 (sleaf "match" { app-id = "^firefox$"; })
671 (plain "default-column-width" [(leaf "proportion" (2. / 3.))]) 688 (plain "default-column-width" [(sleaf "proportion" (2. / 3.))])
672 ]) 689 ])
673 (plain "window-rule" [ 690 (plain "window-rule" [
674 (leaf "match" { app-id = "^kitty$"; }) 691 (sleaf "match" { app-id = "^kitty$"; })
675 (leaf "match" { app-id = "^kitty-play$"; }) 692 (sleaf "match" { app-id = "^kitty-play$"; })
676 (plain "default-column-width" [(leaf "proportion" (1. / 3.))]) 693 (plain "default-column-width" [(sleaf "proportion" (1. / 3.))])
677 ]) 694 ])
678 695
679 (plain "window-rule" [ 696 (plain "window-rule" [
680 (leaf "match" { app-id = "^thunderbird$"; }) 697 (sleaf "match" { app-id = "^thunderbird$"; })
681 (leaf "match" { app-id = "^Element$"; }) 698 (sleaf "match" { app-id = "^Element$"; })
682 (leaf "match" { app-id = "^Rainbow$"; }) 699 (sleaf "match" { app-id = "^chrome-web\.openrainbow\.com__-Default$"; })
683 (leaf "open-on-workspace" "comm") 700 (sleaf "open-on-workspace" "comm")
684 ]) 701 ])
685 (plain "window-rule" [ 702 (plain "window-rule" [
686 (leaf "match" { app-id = "^Kimai$"; }) 703 (sleaf "match" { app-id = "^firefox$"; })
687 (leaf "open-on-workspace" "comm") 704 (sleaf "open-on-workspace" "web")
688 (leaf "open-fullscreen" false) 705 (sleaf "open-maximized" true)
689 (plain "default-column-width" [(leaf "proportion" (2. / 3.))])
690 ]) 706 ])
691 (plain "window-rule" [ 707 (plain "window-rule" [
692 (leaf "match" { app-id = "^firefox$"; }) 708 (sleaf "match" { app-id = "^mpv$"; })
693 (leaf "open-on-workspace" "web") 709 (sleaf "open-on-workspace" "vid")
694 (leaf "open-maximized" true) 710 (plain "default-column-width" [(sleaf "proportion" 1.)])
695 ]) 711 ])
696 (plain "window-rule" [ 712 (plain "window-rule" [
697 (leaf "match" { app-id = "^mpv$"; }) 713 (sleaf "match" { app-id = "^kitty-play$"; })
698 (leaf "open-on-workspace" "vid") 714 (sleaf "open-on-workspace" "vid")
699 (plain "default-column-width" [(leaf "proportion" 1.)]) 715 (sleaf "open-focused" false)
700 ]) 716 ])
701 (plain "window-rule" [ 717 (plain "window-rule" [
702 (leaf "match" { app-id = "^kitty-play$"; }) 718 (sleaf "match" { app-id = "^chrome-audiobookshelf\.yggdrasil\.li__-Default$"; })
703 (leaf "open-on-workspace" "vid") 719 (sleaf "match" { app-id = "^YouTube Music Desktop App$"; })
704 (leaf "open-focused" false) 720 (sleaf "open-on-workspace" "vid")
705 ]) 721 ])
706 (plain "window-rule" [ 722 (plain "window-rule" [
707 (leaf "match" { app-id = "^pdfpc$"; }) 723 (sleaf "match" { app-id = "^pdfpc$"; })
708 (plain "default-column-width" [(leaf "proportion" 1.)]) 724 (plain "default-column-width" [(sleaf "proportion" 1.)])
709 ]) 725 ])
710 (plain "window-rule" [ 726 (plain "window-rule" [
711 (leaf "match" { app-id = "^pdfpc$"; title = "^.*presentation.*$"; }) 727 (sleaf "match" { app-id = "^pdfpc$"; title = "^.*presentation.*$"; })
712 (plain "default-column-width" [(leaf "proportion" 1.)]) 728 (plain "default-column-width" [(sleaf "proportion" 1.)])
713 (leaf "open-fullscreen" true) 729 (sleaf "open-fullscreen" true)
714 (leaf "open-on-workspace" "bmr") 730 (sleaf "open-on-workspace" "bmr")
715 (leaf "open-focused" false) 731 (sleaf "open-focused" false)
716 ]) 732 ])
717 (plain "window-rule" [ 733 (plain "window-rule" (normalize-nodes [
718 (map (leaf "match") [ 734 (map (sleaf "match") [
719 { app-id = "^Gimp-"; title = "^Quit GIMP$"; } 735 { app-id = "^Gimp-"; title = "^Quit GIMP$"; }
720 { app-id = "^org\\.kde\\.polkit-kde-authentication-agent-1$"; } 736 { app-id = "^org\\.kde\\.polkit-kde-authentication-agent-1$"; }
721 { app-id = "^xdg-desktop-portal-gtk$"; } 737 { app-id = "^xdg-desktop-portal-gtk$"; }
722 ]) 738 ])
723 (leaf "open-floating" true) 739 (sleaf "open-floating" true)
724 ]) 740 ]))
725 (plain "window-rule" [ 741 (plain "window-rule" [
726 (leaf "match" { app-id = "^org\\.pwmt\\.zathura$"; }) 742 (sleaf "match" { app-id = "^org\\.pwmt\\.zathura$"; })
727 (leaf "match" { app-id = "^evince$"; }) 743 (sleaf "match" { app-id = "^evince$"; })
728 (leaf "match" { app-id = "^org\\.gnome\\.Papers$"; }) 744 (sleaf "match" { app-id = "^org\\.gnome\\.Papers$"; })
729 (leaf "default-column-display" "tabbed") 745 (sleaf "default-column-display" "tabbed")
730 ]) 746 ])
731 747
732 (plain "layer-rule" [ 748 (plain "layer-rule" [
733 (leaf "match" { namespace = "^notifications$"; }) 749 (sleaf "match" { namespace = "^notifications$"; })
734 (leaf "match" { namespace = "^waybar$"; }) 750 (sleaf "match" { namespace = "^waybar$"; })
735 (leaf "match" { namespace = "^launcher$"; }) 751 (sleaf "match" { namespace = "^launcher$"; })
736 (leaf "block-out-from" "screencast") 752 (sleaf "block-out-from" "screencast")
737 ]) 753 ])
738 754
739 (plain "binds" 755 (plain "binds"
740 (let 756 (let
741 bind = name: cfg: node name (opt-props { 757 bind = name: cfg: node name [(lib.removeAttrs cfg ["action"])] (lib.mapAttrsToList leaf (lib.removeAttrs cfg.action ["__functor"]));
742 cooldown-ms = cfg.cooldown-ms or null;
743 }
744 // (lib.optionalAttrs (!(cfg.repeat or true)) {
745 repeat = false;
746 })
747 // (lib.optionalAttrs (cfg.allow-when-locked or false) {
748 allow-when-locked = true;
749 })) (lib.mapAttrsToList leaf (lib.removeAttrs cfg.action ["__functor"]));
750 in 758 in
751 [ 759 normalize-nodes [
752 (lib.mapAttrsToList bind (with config.lib.niri.actions; { 760 (lib.mapAttrsToList bind (with config.lib.niri.actions; {
753 "Mod+Slash".action = show-hotkey-overlay; 761 "Mod+Slash".action = show-hotkey-overlay;
754 762
@@ -803,12 +811,12 @@ in {
803 done < <(export LC_ALL=C.UTF-8; echo; find "$RESULTS_DIR" -type f -printf $'%T@ %p\n' | sort -n | cut -d' ' -f2- | xargs -r cat) 811 done < <(export LC_ALL=C.UTF-8; echo; find "$RESULTS_DIR" -type f -printf $'%T@ %p\n' | sort -n | cut -d' ' -f2- | xargs -r cat)
804 $FOUND || echo 812 $FOUND || echo
805 } 813 }
806 FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> ") || exit $? 814 FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> " --width=60) || exit $?
807 if [[ "$FUZZEL_RES" =~ .*\ =\ .* ]]; then 815 if [[ "$FUZZEL_RES" =~ .*\ =\ .* ]]; then
808 QALC_RES="$FUZZEL_RES" 816 QALC_RES="$FUZZEL_RES"
809 QALC_RET=0 817 QALC_RET=0
810 else 818 else
811 QALC_RES=$(qalc "$FUZZEL_RES" 2>&1) 819 QALC_RES=$(qalc -set "autocalc off" "$FUZZEL_RES" 2>&1)
812 QALC_RET=$? 820 QALC_RET=$?
813 fi 821 fi
814 [[ -n "$QALC_RES" ]] || exit 1 822 [[ -n "$QALC_RES" ]] || exit 1
@@ -828,11 +836,26 @@ in {
828 notify-send "$QALC_RES" 836 notify-send "$QALC_RES"
829 ''; 837 '';
830 })); 838 }));
839 "Mod+Shift+U".action =
840 let
841 qalcKitty = pkgs.symlinkJoin {
842 name = "qalc-kitty";
843 paths = [ config.programs.kitty.package ];
844 buildInputs = [ pkgs.makeWrapper ];
845 postBuild = ''
846 wrapProgram $out/bin/kitty \
847 --add-flags "--config ${pkgs.writeText "kitty.conf" ''
848 include $HOME/${config.xdg.configFile."kitty/kitty.conf".target}
849 shell ${lib.getExe pkgs.libqalculate}
850 ''}"
851 '';
852 };
853 in spawn (lib.getExe' qalcKitty "kitty");
831 "Mod+E".action = spawn (lib.getExe (pkgs.writeShellApplication { 854 "Mod+E".action = spawn (lib.getExe (pkgs.writeShellApplication {
832 name = "emoji-fuzzel"; 855 name = "emoji-fuzzel";
833 runtimeInputs = with pkgs; [ config.programs.fuzzel.package wtype wl-clipboard-rs ]; 856 runtimeInputs = with pkgs; [ config.programs.fuzzel.package wtype wl-clipboard-rs ];
834 text = '' 857 text = ''
835 FUZZEL_RES=$(fuzzel --dmenu --prompt "emoji> " <"$HOME"/.local/share/emoji-data/list.txt) || exit $? 858 FUZZEL_RES=$(fuzzel --dmenu --prompt "emoji> " --cache "$HOME"/.cache/fuzzel-emoji --width=60 <"$HOME"/.local/share/emoji-data/list.txt) || exit $?
836 [[ -n "$FUZZEL_RES" ]] || exit 1 859 [[ -n "$FUZZEL_RES" ]] || exit 1
837 wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste 860 wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste
838 ''; 861 '';
@@ -973,6 +996,9 @@ in {
973 996
974 "Mod+D".action = with-urgent-window-action "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}"; 997 "Mod+D".action = with-urgent-window-action "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}";
975 "Mod+Shift+D".action = with-focused-window-action "{\"Action\":{\"UnsetUrgent\":{\"id\": .id}}}"; 998 "Mod+Shift+D".action = with-focused-window-action "{\"Action\":{\"UnsetUrgent\":{\"id\": .id}}}";
999
1000 "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui");
1001 "Mod+Shift+K".action = spawn (lib.getExe' pkgs.worktime "worktime-stop");
976 })) 1002 }))
977 (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces) 1003 (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces)
978 (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) 1004 (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces)
diff --git a/accounts/gkleen@sif/niri/mako.nix b/accounts/gkleen@sif/niri/mako.nix
index 810bff89..703d5f7b 100644
--- a/accounts/gkleen@sif/niri/mako.nix
+++ b/accounts/gkleen@sif/niri/mako.nix
@@ -14,8 +14,7 @@
14 outer-margin = 1; 14 outer-margin = 1;
15 max-history = 100; 15 max-history = 100;
16 max-icon-size = 48; 16 max-icon-size = 48;
17 }; 17
18 criteria = {
19 grouped.format = "<b>(%g)</b> <i>%s</i>\\n%b"; 18 grouped.format = "<b>(%g)</b> <i>%s</i>\\n%b";
20 "urgency=low".text-color = "#999999ff"; 19 "urgency=low".text-color = "#999999ff";
21 "urgency=critical".background-color = "#900000dd"; 20 "urgency=critical".background-color = "#900000dd";
@@ -25,6 +24,7 @@
25 ignore-timeout = true; 24 ignore-timeout = true;
26 default-timeout = 2000; 25 default-timeout = 2000;
27 }; 26 };
27 "app-name=worktime".history = false;
28 "mode=silent".invisible = true; 28 "mode=silent".invisible = true;
29 }; 29 };
30 package = pkgs.symlinkJoin { 30 package = pkgs.symlinkJoin {