summaryrefslogtreecommitdiff
path: root/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'accounts')
-rw-r--r--accounts/gkleen@sif/default.nix69
-rw-r--r--accounts/gkleen@sif/emacs.el2
-rw-r--r--accounts/gkleen@sif/niri/default.nix260
-rw-r--r--accounts/gkleen@sif/niri/mako.nix4
-rw-r--r--accounts/gkleen@sif/niri/waybar.nix21
-rw-r--r--accounts/gkleen@sif/systemd.nix2
-rw-r--r--accounts/gkleen@sif/utils/pdf2pdf.nix8
-rw-r--r--accounts/gkleen@sif/zshrc8
8 files changed, 240 insertions, 134 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index a0e9d6cf..64434bb8 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -72,7 +72,7 @@ in {
72 ./libvirt 72 ./libvirt
73 ./niri 73 ./niri
74 ./synadm 74 ./synadm
75 flakeInputs.nix-index-database.hmModules.nix-index 75 flakeInputs.nix-index-database.homeModules.nix-index
76 flakeInputs.impermanence.nixosModules.home-manager.impermanence 76 flakeInputs.impermanence.nixosModules.home-manager.impermanence
77 ]; 77 ];
78 78
@@ -172,6 +172,7 @@ in {
172 }; 172 };
173 }; 173 };
174 }; 174 };
175 chromium.enable = true;
175 176
176 zathura = { 177 zathura = {
177 enable = true; 178 enable = true;
@@ -233,6 +234,7 @@ in {
233 config.programs.ssh.package 234 config.programs.ssh.package
234 gnused 235 gnused
235 miniserve 236 miniserve
237 p7zip
236 ]; 238 ];
237 execer = with pkgs; [ 239 execer = with pkgs; [
238 "cannot:${lib.getExe' rpm "rpm2cpio"}" 240 "cannot:${lib.getExe' rpm "rpm2cpio"}"
@@ -245,6 +247,7 @@ in {
245 "cannot:${lib.getExe less}" 247 "cannot:${lib.getExe less}"
246 "cannot:${lib.getExe' config.systemd.package "systemctl"}" 248 "cannot:${lib.getExe' config.systemd.package "systemctl"}"
247 "cannot:${lib.getExe config.programs.ssh.package}" 249 "cannot:${lib.getExe config.programs.ssh.package}"
250 "cannot:${lib.getExe' p7zip "7z"}"
248 ]; 251 ];
249 wrapper = with pkgs; [ 252 wrapper = with pkgs; [
250 "${lib.getExe' magickWrapped "magick"}:${lib.getExe' imagemagick "magick"}" 253 "${lib.getExe' magickWrapped "magick"}:${lib.getExe' imagemagick "magick"}"
@@ -344,7 +347,7 @@ in {
344 font = "Fira Sans"; 347 font = "Fira Sans";
345 }; 348 };
346 colors = { 349 colors = {
347 background = "000000aa"; 350 background = "000000cc";
348 text = "cdd6f4ff"; 351 text = "cdd6f4ff";
349 match = "94e2d5ff"; 352 match = "94e2d5ff";
350 selection = "585b70ff"; 353 selection = "585b70ff";
@@ -509,15 +512,15 @@ in {
509 wrappedYTMDesktop libsForQt5.qt5ct playerctl evince papers 512 wrappedYTMDesktop libsForQt5.qt5ct playerctl evince papers
510 thunderbird zoom-us xdg-desktop-portal steam steam-run 513 thunderbird zoom-us xdg-desktop-portal steam steam-run
511 wireshark virt-manager rclone cached-nix-shell worktime 514 wireshark virt-manager rclone cached-nix-shell worktime
512 fira-code-symbols libreoffice xournalpp google-chrome 515 fira-code-symbols libreoffice xournalpp
513 nixos-shell virt-viewer freerdp gnome-icon-theme 516 nixos-shell virt-viewer freerdp gnome-icon-theme
514 paper-icon-theme sshpassSecret weechat element-desktop 517 paper-icon-theme sshpassSecret weechat element-desktop
515 sieve-connect gimp3 inkscape udiskie glab nitrokey-app 518 sieve-connect gimp3 inkscape udiskie glab nitrokey-app
516 pynitrokey gtklock wlrctl remmina openscad spice-record 519 pynitrokey gtklock wlrctl remmina openscad spice-record
517 libguestfs-with-appliance nerd-fonts.fira-mono 520 nerd-fonts.fira-mono
518 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts 521 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts
519 swtpm (hunspellWithDicts (with hunspellDicts; [en_GB-large de_DE])) 522 swtpm (hunspell.withDicts (dicts: with dicts; [en_GB-large de_DE]))
520 libation 523 libation libqalculate
521 ] ++ mapAttrsToList (_name: pkg: pkgs.callPackage pkg {}) (customUtils.nixImport { dir = ./utils; }); 524 ] ++ mapAttrsToList (_name: pkg: pkgs.callPackage pkg {}) (customUtils.nixImport { dir = ./utils; });
522 525
523 file = { 526 file = {
@@ -577,9 +580,17 @@ in {
577 General = { 580 General = {
578 dot_as_separator = 0; 581 dot_as_separator = 0;
579 }; 582 };
583 Mode = {
584 calculate_as_you_type = 1;
585 };
580 }; 586 };
581 }; 587 };
582 "emacs/init.el".source = ./emacs.el; 588 "emacs/init.el".source = pkgs.substitute {
589 src = ./emacs.el;
590 substitutions = [
591 "--subst-var-by" "ksshaskpass" (lib.getExe pkgs.kdePackages.ksshaskpass)
592 ];
593 };
583 "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = '' 594 "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = ''
584 [Unit] 595 [Unit]
585 After=graphical-session.target 596 After=graphical-session.target
@@ -686,11 +697,11 @@ in {
686 exec -- \ 697 exec -- \
687 ${lib.getExe' config.systemd.package "systemd-run"} --wait --user --slice-inherit \ 698 ${lib.getExe' config.systemd.package "systemd-run"} --wait --user --slice-inherit \
688 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \ 699 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \
689 --property 'Environment=DSCP=46' \ 700 -E DSCP=46 -E NIXOS_OZONE_WL \
690 -- ${lib.getExe pkgs.dscp} ${lib.getExe' pkgs.google-chrome "google-chrome-stable"} \ 701 -- ${lib.getExe pkgs.dscp} ${lib.getExe cfg.programs.chromium.package} \
691 --class=Rainbow \ 702 --class=Rainbow \
692 --kiosk "https://web.openrainbow.com" \ 703 --app="https://web.openrainbow.com" \
693 --user-data-dir=''${HOME}/.config/google-chrome-rainbow 704 --user-data-dir=''${HOME}/.config/chromium-rainbow
694 ''); 705 '');
695 icon = pkgs.fetchurl { 706 icon = pkgs.fetchurl {
696 url = "https://web.openrainbow.com/rb/2.139.17/assets/skins/rainbow/images/homepage/logo__rainbow.svg"; 707 url = "https://web.openrainbow.com/rb/2.139.17/assets/skins/rainbow/images/homepage/logo__rainbow.svg";
@@ -700,6 +711,42 @@ in {
700 StartupWMClass = "Rainbow"; 711 StartupWMClass = "Rainbow";
701 }; 712 };
702 }; 713 };
714 kimai = {
715 name = "Kimai";
716 exec = toString (pkgs.writeShellScript "kimai" ''
717 exec -- \
718 ${lib.getExe cfg.programs.chromium.package} \
719 --class=Kimai \
720 --app="https://kimai.yggdrasil.li" \
721 --user-data-dir=''${HOME}/.config/chromium-kimai
722 '');
723 icon = pkgs.fetchurl {
724 url = "https://www.kimai.org/images/kimai_logo.png";
725 hash = "sha256-lnlOttzR2SwXA70R+egJUkeKr4U5V0avqTk8uX4bqfs=";
726 };
727 settings = {
728 StartupWMClass = "Kimai";
729 StartupNotify = "true";
730 };
731 };
732 audiobookshelf = {
733 name = "Audiobookshelf";
734 exec = toString (pkgs.writeShellScript "audiobookshelf" ''
735 exec -- \
736 ${lib.getExe cfg.programs.chromium.package} \
737 --class=Audiobookshelf \
738 --app="https://audiobookshelf.yggdrasil.li" \
739 --user-data-dir=''${HOME}/.config/chromium-audiobookshelf
740 '');
741 icon = pkgs.fetchurl {
742 url = "https://www.audiobookshelf.org/Logo.png";
743 hash = "sha256-JGPk+WNT1C4DC4lSMb0K0YmAMT5LvmSOeO0QRzkc7Lk=";
744 };
745 settings = {
746 StartupWMClass = "Audiobookshelf";
747 StartupNotify = "true";
748 };
749 };
703 thunderbird-lmu = { 750 thunderbird-lmu = {
704 name = "Thunderbird (LMU)"; 751 name = "Thunderbird (LMU)";
705 exec = "thunderbird --name thunderbird -P lmu %U"; 752 exec = "thunderbird --name thunderbird -P lmu %U";
diff --git a/accounts/gkleen@sif/emacs.el b/accounts/gkleen@sif/emacs.el
index 563c5d0b..3beefba6 100644
--- a/accounts/gkleen@sif/emacs.el
+++ b/accounts/gkleen@sif/emacs.el
@@ -254,3 +254,5 @@ necessarily running."
254(bind-key "C-x C-m" #'move-file) 254(bind-key "C-x C-m" #'move-file)
255 255
256(let ((ssh_auth_sock (string-chop-newline (shell-command-to-string "gpgconf --list-dirs agent-ssh-socket")))) (setenv "SSH_AUTH_SOCK" ssh_auth_sock)) 256(let ((ssh_auth_sock (string-chop-newline (shell-command-to-string "gpgconf --list-dirs agent-ssh-socket")))) (setenv "SSH_AUTH_SOCK" ssh_auth_sock))
257(setenv "SSH_ASKPASS_REQUIRE" "prefer")
258(setenv "SSH_ASKPASS" "@ksshaskpass@")
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix
index b57e1cc0..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,124 +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 = "^firefox$"; }) 703 (sleaf "match" { app-id = "^firefox$"; })
687 (leaf "open-on-workspace" "web") 704 (sleaf "open-on-workspace" "web")
688 (leaf "open-maximized" true) 705 (sleaf "open-maximized" true)
689 ]) 706 ])
690 (plain "window-rule" [ 707 (plain "window-rule" [
691 (leaf "match" { app-id = "^mpv$"; }) 708 (sleaf "match" { app-id = "^mpv$"; })
692 (leaf "open-on-workspace" "vid") 709 (sleaf "open-on-workspace" "vid")
693 (plain "default-column-width" [(leaf "proportion" 1.)]) 710 (plain "default-column-width" [(sleaf "proportion" 1.)])
694 ]) 711 ])
695 (plain "window-rule" [ 712 (plain "window-rule" [
696 (leaf "match" { app-id = "^kitty-play$"; }) 713 (sleaf "match" { app-id = "^kitty-play$"; })
697 (leaf "open-on-workspace" "vid") 714 (sleaf "open-on-workspace" "vid")
698 (leaf "open-focused" false) 715 (sleaf "open-focused" false)
699 ]) 716 ])
700 (plain "window-rule" [ 717 (plain "window-rule" [
701 (leaf "match" { app-id = "^pdfpc$"; }) 718 (sleaf "match" { app-id = "^chrome-audiobookshelf\.yggdrasil\.li__-Default$"; })
702 (plain "default-column-width" [(leaf "proportion" 1.)]) 719 (sleaf "match" { app-id = "^YouTube Music Desktop App$"; })
720 (sleaf "open-on-workspace" "vid")
703 ]) 721 ])
704 (plain "window-rule" [ 722 (plain "window-rule" [
705 (leaf "match" { app-id = "^pdfpc$"; title = "^.*presentation.*$"; }) 723 (sleaf "match" { app-id = "^pdfpc$"; })
706 (plain "default-column-width" [(leaf "proportion" 1.)]) 724 (plain "default-column-width" [(sleaf "proportion" 1.)])
707 (leaf "open-fullscreen" true)
708 (leaf "open-on-workspace" "bmr")
709 (leaf "open-focused" false)
710 ]) 725 ])
711 (plain "window-rule" [ 726 (plain "window-rule" [
712 (map (leaf "match") [ 727 (sleaf "match" { app-id = "^pdfpc$"; title = "^.*presentation.*$"; })
728 (plain "default-column-width" [(sleaf "proportion" 1.)])
729 (sleaf "open-fullscreen" true)
730 (sleaf "open-on-workspace" "bmr")
731 (sleaf "open-focused" false)
732 ])
733 (plain "window-rule" (normalize-nodes [
734 (map (sleaf "match") [
713 { app-id = "^Gimp-"; title = "^Quit GIMP$"; } 735 { app-id = "^Gimp-"; title = "^Quit GIMP$"; }
714 { app-id = "^org\\.kde\\.polkit-kde-authentication-agent-1$"; } 736 { app-id = "^org\\.kde\\.polkit-kde-authentication-agent-1$"; }
715 { app-id = "^xdg-desktop-portal-gtk$"; } 737 { app-id = "^xdg-desktop-portal-gtk$"; }
716 ]) 738 ])
717 (leaf "open-floating" true) 739 (sleaf "open-floating" true)
718 ]) 740 ]))
719 (plain "window-rule" [ 741 (plain "window-rule" [
720 (leaf "match" { app-id = "^org\\.pwmt\\.zathura$"; }) 742 (sleaf "match" { app-id = "^org\\.pwmt\\.zathura$"; })
721 (leaf "match" { app-id = "^evince$"; }) 743 (sleaf "match" { app-id = "^evince$"; })
722 (leaf "match" { app-id = "^org\\.gnome\\.Papers$"; }) 744 (sleaf "match" { app-id = "^org\\.gnome\\.Papers$"; })
723 (leaf "default-column-display" "tabbed") 745 (sleaf "default-column-display" "tabbed")
724 ]) 746 ])
725 747
726 (plain "layer-rule" [ 748 (plain "layer-rule" [
727 (leaf "match" { namespace = "^notifications$"; }) 749 (sleaf "match" { namespace = "^notifications$"; })
728 (leaf "match" { namespace = "^waybar$"; }) 750 (sleaf "match" { namespace = "^waybar$"; })
729 (leaf "match" { namespace = "^launcher$"; }) 751 (sleaf "match" { namespace = "^launcher$"; })
730 (leaf "block-out-from" "screencast") 752 (sleaf "block-out-from" "screencast")
731 ]) 753 ])
732 754
733 (plain "binds" 755 (plain "binds"
734 (let 756 (let
735 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"]));
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 758 in
745 [ 759 normalize-nodes [
746 (lib.mapAttrsToList bind (with config.lib.niri.actions; { 760 (lib.mapAttrsToList bind (with config.lib.niri.actions; {
747 "Mod+Slash".action = show-hotkey-overlay; 761 "Mod+Slash".action = show-hotkey-overlay;
748 762
@@ -797,12 +811,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) 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)
798 $FOUND || echo 812 $FOUND || echo
799 } 813 }
800 FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> ") || exit $? 814 FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> " --width=60) || exit $?
801 if [[ "$FUZZEL_RES" =~ .*\ =\ .* ]]; then 815 if [[ "$FUZZEL_RES" =~ .*\ =\ .* ]]; then
802 QALC_RES="$FUZZEL_RES" 816 QALC_RES="$FUZZEL_RES"
803 QALC_RET=0 817 QALC_RET=0
804 else 818 else
805 QALC_RES=$(qalc "$FUZZEL_RES" 2>&1) 819 QALC_RES=$(qalc -set "autocalc off" "$FUZZEL_RES" 2>&1)
806 QALC_RET=$? 820 QALC_RET=$?
807 fi 821 fi
808 [[ -n "$QALC_RES" ]] || exit 1 822 [[ -n "$QALC_RES" ]] || exit 1
@@ -822,11 +836,26 @@ in {
822 notify-send "$QALC_RES" 836 notify-send "$QALC_RES"
823 ''; 837 '';
824 })); 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");
825 "Mod+E".action = spawn (lib.getExe (pkgs.writeShellApplication { 854 "Mod+E".action = spawn (lib.getExe (pkgs.writeShellApplication {
826 name = "emoji-fuzzel"; 855 name = "emoji-fuzzel";
827 runtimeInputs = with pkgs; [ config.programs.fuzzel.package wtype wl-clipboard-rs ]; 856 runtimeInputs = with pkgs; [ config.programs.fuzzel.package wtype wl-clipboard-rs ];
828 text = '' 857 text = ''
829 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 $?
830 [[ -n "$FUZZEL_RES" ]] || exit 1 859 [[ -n "$FUZZEL_RES" ]] || exit 1
831 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
832 ''; 861 '';
@@ -967,6 +996,9 @@ in {
967 996
968 "Mod+D".action = with-urgent-window-action "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}"; 997 "Mod+D".action = with-urgent-window-action "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}";
969 "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");
970 })) 1002 }))
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) 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)
972 (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 {
diff --git a/accounts/gkleen@sif/niri/waybar.nix b/accounts/gkleen@sif/niri/waybar.nix
index cc131c08..c02a9a76 100644
--- a/accounts/gkleen@sif/niri/waybar.nix
+++ b/accounts/gkleen@sif/niri/waybar.nix
@@ -27,8 +27,14 @@ in {
27 modules-right = [ "custom/worktime" "custom/worktime-today" 27 modules-right = [ "custom/worktime" "custom/worktime-today"
28 "custom/weather" 28 "custom/weather"
29 "custom/keymap" 29 "custom/keymap"
30 "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "custom/mako" "clock" ]; 30 "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "custom/mako" "custom/lid_inhibitor" "clock" ];
31 31
32 "custom/lid_inhibitor" = {
33 format = "{}";
34 return-type = "json";
35 exec = lib.getExe pkgs.waybar-systemd-inhibit;
36 on-click = lib.getExe' pkgs.waybar-systemd-inhibit "waybar-systemd-inhibit-toggle";
37 };
32 "custom/mako" = { 38 "custom/mako" = {
33 format = "{}"; 39 format = "{}";
34 return-type = "json"; 40 return-type = "json";
@@ -211,7 +217,7 @@ in {
211 layer = "top"; 217 layer = "top";
212 position = "top"; 218 position = "top";
213 height = 14; 219 height = 14;
214 output = [ "!eDP-1" "!DP-2" "!DP-3" ]; 220 output = [ "!eDP-1" "!DP-2" "!DP-3" "*" ];
215 modules-left = [ "niri/workspaces" ]; 221 modules-left = [ "niri/workspaces" ];
216 modules-center = [ "niri/window" ]; 222 modules-center = [ "niri/window" ];
217 modules-right = [ "clock" ]; 223 modules-right = [ "clock" ];
@@ -293,7 +299,7 @@ in {
293 #tray { 299 #tray {
294 margin: 0; 300 margin: 0;
295 } 301 }
296 #battery, #idle_inhibitor, #backlight, #wireplumber, #custom-mako { 302 #battery, #idle_inhibitor, #backlight, #wireplumber, #custom-mako, #custom-lid_inhibitor {
297 color: @grey; 303 color: @grey;
298 margin: 0 5px 0 2px; 304 margin: 0 5px 0 2px;
299 } 305 }
@@ -302,7 +308,11 @@ in {
302 margin-left: 6px; 308 margin-left: 6px;
303 } 309 }
304 #custom-mako { 310 #custom-mako {
305 margin-right: 2px; 311 margin-right: 4px;
312 margin-left: 3px;
313 }
314 #custom-lid_inhibitor {
315 margin-right: 3px;
306 margin-left: 3px; 316 margin-left: 3px;
307 } 317 }
308 #battery { 318 #battery {
@@ -330,7 +340,7 @@ in {
330 color: @orange; 340 color: @orange;
331 } 341 }
332 342
333 #idle_inhibitor { 343 #idle_inhibitor, #custom-lid_inhibitor {
334 padding-top: 1px; 344 padding-top: 1px;
335 } 345 }
336 346
@@ -340,6 +350,7 @@ in {
340 } 350 }
341 #clock { 351 #clock {
342 /* margin-right: 5px; */ 352 /* margin-right: 5px; */
353 font-feature-settings: "tnum";
343 } 354 }
344 ''; 355 '';
345 }; 356 };
diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix
index 90cccc58..18c2315f 100644
--- a/accounts/gkleen@sif/systemd.nix
+++ b/accounts/gkleen@sif/systemd.nix
@@ -385,6 +385,8 @@ in {
385 }; 385 };
386 Service = { 386 Service = {
387 ExecStart = "${config.systemd.package}/lib/systemd/systemd-socket-proxyd --exit-idle-time=60s 127.0.0.1:${toString (port + 1)}"; 387 ExecStart = "${config.systemd.package}/lib/systemd/systemd-socket-proxyd --exit-idle-time=60s 127.0.0.1:${toString (port + 1)}";
388 Restart = "always";
389 RestartSec = "23s";
388 }; 390 };
389 }) [{ host = "proxy.ssh.math.lmu.de"; port = 8118; } { host = "proxy.vidhar"; port = 8120; } { host = "proxy.mathw0h"; port = 8122; } { host = "proxy.mathw0e"; port = 8124; }]); 391 }) [{ host = "proxy.ssh.math.lmu.de"; port = 8118; } { host = "proxy.vidhar"; port = 8120; } { host = "proxy.mathw0h"; port = 8122; } { host = "proxy.mathw0e"; port = 8124; }]);
390 sockets = listToAttrs (map (port: nameValuePair "proxy-to-autossh-socks@${toString port}" { 392 sockets = listToAttrs (map (port: nameValuePair "proxy-to-autossh-socks@${toString port}" {
diff --git a/accounts/gkleen@sif/utils/pdf2pdf.nix b/accounts/gkleen@sif/utils/pdf2pdf.nix
new file mode 100644
index 00000000..9f4cbc3e
--- /dev/null
+++ b/accounts/gkleen@sif/utils/pdf2pdf.nix
@@ -0,0 +1,8 @@
1pkgs@{ lib, resholve, zsh, ghostscript_headless, ... }:
2
3resholve.writeScriptBin "pdf2pdf" {
4 inputs = with pkgs; [ghostscript_headless];
5 interpreter = lib.getExe zsh;
6} ''
7 exec gs -dPDFSETTINGS=/prepress -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER -dPreserveAnnots=false "-sOutputFile=''${2}" "''${1}"
8''
diff --git a/accounts/gkleen@sif/zshrc b/accounts/gkleen@sif/zshrc
index abc200c6..702990c3 100644
--- a/accounts/gkleen@sif/zshrc
+++ b/accounts/gkleen@sif/zshrc
@@ -93,7 +93,7 @@ dir() {
93 if [[ $curlArchive = "true" ]]; then 93 if [[ $curlArchive = "true" ]]; then
94 archiveFile=$(mktemp -t "archive.XXXXXXXXXX.${templateArchive:t}") 94 archiveFile=$(mktemp -t "archive.XXXXXXXXXX.${templateArchive:t}")
95 95
96 curl -L -o ${archiveFile} ${templateArchive} 96 curl -SfL -o ${archiveFile} ${templateArchive}
97 97
98 templateArchive=${archiveFile} 98 templateArchive=${archiveFile}
99 fi 99 fi
@@ -132,6 +132,10 @@ dir() {
132 unpack=false 132 unpack=false
133 fi 133 fi
134 ;; 134 ;;
135 application/x-iso9660-image)
136 7z x ${templateArchive}
137 unpack=false
138 ;;
135 *) 139 *)
136 tar -xvaf ${templateArchive} 140 tar -xvaf ${templateArchive}
137 unpack=false 141 unpack=false
@@ -231,7 +235,7 @@ clock() {
231} 235}
232 236
233public-ip() { 237public-ip() {
234 curl -s -H 'Accept: application/json' $@ ifconfig.co | jq -r '.ip' 238 curl -sSf -H 'Accept: application/json' $@ ifconfig.co | jq -r '.ip'
235} 239}
236 240
237swap() { 241swap() {