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.nix381
-rw-r--r--accounts/gkleen@sif/niri/mako.nix6
-rw-r--r--accounts/gkleen@sif/niri/swayosd.nix66
-rw-r--r--accounts/gkleen@sif/niri/waybar.nix347
4 files changed, 194 insertions, 606 deletions
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix
index b57e1cc0..5ae372c1 100644
--- a/accounts/gkleen@sif/niri/default.nix
+++ b/accounts/gkleen@sif/niri/default.nix
@@ -3,13 +3,10 @@ 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;
9 makoctl = lib.getExe' config.services.mako.package "makoctl";
10 loginctl = lib.getExe' hostConfig.systemd.package "loginctl";
11 systemctl = lib.getExe' hostConfig.systemd.package "systemctl";
12 swayosd-client = lib.getExe' config.services.swayosd.package "swayosd-client";
13 10
14 focus_or_spawn = pkgs.writeShellApplication { 11 focus_or_spawn = pkgs.writeShellApplication {
15 name = "focus-or-spawn"; 12 name = "focus-or-spawn";
@@ -134,7 +131,7 @@ let
134 131
135 windows_json="$(niri msg -j windows)" 132 windows_json="$(niri msg -j windows)"
136 active_workspace="$(jq -r '.[] | select(.is_focused) | .workspace_id' <<<"$windows_json")" 133 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)" 134 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 135 # 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")" 136 window_json="$(gojq -rc --arg active_workspace "$active_workspace" --arg window_ix "$window_ix" 'map(select('"$window_select"')) | .[($window_ix | tonumber)]' <<<"$windows_json")"
140 137
@@ -164,12 +161,6 @@ let
164 with-urgent-window-action = config.lib.niri.actions.spawn (lib.getExe (with_predicate_window ".is_urgent")); 161 with-urgent-window-action = config.lib.niri.actions.spawn (lib.getExe (with_predicate_window ".is_urgent"));
165 with-focused-window-action = config.lib.niri.actions.spawn (lib.getExe (with_predicate_window ".is_focused")); 162 with-focused-window-action = config.lib.niri.actions.spawn (lib.getExe (with_predicate_window ".is_focused"));
166in { 163in {
167 imports = [
168 ./waybar.nix
169 ./mako.nix
170 ./swayosd.nix
171 ];
172
173 options = { 164 options = {
174 programs.niri.scratchspaces = lib.mkOption { 165 programs.niri.scratchspaces = lib.mkOption {
175 type = lib.types.listOf (lib.types.submodule ({ config, ... }: { 166 type = lib.types.listOf (lib.types.submodule ({ config, ... }: {
@@ -230,36 +221,7 @@ in {
230 }; 221 };
231 222
232 config = { 223 config = {
233 systemd.user.services.xwayland-satellite = { 224 home.packages = [ pkgs.xwayland-satellite-unstable ];
234 Unit = {
235 BindsTo = [ "graphical-session.target" ];
236 PartOf = [ "graphical-session.target" ];
237 After = [ "graphical-session.target" ];
238 Requisite = [ "graphical-session.target" ];
239 };
240 Service = {
241 Type = "notify";
242 NotifyAccess = "all";
243 Environment = [ "DISPLAY=:0" ];
244 ExecStart = ''${lib.getExe pkgs.xwayland-satellite-unstable} ''${DISPLAY}'';
245 ExecStartPre = "${systemctl} --user import-environment DISPLAY";
246 StandardOutput = "journal";
247 };
248 Install = {
249 WantedBy = [ "graphical-session.target" ];
250 };
251 };
252
253 services.swayidle = {
254 events = [
255 { event = "after-resume"; command = "${lib.getExe niri} msg action power-on-monitors"; }
256 ];
257 timeouts = [
258 { timeout = 540;
259 command = "${lib.getExe niri} msg action power-off-monitors";
260 }
261 ];
262 };
263 225
264 systemd.user.sockets.niri-workspace-history = { 226 systemd.user.sockets.niri-workspace-history = {
265 Socket = { 227 Socket = {
@@ -449,8 +411,8 @@ in {
449 { title = "^Access Request.*"; } 411 { title = "^Access Request.*"; }
450 { title = ".*Passkey credentials$"; } 412 { title = ".*Passkey credentials$"; }
451 ]; 413 ];
452 windowRuleExtra = [ 414 windowRuleExtra = with kdl; [
453 (kdl.leaf "open-focused" false) 415 (sleaf "open-focused" false)
454 ]; 416 ];
455 key = "Mod+Control+P"; 417 key = "Mod+Control+P";
456 app-id = "org.keepassxc.KeePassXC"; 418 app-id = "org.keepassxc.KeePassXC";
@@ -477,6 +439,20 @@ in {
477 app-id = "com.github.wwmm.easyeffects"; 439 app-id = "com.github.wwmm.easyeffects";
478 spawn = [ "easyeffects" ]; 440 spawn = [ "easyeffects" ];
479 } 441 }
442 { name = "time";
443 key = "Mod+Control+K";
444 app-id = "chrome-kimai.yggdrasil.li__-Default";
445 spawn = [ (toString (pkgs.resholve.writeScript "kimai" {
446 interpreter = pkgs.runtimeShell;
447 inputs = [ pkgs.dex ];
448 execer = [ "cannot:${lib.getExe pkgs.dex}" ];
449 } ''
450 exec dex $HOME/.local/state/nix/profile/share/applications/kimai.desktop
451 '')) ];
452 windowRuleExtra = with kdl; [
453 (sleaf "block-out-from" "screencast")
454 ];
455 }
480 ]; 456 ];
481 programs.niri.config = 457 programs.niri.config =
482 let 458 let
@@ -486,10 +462,12 @@ in {
486 then v 462 then v
487 else null; 463 else null;
488 opt-props = lib.filterAttrs (lib.const (value: value != null)); 464 opt-props = lib.filterAttrs (lib.const (value: value != null));
465 normalize-nodes = nodes: lib.remove null (lib.flatten nodes);
489 in 466 in
490 [ (flag "prefer-no-csd") 467 normalize-nodes [
468 (flag "prefer-no-csd")
491 469
492 (leaf "screenshot-path" "~/screenshots/%Y-%m-%dT%H:%M:%S.png") 470 (sleaf "screenshot-path" "~/screenshots/%Y-%m-%dT%H:%M:%S.png")
493 471
494 (plain "hotkey-overlay" [ 472 (plain "hotkey-overlay" [
495 (flag "skip-at-startup") 473 (flag "skip-at-startup")
@@ -497,27 +475,27 @@ in {
497 475
498 (plain "input" [ 476 (plain "input" [
499 (plain "keyboard" [ 477 (plain "keyboard" [
500 (leaf "repeat-delay" 300) 478 (sleaf "repeat-delay" 300)
501 (leaf "repeat-rate" 50) 479 (sleaf "repeat-rate" 50)
502 480
503 (plain "xkb" [ 481 (plain "xkb" [
504 (leaf "layout" "us,us") 482 (sleaf "layout" "us,us")
505 (leaf "variant" "dvp,") 483 (sleaf "variant" "dvp,")
506 (leaf "options" "compose:caps,grp:win_space_toggle") 484 (sleaf "options" "compose:caps,grp:win_space_toggle")
507 ]) 485 ])
508 ]) 486 ])
509 487
510 (flag "workspace-auto-back-and-forth") 488 (flag "workspace-auto-back-and-forth")
511 # (leaf "focus-follows-mouse" {}) 489 # (sleaf "focus-follows-mouse" {})
512 # (flag "warp-mouse-to-focus") 490 # (flag "warp-mouse-to-focus")
513 491
514 # (plain "touchpad" [ (flag "off") ]) 492 # (plain "touchpad" [ (flag "off") ])
515 (plain "trackball" [ 493 (plain "trackball" [
516 (leaf "scroll-method" "on-button-down") 494 (sleaf "scroll-method" "on-button-down")
517 (leaf "scroll-button" 278) 495 (sleaf "scroll-button" 278)
518 ]) 496 ])
519 (plain "touch" [ 497 (plain "touch" [
520 (leaf "map-to-output" "eDP-1") 498 (sleaf "map-to-output" "eDP-1")
521 ]) 499 ])
522 ]) 500 ])
523 501
@@ -525,7 +503,7 @@ in {
525 (plain "hot-corners" [(flag "off")]) 503 (plain "hot-corners" [(flag "off")])
526 ]) 504 ])
527 505
528 (plain "environment" (lib.mapAttrsToList leaf { 506 (plain "environment" (lib.mapAttrsToList sleaf {
529 NIXOS_OZONE_WL = "1"; 507 NIXOS_OZONE_WL = "1";
530 QT_QPA_PLATFORM = "wayland"; 508 QT_QPA_PLATFORM = "wayland";
531 QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; 509 QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
@@ -538,47 +516,47 @@ in {
538 SUDO_ASKPASS = lib.getExe pkgs.kdePackages.ksshaskpass; 516 SUDO_ASKPASS = lib.getExe pkgs.kdePackages.ksshaskpass;
539 })) 517 }))
540 518
541 (node "output" "eDP-1" [ 519 (node "output" ["eDP-1"] [
542 (leaf "scale" 1.5) 520 (sleaf "scale" 1.5)
543 (leaf "position" { x = 0; y = 0; }) 521 (sleaf "position" { x = 0; y = 0; })
544 ]) 522 ])
545 (node "output" "Ancor Communications Inc ASUS PB287Q 0x0000DD9B" [ 523 (node "output" ["Ancor Communications Inc ASUS PB287Q 0x0000DD9B"] [
546 (leaf "scale" 1.5) 524 (sleaf "scale" 1.5)
547 (leaf "position" { x = 2560; y = 0; }) 525 (sleaf "position" { x = 2560; y = 0; })
548 ]) 526 ])
549 (node "output" "HP Inc. HP 727pu CN4417143K" [ 527 (node "output" ["HP Inc. HP 727pu CN4417143K"] [
550 (leaf "mode" "2560x1440@119.998") 528 (sleaf "mode" "2560x1440@119.998")
551 (leaf "scale" 1) 529 (sleaf "scale" 1)
552 (leaf "position" { x = 2560; y = 0; }) 530 (sleaf "position" { x = 2560; y = 0; })
553 (flag "variable-refresh-rate") 531 (flag "variable-refresh-rate")
554 ]) 532 ])
555 533
556 (plain "debug" [ 534 (plain "debug" [
557 (leaf "render-drm-device" "/dev/dri/by-path/pci-0000:00:02.0-render") 535 (sleaf "render-drm-device" "/dev/dri/by-path/pci-0000:00:02.0-render")
558 ]) 536 ])
559 537
560 (plain "animations" [ 538 (plain "animations" [
561 (leaf "slowdown" 0.5) 539 (sleaf "slowdown" 0.5)
562 (plain "workspace-switch" [(flag "off")]) 540 (plain "workspace-switch" [(flag "off")])
563 ]) 541 ])
564 542
565 (plain "layout" [ 543 (plain "layout" [
566 (leaf "gaps" 8) 544 (sleaf "gaps" 8)
567 (plain "struts" [ 545 (plain "struts" [
568 (leaf "left" 26) 546 (sleaf "left" 26)
569 (leaf "right" 26) 547 (sleaf "right" 26)
570 (leaf "top" 0) 548 (sleaf "top" 0)
571 (leaf "bottom" 0) 549 (sleaf "bottom" 0)
572 ]) 550 ])
573 (plain "border" [ 551 (plain "border" [
574 (leaf "width" 2) 552 (sleaf "width" 2)
575 (leaf "active-gradient" { 553 (sleaf "active-gradient" {
576 from = "hsla(195 100% 45% 1)"; 554 from = "hsla(195 100% 45% 1)";
577 to = "hsla(155 100% 37.5% 1)"; 555 to = "hsla(155 100% 37.5% 1)";
578 angle = 29; 556 angle = 29;
579 relative-to = "workspace-view"; 557 relative-to = "workspace-view";
580 }) 558 })
581 (leaf "inactive-gradient" { 559 (sleaf "inactive-gradient" {
582 from = "hsla(0 0% 27.7% 1)"; 560 from = "hsla(0 0% 27.7% 1)";
583 to = "hsla(0 0% 23% 1)"; 561 to = "hsla(0 0% 23% 1)";
584 angle = 29; 562 angle = 29;
@@ -589,29 +567,29 @@ in {
589 (flag "off") 567 (flag "off")
590 ]) 568 ])
591 569
592 (plain "preset-column-widths" (map (prop: leaf "proportion" prop) [ 570 (plain "preset-column-widths" (map (prop: sleaf "proportion" prop) [
593 (1. / 4.) (1. / 3.) (1. / 2.) (2. / 3.) (3. / 4.) (1.) 571 (1. / 4.) (1. / 3.) (1. / 2.) (2. / 3.) (3. / 4.) (1.)
594 ])) 572 ]))
595 (plain "default-column-width" [ (leaf "proportion" (1. / 2.)) ]) 573 (plain "default-column-width" [ (sleaf "proportion" (1. / 2.)) ])
596 (plain "preset-window-heights" (map (prop: leaf "proportion" prop) [ 574 (plain "preset-window-heights" (map (prop: sleaf "proportion" prop) [
597 (1. / 3.) (1. / 2.) (2. / 3.) (1.) 575 (1. / 3.) (1. / 2.) (2. / 3.) (1.)
598 ])) 576 ]))
599 577
600 (flag "always-center-single-column") 578 (flag "always-center-single-column")
601 579
602 (plain "tab-indicator" [ 580 (plain "tab-indicator" [
603 (leaf "gap" 4) 581 (sleaf "gap" 4)
604 (leaf "width" 8) 582 (sleaf "width" 8)
605 (leaf "gaps-between-tabs" 4) 583 (sleaf "gaps-between-tabs" 4)
606 (flag "place-within-column") 584 (flag "place-within-column")
607 (leaf "length" { total-proportion = 1.; }) 585 (sleaf "length" { total-proportion = 1.; })
608 (leaf "active-gradient" { 586 (sleaf "active-gradient" {
609 from = "hsla(195 100% 60% 0.75)"; 587 from = "hsla(195 100% 60% 0.75)";
610 to = "hsla(155 100% 50% 0.75)"; 588 to = "hsla(155 100% 50% 0.75)";
611 angle = 29; 589 angle = 29;
612 relative-to = "workspace-view"; 590 relative-to = "workspace-view";
613 }) 591 })
614 (leaf "inactive-gradient" { 592 (sleaf "inactive-gradient" {
615 from = "hsla(0 0% 42% 0.66)"; 593 from = "hsla(0 0% 42% 0.66)";
616 to = "hsla(0 0% 35% 0.66)"; 594 to = "hsla(0 0% 35% 0.66)";
617 angle = 29; 595 angle = 29;
@@ -625,124 +603,121 @@ in {
625 ]) 603 ])
626 604
627 (map (name: 605 (map (name:
628 (node "workspace" name [ 606 (node "workspace" [name] [
629 (leaf "open-on-output" "eDP-1") 607 (sleaf "open-on-output" "eDP-1")
630 ]) 608 ])
631 ) (map ({name, ...}: name) cfg.scratchspaces)) 609 ) (map ({name, ...}: name) cfg.scratchspaces))
632 (map (name: 610 (map (name:
633 (leaf "workspace" name) 611 (sleaf "workspace" name)
634 ) ["comm" "web" "vid" "bmr"]) 612 ) ["comm" "web" "vid" "bmr"])
635 613
636 (plain "window-rule" [ 614 (plain "window-rule" [
637 (leaf "clip-to-geometry" true) 615 (sleaf "clip-to-geometry" true)
638 ]) 616 ])
639 617
640 (plain "window-rule" [ 618 (plain "window-rule" [
641 (leaf "match" { is-floating = true; }) 619 (sleaf "match" { is-floating = true; })
642 (leaf "geometry-corner-radius" 8) 620 (sleaf "geometry-corner-radius" 8)
643 (plain "shadow" [ (flag "on") ]) 621 (plain "shadow" [ (flag "on") ])
644 ]) 622 ])
645 623
646 (plain "window-rule" [ 624 (plain "window-rule" [
647 (leaf "match" { app-id = "^org\\.keepassxc\\.KeePassXC$"; }) 625 (sleaf "match" { app-id = "^org\\.keepassxc\\.KeePassXC$"; })
648 (leaf "block-out-from" "screencast") 626 (sleaf "block-out-from" "screencast")
649 ]) 627 ])
650 (plain "window-rule" [ 628 (plain "window-rule" (normalize-nodes [
651 (map (title: 629 (map (title:
652 (leaf "match" { app-id = "^org\\.keepassxc\\.KeePassXC$"; inherit title; }) 630 (sleaf "match" { app-id = "^org\\.keepassxc\\.KeePassXC$"; inherit title; })
653 ) ["^Unlock Database.*" "^Access Request.*" ".*Passkey credentials$"]) 631 ) ["^Unlock Database.*" "^Access Request.*" ".*Passkey credentials$" "Browser Access Request$"])
654 (leaf "open-focused" true) 632 (sleaf "open-focused" true)
655 (leaf "open-floating" true) 633 (sleaf "open-floating" true)
656 ]) 634 ]))
657 635
658 (map ({ name, match, exclude, windowRuleExtra, ... }: 636 (map ({ name, match, exclude, windowRuleExtra, ... }:
659 (optional-node (match != []) (plain "window-rule" [ 637 (optional-node (match != []) (plain "window-rule" (normalize-nodes [
660 (map (leaf "match") match) 638 (map (sleaf "match") match)
661 (map (leaf "exclude") exclude) 639 (map (sleaf "exclude") exclude)
662 (leaf "open-on-workspace" name) 640 (sleaf "open-on-workspace" name)
663 (leaf "open-maximized" true) 641 (sleaf "open-maximized" true)
664 windowRuleExtra 642 windowRuleExtra
665 ])) 643 ])))
666 ) cfg.scratchspaces) 644 ) cfg.scratchspaces)
667 645
668 (plain "window-rule" [ 646 (plain "window-rule" [
669 (leaf "match" { app-id = "^emacs$"; }) 647 (sleaf "match" { app-id = "^emacs$"; })
670 (leaf "match" { app-id = "^firefox$"; }) 648 (sleaf "match" { app-id = "^firefox$"; })
671 (plain "default-column-width" [(leaf "proportion" (2. / 3.))]) 649 (plain "default-column-width" [(sleaf "proportion" (2. / 3.))])
672 ]) 650 ])
673 (plain "window-rule" [ 651 (plain "window-rule" [
674 (leaf "match" { app-id = "^kitty$"; }) 652 (sleaf "match" { app-id = "^kitty$"; })
675 (leaf "match" { app-id = "^kitty-play$"; }) 653 (sleaf "match" { app-id = "^kitty-play$"; })
676 (plain "default-column-width" [(leaf "proportion" (1. / 3.))]) 654 (plain "default-column-width" [(sleaf "proportion" (1. / 3.))])
677 ]) 655 ])
678 656
679 (plain "window-rule" [ 657 (plain "window-rule" [
680 (leaf "match" { app-id = "^thunderbird$"; }) 658 (sleaf "match" { app-id = "^thunderbird$"; })
681 (leaf "match" { app-id = "^Element$"; }) 659 (sleaf "match" { app-id = "^Element$"; })
682 (leaf "match" { app-id = "^Rainbow$"; }) 660 (sleaf "match" { app-id = "^chrome-web\.openrainbow\.com__-Default$"; })
683 (leaf "open-on-workspace" "comm") 661 (sleaf "open-on-workspace" "comm")
684 ]) 662 ])
685 (plain "window-rule" [ 663 (plain "window-rule" [
686 (leaf "match" { app-id = "^firefox$"; }) 664 (sleaf "match" { app-id = "^firefox$"; })
687 (leaf "open-on-workspace" "web") 665 (sleaf "open-on-workspace" "web")
688 (leaf "open-maximized" true) 666 (sleaf "open-maximized" true)
689 ]) 667 ])
690 (plain "window-rule" [ 668 (plain "window-rule" [
691 (leaf "match" { app-id = "^mpv$"; }) 669 (sleaf "match" { app-id = "^mpv$"; })
692 (leaf "open-on-workspace" "vid") 670 (sleaf "open-on-workspace" "vid")
693 (plain "default-column-width" [(leaf "proportion" 1.)]) 671 (plain "default-column-width" [(sleaf "proportion" 1.)])
694 ]) 672 ])
695 (plain "window-rule" [ 673 (plain "window-rule" [
696 (leaf "match" { app-id = "^kitty-play$"; }) 674 (sleaf "match" { app-id = "^kitty-play$"; })
697 (leaf "open-on-workspace" "vid") 675 (sleaf "open-on-workspace" "vid")
698 (leaf "open-focused" false) 676 (sleaf "open-focused" false)
699 ]) 677 ])
700 (plain "window-rule" [ 678 (plain "window-rule" [
701 (leaf "match" { app-id = "^pdfpc$"; }) 679 (sleaf "match" { app-id = "^chrome-audiobookshelf\.yggdrasil\.li__-Default$"; })
702 (plain "default-column-width" [(leaf "proportion" 1.)]) 680 (sleaf "match" { app-id = "^YouTube Music Desktop App$"; })
681 (sleaf "open-on-workspace" "vid")
703 ]) 682 ])
704 (plain "window-rule" [ 683 (plain "window-rule" [
705 (leaf "match" { app-id = "^pdfpc$"; title = "^.*presentation.*$"; }) 684 (sleaf "match" { app-id = "^pdfpc$"; })
706 (plain "default-column-width" [(leaf "proportion" 1.)]) 685 (plain "default-column-width" [(sleaf "proportion" 1.)])
707 (leaf "open-fullscreen" true)
708 (leaf "open-on-workspace" "bmr")
709 (leaf "open-focused" false)
710 ]) 686 ])
711 (plain "window-rule" [ 687 (plain "window-rule" [
712 (map (leaf "match") [ 688 (sleaf "match" { app-id = "^pdfpc$"; title = "^.*presentation.*$"; })
689 (plain "default-column-width" [(sleaf "proportion" 1.)])
690 (sleaf "open-fullscreen" true)
691 (sleaf "open-on-workspace" "bmr")
692 (sleaf "open-focused" false)
693 ])
694 (plain "window-rule" (normalize-nodes [
695 (map (sleaf "match") [
713 { app-id = "^Gimp-"; title = "^Quit GIMP$"; } 696 { app-id = "^Gimp-"; title = "^Quit GIMP$"; }
714 { app-id = "^org\\.kde\\.polkit-kde-authentication-agent-1$"; } 697 { app-id = "^org\\.kde\\.polkit-kde-authentication-agent-1$"; }
715 { app-id = "^xdg-desktop-portal-gtk$"; } 698 { app-id = "^xdg-desktop-portal-gtk$"; }
716 ]) 699 ])
717 (leaf "open-floating" true) 700 (sleaf "open-floating" true)
718 ]) 701 ]))
719 (plain "window-rule" [ 702 (plain "window-rule" [
720 (leaf "match" { app-id = "^org\\.pwmt\\.zathura$"; }) 703 (sleaf "match" { app-id = "^org\\.pwmt\\.zathura$"; })
721 (leaf "match" { app-id = "^evince$"; }) 704 (sleaf "match" { app-id = "^evince$"; })
722 (leaf "match" { app-id = "^org\\.gnome\\.Papers$"; }) 705 (sleaf "match" { app-id = "^org\\.gnome\\.Papers$"; })
723 (leaf "default-column-display" "tabbed") 706 (sleaf "default-column-display" "tabbed")
724 ]) 707 ])
725 708
726 (plain "layer-rule" [ 709 (plain "layer-rule" [
727 (leaf "match" { namespace = "^notifications$"; }) 710 (sleaf "match" { namespace = "^notifications$"; })
728 (leaf "match" { namespace = "^waybar$"; }) 711 (sleaf "match" { namespace = "^bar$"; })
729 (leaf "match" { namespace = "^launcher$"; }) 712 (sleaf "match" { namespace = "^launcher$"; })
730 (leaf "block-out-from" "screencast") 713 (sleaf "block-out-from" "screencast")
731 ]) 714 ])
732 715
733 (plain "binds" 716 (plain "binds"
734 (let 717 (let
735 bind = name: cfg: node name (opt-props { 718 bind = name: cfg: node name [(lib.removeAttrs cfg ["action"])] (lib.mapAttrsToList leaf (lib.removeAttrs cfg.action ["__functor"]));
736 cooldown-ms = cfg.cooldown-ms or null;
737 }
738 // (lib.optionalAttrs (!(cfg.repeat or true)) {
739 repeat = false;
740 })
741 // (lib.optionalAttrs (cfg.allow-when-locked or false) {
742 allow-when-locked = true;
743 })) (lib.mapAttrsToList leaf (lib.removeAttrs cfg.action ["__functor"]));
744 in 719 in
745 [ 720 normalize-nodes [
746 (lib.mapAttrsToList bind (with config.lib.niri.actions; { 721 (lib.mapAttrsToList bind (with config.lib.niri.actions; {
747 "Mod+Slash".action = show-hotkey-overlay; 722 "Mod+Slash".action = show-hotkey-overlay;
748 723
@@ -797,12 +772,12 @@ in {
797 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) 772 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)
798 $FOUND || echo 773 $FOUND || echo
799 } 774 }
800 FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> ") || exit $? 775 FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> " --width=60) || exit $?
801 if [[ "$FUZZEL_RES" =~ .*\ =\ .* ]]; then 776 if [[ "$FUZZEL_RES" =~ .*\ =\ .* ]]; then
802 QALC_RES="$FUZZEL_RES" 777 QALC_RES="$FUZZEL_RES"
803 QALC_RET=0 778 QALC_RET=0
804 else 779 else
805 QALC_RES=$(qalc "$FUZZEL_RES" 2>&1) 780 QALC_RES=$(qalc -set "autocalc off" "$FUZZEL_RES" 2>&1)
806 QALC_RET=$? 781 QALC_RET=$?
807 fi 782 fi
808 [[ -n "$QALC_RES" ]] || exit 1 783 [[ -n "$QALC_RES" ]] || exit 1
@@ -822,11 +797,26 @@ in {
822 notify-send "$QALC_RES" 797 notify-send "$QALC_RES"
823 ''; 798 '';
824 })); 799 }));
800 "Mod+Shift+U".action =
801 let
802 qalcKitty = pkgs.symlinkJoin {
803 name = "qalc-kitty";
804 paths = [ config.programs.kitty.package ];
805 buildInputs = [ pkgs.makeWrapper ];
806 postBuild = ''
807 wrapProgram $out/bin/kitty \
808 --add-flags "--config ${pkgs.writeText "kitty.conf" ''
809 include $HOME/${config.xdg.configFile."kitty/kitty.conf".target}
810 shell ${lib.getExe pkgs.libqalculate}
811 ''}"
812 '';
813 };
814 in spawn (lib.getExe' qalcKitty "kitty");
825 "Mod+E".action = spawn (lib.getExe (pkgs.writeShellApplication { 815 "Mod+E".action = spawn (lib.getExe (pkgs.writeShellApplication {
826 name = "emoji-fuzzel"; 816 name = "emoji-fuzzel";
827 runtimeInputs = with pkgs; [ config.programs.fuzzel.package wtype wl-clipboard-rs ]; 817 runtimeInputs = with pkgs; [ config.programs.fuzzel.package wtype wl-clipboard-rs ];
828 text = '' 818 text = ''
829 FUZZEL_RES=$(fuzzel --dmenu --prompt "emoji> " <"$HOME"/.local/share/emoji-data/list.txt) || exit $? 819 FUZZEL_RES=$(fuzzel --dmenu --prompt "emoji> " --cache "$HOME"/.cache/fuzzel-emoji --width=60 <"$HOME"/.local/share/emoji-data/list.txt) || exit $?
830 [[ -n "$FUZZEL_RES" ]] || exit 1 820 [[ -n "$FUZZEL_RES" ]] || exit 1
831 wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste 821 wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste
832 ''; 822 '';
@@ -910,63 +900,74 @@ in {
910 "Mod+Right".action = set-column-width "+10%"; 900 "Mod+Right".action = set-column-width "+10%";
911 901
912 "Mod+Shift+Z" = { 902 "Mod+Shift+Z" = {
913 action = spawn (lib.getExe niri) "msg" "action" "power-off-monitors"; 903 action = power-off-monitors;
914 allow-when-locked = true; 904 allow-when-locked = true;
915 }; 905 };
916 "Mod+Shift+L".action = spawn loginctl "lock-session";
917 "Mod+Shift+E".action = quit; 906 "Mod+Shift+E".action = quit;
918 "Mod+Shift+Minus" = { 907
919 action = spawn systemctl "suspend"; 908 # "Mod+Semicolon".action = spawn makoctl "dismiss" "--group";
909 # "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all";
910 # "Mod+Period".action = spawn makoctl "menu" "--" (lib.getExe config.programs.fuzzel.package) "--dmenu";
911 # "Mod+Comma".action = spawn makoctl "restore";
912
913 "Mod+Control+W".action = with-empty-unnamed-workspace-action "{\"Action\":{\"FocusWorkspace\":{\"reference\":{\"Id\": $workspace_id}}}}";
914 "Mod+Control+Shift+W".action = with-empty-unnamed-workspace-action "{\"Action\":{\"MoveColumnToWorkspace\":{\"reference\":{\"Id\": $workspace_id}, \"focus\": true}}}";
915
916 "Mod+X".action = set-dynamic-cast-window;
917 "Mod+Shift+X".action = set-dynamic-cast-monitor;
918 "Mod+Control+Shift+X".action = clear-dynamic-cast-target;
919
920 "Mod+D".action = with-urgent-window-action "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}";
921 "Mod+Shift+D".action = with-focused-window-action "{\"Action\":{\"UnsetUrgent\":{\"id\": .id}}}";
922
923 "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui");
924 "Mod+Shift+K".action = spawn (lib.getExe' pkgs.worktime "worktime-stop");
925 }))
926 (lib.mapAttrsToList (name: cfg: node name [(lib.removeAttrs cfg ["action"])] [cfg.action]) (let
927 shell = obj: leaf "send-unix" [
928 { path = ''''${XDG_RUNTIME_DIR}/shell.sock''; }
929 (builtins.toJSON obj + "\n")
930 ];
931 in {
932 "XF86AudioRaiseVolume" = {
920 allow-when-locked = true; 933 allow-when-locked = true;
934 action = shell { Volume.volume = "up"; };
921 }; 935 };
922 "Mod+Shift+Control+Minus" = { 936 "XF86AudioLowerVolume" = {
923 action = spawn systemctl "hibernate";
924 allow-when-locked = true; 937 allow-when-locked = true;
938 action = shell { Volume.volume = "down"; };
925 }; 939 };
926 "Mod+Shift+P" = { 940 "XF86AudioMute" = {
927 action = spawn (lib.getExe pkgs.playerctl) "-a" "pause";
928 allow-when-locked = true; 941 allow-when-locked = true;
942 action = shell { Volume.muted = "toggle"; };
929 }; 943 };
930 944 "XF86AudioMicMute" = {
931 "XF86MonBrightnessUp" = {
932 action = spawn swayosd-client "--brightness" "raise";
933 allow-when-locked = true; 945 allow-when-locked = true;
946 action = shell { Volume."mic-muted" = "toggle"; };
934 }; 947 };
935 "XF86MonBrightnessDown" = { 948 "XF86MonBrightnessUp" = {
936 action = spawn swayosd-client "--brightness" "lower"; 949 action = shell { Brightness = "up"; };
937 allow-when-locked = true; 950 allow-when-locked = true;
938 }; 951 };
939 "XF86AudioRaiseVolume" = { 952 "XF86MonBrightnessDown" = {
940 action = spawn swayosd-client "--output-volume" "raise"; 953 action = shell { Brightness = "down"; };
941 allow-when-locked = true; 954 allow-when-locked = true;
942 }; 955 };
943 "XF86AudioLowerVolume" = { 956 "Mod+Shift+L".action = shell { LockSession = {}; };
944 action = spawn swayosd-client "--output-volume" "lower"; 957 "Mod+Shift+Minus" = {
958 action = shell { Suspend = {}; };
945 allow-when-locked = true; 959 allow-when-locked = true;
946 }; 960 };
947 "XF86AudioMute" = { 961 "Mod+Shift+Control+Minus" = {
948 action = spawn swayosd-client "--output-volume" "mute-toggle"; 962 action = shell { Hibernate = {}; };
949 allow-when-locked = true; 963 allow-when-locked = true;
950 }; 964 };
951 "XF86AudioMicMute" = { 965 "Mod+Shift+P" = {
952 action = spawn swayosd-client "--input-volume" "mute-toggle"; 966 action = shell { Mpris = { PauseAll = {}; }; };
953 allow-when-locked = true; 967 allow-when-locked = true;
954 }; 968 };
955 969 "Mod+Semicolon".action = shell { Notifications = { DismissGroup = {}; }; };
956 "Mod+Semicolon".action = spawn makoctl "dismiss" "--group"; 970 "Mod+Shift+Semicolon".action = shell { Notifications = { DismissAll = {}; }; };
957 "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all";
958 "Mod+Period".action = spawn makoctl "menu" "--" (lib.getExe config.programs.fuzzel.package) "--dmenu";
959 "Mod+Comma".action = spawn makoctl "restore";
960
961 "Mod+Control+W".action = with-empty-unnamed-workspace-action "{\"Action\":{\"FocusWorkspace\":{\"reference\":{\"Id\": $workspace_id}}}}";
962 "Mod+Control+Shift+W".action = with-empty-unnamed-workspace-action "{\"Action\":{\"MoveColumnToWorkspace\":{\"reference\":{\"Id\": $workspace_id}, \"focus\": true}}}";
963
964 "Mod+X".action = set-dynamic-cast-window;
965 "Mod+Shift+X".action = set-dynamic-cast-monitor;
966 "Mod+Control+Shift+X".action = clear-dynamic-cast-target;
967
968 "Mod+D".action = with-urgent-window-action "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}";
969 "Mod+Shift+D".action = with-focused-window-action "{\"Action\":{\"UnsetUrgent\":{\"id\": .id}}}";
970 })) 971 }))
971 (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) 972 (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)
972 (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) 973 (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..3d246d96 100644
--- a/accounts/gkleen@sif/niri/mako.nix
+++ b/accounts/gkleen@sif/niri/mako.nix
@@ -1,6 +1,6 @@
1{ config, lib, pkgs, ... }: 1{ config, lib, pkgs, ... }:
2{ 2{
3 config = { 3 config = lib.mkIf false {
4 services.mako = { 4 services.mako = {
5 enable = true; 5 enable = true;
6 settings = { 6 settings = {
@@ -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 {
diff --git a/accounts/gkleen@sif/niri/swayosd.nix b/accounts/gkleen@sif/niri/swayosd.nix
deleted file mode 100644
index 54ebb302..00000000
--- a/accounts/gkleen@sif/niri/swayosd.nix
+++ /dev/null
@@ -1,66 +0,0 @@
1{ pkgs, ... }:
2{
3 config = {
4 services.swayosd = {
5 enable = true;
6 topMargin = 0.4769706078;
7 stylePath = pkgs.runCommand "style.css" {
8 passAsFile = [ "src" ];
9 src = ''
10 window#osd {
11 padding: 12px 20px;
12 border-radius: 999px;
13 border: none;
14 background: rgba(0, 0, 0, 0.87);
15
16 #container {
17 margin: 16px;
18 }
19
20 image,
21 label {
22 color: rgb(255, 255, 255);
23
24 &:disabled {
25 opacity: 1;
26 color: rgb(84, 84, 84);
27 }
28 }
29
30 progressbar {
31 min-height: 6px;
32 border-radius: 999px;
33 background: transparent;
34 border: none;
35
36 trough, progress {
37 min-height: inherit;
38 border-radius: inherit;
39 border: none;
40 }
41
42 trough {
43 background: rgb(127, 127, 127);
44 }
45 progress {
46 background: rgb(255, 255, 255);
47 }
48
49 &:disabled {
50 opacity: 1;
51
52 trough {
53 background: rgb(19, 19, 19);
54 }
55 progress {
56 background: rgb(38, 38, 38);
57 }
58 }
59 }
60 }
61 '';
62 buildInputs = with pkgs; [sass];
63 } "scss -C --sourcemap=none --style=compact $srcPath $out";
64 };
65 };
66}
diff --git a/accounts/gkleen@sif/niri/waybar.nix b/accounts/gkleen@sif/niri/waybar.nix
deleted file mode 100644
index cc131c08..00000000
--- a/accounts/gkleen@sif/niri/waybar.nix
+++ /dev/null
@@ -1,347 +0,0 @@
1{ lib, config, pkgs, ... }:
2let
3 swayosd-client = lib.getExe' config.services.swayosd.package "swayosd-client";
4in {
5 config = {
6 programs.waybar = {
7 enable = true;
8 systemd = {
9 enable = true;
10 target = "graphical-session.target";
11 };
12 settings = let
13 windowRewrites = {
14 "(.*) — Mozilla Firefox" = "$1";
15 "(.*) - Mozilla Thunderbird" = "$1";
16 "(.*) - mpv" = "$1";
17 };
18 iconSize = 11;
19 in [
20 {
21 layer = "top";
22 position = "top";
23 height = 21;
24 output = [ "eDP-1" "DP-2" "DP-3" ];
25 modules-left = [ "niri/workspaces" ];
26 modules-center = [ "niri/window" ];
27 modules-right = [ "custom/worktime" "custom/worktime-today"
28 "custom/weather"
29 "custom/keymap"
30 "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "custom/mako" "clock" ];
31
32 "custom/mako" = {
33 format = "{}";
34 return-type = "json";
35 exec = pkgs.writers.writePython3 "mako-silent" { libraries = [ pkgs.python3Packages.dbus-next ]; } ''
36 from dbus_next.aio import MessageBus
37
38 import asyncio
39
40 import json
41
42
43 loop = asyncio.new_event_loop()
44 asyncio.set_event_loop(loop)
45
46
47 async def main():
48 bus = await MessageBus().connect()
49 # the introspection xml would normally be included in your project, but
50 # this is convenient for development
51 introspection = await bus.introspect('org.freedesktop.Notifications', '/fr/emersion/Mako') # noqa: E501
52
53 obj = bus.get_proxy_object('org.freedesktop.Notifications', '/fr/emersion/Mako', introspection) # noqa: E501
54 mako = obj.get_interface('fr.emersion.Mako')
55 properties = obj.get_interface('org.freedesktop.DBus.Properties')
56
57 async def print_mode():
58 modes = await mako.get_modes()
59 is_silent = "silent" in modes
60 icon = "&#xf009b;" if is_silent else "&#xf009a;"
61 text = f"<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>" # noqa: E501
62 if is_silent:
63 text = f"<span color=\"#ffffff\">{text}</span>"
64 print(json.dumps({'text': text, 'tooltip': ', '.join(modes)}, separators=(',', ':')), flush=True) # noqa: E501
65
66 async def on_properties_changed(interface_name, changed_properties, invalidated_properties): # noqa: E501
67 if "Modes" not in invalidated_properties:
68 return
69
70 await print_mode()
71
72 properties.on_properties_changed(on_properties_changed)
73 await print_mode()
74
75 await loop.create_future()
76
77
78 loop.run_until_complete(main())
79 '';
80 on-click = "makoctl mode -t silent";
81 };
82 "custom/weather" = {
83 format = "{}";
84 tooltip = true;
85 interval = 3600;
86 exec = "${lib.getExe pkgs.wttrbar} --hide-conditions --nerd --custom-indicator \"<span font=\\\"Symbols Nerd Font Mono\\\" size=\\\"100%\\\">{ICON}</span> {FeelsLikeC}°\"";
87 return-type = "json";
88 };
89 "custom/keymap" = {
90 format = "{}";
91 tooltip = true;
92 return-type = "json";
93 exec = pkgs.writers.writePython3 "keymap" {} ''
94 import os
95 import socket
96 import json
97
98
99 def output(keymap):
100 short = keymap
101 if keymap == "English (programmer Dvorak)":
102 short = "dvp"
103 elif keymap == "English (US)":
104 short = "<span color=\"#ffffff\">us</span>"
105 print(json.dumps({'text': short, 'tooltip': keymap}, separators=(',', ':')), flush=True) # noqa: E501
106
107
108 keyboard_layouts = []
109
110 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
111 sock.connect(os.environ["NIRI_SOCKET"])
112 sock.send(b"\"EventStream\"\n")
113 for line in sock.makefile(buffering=1, encoding='utf-8'):
114 if line_json := json.loads(line):
115 if "KeyboardLayoutsChanged" in line_json:
116 keyboard_layouts = line_json["KeyboardLayoutsChanged"]["keyboard_layouts"]["names"] # noqa: E501
117 output(keyboard_layouts[line_json["KeyboardLayoutsChanged"]["keyboard_layouts"]["current_idx"]]) # noqa: E501
118 if "KeyboardLayoutSwitched" in line_json:
119 output(keyboard_layouts[line_json["KeyboardLayoutSwitched"]["idx"]]) # noqa: E501
120 '';
121 on-click = "niri msg action switch-layout next";
122 };
123 "custom/worktime" = {
124 interval = 60;
125 exec = "${lib.getExe pkgs.worktime} time --waybar";
126 return-type = "json";
127 };
128 "custom/worktime-today" = {
129 interval = 60;
130 exec = "${lib.getExe pkgs.worktime} today --waybar";
131 return-type = "json";
132 };
133 "niri/workspaces" = {
134 ignore = map ({ name, ... }: name) config.programs.niri.scratchspaces;
135 };
136 "niri/window" = {
137 separate-outputs = true;
138 icon = true;
139 icon-size = 14;
140 rewrite = windowRewrites;
141 };
142 clock = {
143 interval = 1;
144 # timezone = "Europe/Berlin";
145 format = "W{:%V-%u %F %H:%M:%S%Ez}";
146 tooltip-format = "<tt><small>{calendar}</small></tt>";
147 calendar = {
148 mode = "year";
149 mode-mon-col = 3;
150 weeks-pos = "left";
151 on-scroll = 1;
152 format = {
153 months = "<span color='#ffead3'><b>{}</b></span>";
154 days = "{}";
155 weeks = "<span color='#99ffdd'><b>{}</b></span>";
156 weekdays = "<span color='#ffcc66'><b>{}</b></span>";
157 today = "<span color='#ff6699'><b>{}</b></span>";
158 };
159 };
160 };
161 battery = {
162 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
163 icon-size = iconSize - 2;
164 states = { warning = 30; critical = 15; };
165 format-icons = ["&#xf008e;" "&#xf007a;" "&#xf007b;" "&#xf007c;" "&#xf007d;" "&#xf007e;" "&#xf007f;" "&#xf0080;" "&#xf0081;" "&#xf0082;" "&#xf0079;" ];
166 format-charging = "&#xf0084;";
167 format-plugged = "&#xf06a5;";
168 tooltip-format = "{capacity}% {timeTo}";
169 interval = 20;
170 };
171 tray = {
172 icon-size = 16;
173 # show-passive-items = true;
174 spacing = 1;
175 };
176 privacy = {
177 icon-spacing = 7;
178 icon-size = iconSize;
179 modules = [
180 { type = "screenshare"; }
181 { type = "audio-in"; }
182 ];
183 };
184 idle_inhibitor = {
185 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
186 icon-size = iconSize;
187 format-icons = { activated = "&#xf0208;"; deactivated = "&#xf0209;"; };
188 timeout = 120;
189 };
190 backlight = {
191 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
192 icon-size = iconSize;
193 tooltip-format = "{percent}%";
194 format-icons = ["&#xf00da;" "&#xf00db;" "&#xf00dc;" "&#xf00dd;" "&#xf00de;" "&#xf00df;" "&#xf00e0;"];
195 on-scroll-up = "${swayosd-client} --brightness raise";
196 on-scroll-down = "${swayosd-client} --brightness lower";
197 };
198 wireplumber = {
199 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
200 icon-size = iconSize;
201 tooltip-format = "{volume}% {node_name}";
202 format-icons = ["&#xf057f;" "&#xf0580;" "&#xf057e;"];
203 format-muted = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">&#xf075f;</span>";
204 # ignored-sinks = ["Easy Effects Sink"];
205 on-scroll-up = "${swayosd-client} --output-volume raise";
206 on-scroll-down = "${swayosd-client} --output-volume lower";
207 on-click = "${swayosd-client} --output-volume mute-toggle";
208 };
209 }
210 {
211 layer = "top";
212 position = "top";
213 height = 14;
214 output = [ "!eDP-1" "!DP-2" "!DP-3" ];
215 modules-left = [ "niri/workspaces" ];
216 modules-center = [ "niri/window" ];
217 modules-right = [ "clock" ];
218
219 "niri/workspaces" = {
220 ignore = map ({ name, ... }: name) config.programs.niri.scratchspaces;
221 };
222 "niri/window" = {
223 separate-outputs = true;
224 icon = true;
225 icon-size = 14;
226 rewrite = windowRewrites;
227 };
228 clock = {
229 interval = 1;
230 # timezone = "Europe/Berlin";
231 format = "{:%H:%M}";
232 tooltip-format = "W{:%V-%u %F %H:%M:%S%Ez}";
233 };
234 }
235 ];
236 style = ''
237 @define-color white #ffffff;
238 @define-color grey #555555;
239 @define-color blue #1a8fff;
240 @define-color green #23fd00;
241 @define-color orange #f28a21;
242 @define-color red #f2201f;
243
244 * {
245 border: none;
246 font-family: "Fira Sans";
247 font-size: 10pt;
248 min-height: 0;
249 }
250
251 window#waybar {
252 background-color: rgba(0, 0, 0, 0.66);
253 color: @white;
254 }
255
256 .modules-left {
257 margin-left: 38px;
258 }
259 .modules-right {
260 margin-right: 38px;
261 }
262
263 .module {
264 margin: 0 5px;
265 }
266
267 #workspaces button {
268 color: @white;
269 padding: 2px 5px;
270 }
271 #workspaces button.empty {
272 color: @grey;
273 }
274 #workspaces button.active {
275 color: @green;
276 }
277 #workspaces button.urgent {
278 color: @red;
279 }
280
281 #custom-weather, #custom-keymap, #custom-worktime, #custom-worktime-today {
282 color: @grey;
283 margin: 0 5px;
284 }
285 #custom-weather {
286 margin-right: 3px;
287 }
288 #custom-keymap {
289 margin-left: 3px;
290 margin-right: 3px;
291 }
292
293 #tray {
294 margin: 0;
295 }
296 #battery, #idle_inhibitor, #backlight, #wireplumber, #custom-mako {
297 color: @grey;
298 margin: 0 5px 0 2px;
299 }
300 #idle_inhibitor {
301 margin-right: 4px;
302 margin-left: 6px;
303 }
304 #custom-mako {
305 margin-right: 2px;
306 margin-left: 3px;
307 }
308 #battery {
309 margin-right: 3px;
310 }
311 #battery.discharging {
312 color: @white;
313 }
314 #battery.warning {
315 color: @orange;
316 }
317 #battery.critical {
318 color: @red;
319 }
320 #battery.charging {
321 color: @white;
322 }
323 #idle_inhibitor.activated {
324 color: @white;
325 }
326 #custom-worktime.running, #custom-worktime-today.running {
327 color: @white;
328 }
329 #custom-worktime.over, #custom-worktime-today.over {
330 color: @orange;
331 }
332
333 #idle_inhibitor {
334 padding-top: 1px;
335 }
336
337 #privacy {
338 color: @red;
339 margin: -1px 4px 0px 3px;
340 }
341 #clock {
342 /* margin-right: 5px; */
343 }
344 '';
345 };
346 };
347}