use niri-flake module to generate niri kdl config
This commit is contained in:
parent
03d5d219e8
commit
db447c785d
8 changed files with 1061 additions and 10 deletions
|
|
@ -5,6 +5,9 @@
|
|||
rootPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./niri.nix
|
||||
];
|
||||
youthlic = {
|
||||
xdg-dirs.enable = true;
|
||||
programs = let
|
||||
|
|
@ -46,7 +49,6 @@
|
|||
accounts.email.enable = true;
|
||||
programs = {
|
||||
openssh.enable = true;
|
||||
niri.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
20
home/david/configurations/Akun/niri.nix
Normal file
20
home/david/configurations/Akun/niri.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs.niri-flake.lib.kdl) node leaf plain flag;
|
||||
in {
|
||||
david.programs.niri = {
|
||||
enable = true;
|
||||
extraConfig = let
|
||||
output = node "output";
|
||||
in [
|
||||
(output "eDP-1" [
|
||||
(leaf "mode" "1920x1200@60.018")
|
||||
(leaf "scale" 1.0)
|
||||
(leaf "position" {
|
||||
x = 0;
|
||||
y = 0;
|
||||
})
|
||||
(leaf "transform" "normal")
|
||||
])
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -6,6 +6,9 @@
|
|||
unixName,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./niri.nix
|
||||
];
|
||||
youthlic = {
|
||||
xdg-dirs.enable = true;
|
||||
programs = let
|
||||
|
|
@ -49,7 +52,6 @@
|
|||
wallpaper.enable = true;
|
||||
accounts.email.enable = true;
|
||||
programs = {
|
||||
niri.enable = true;
|
||||
openssh.enable = true;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
57
home/david/configurations/Tytonidae/niri.nix
Normal file
57
home/david/configurations/Tytonidae/niri.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs.niri-flake.lib.kdl) node leaf plain flag;
|
||||
in {
|
||||
david.programs.niri = {
|
||||
enable = true;
|
||||
extraConfig = let
|
||||
output = node "output";
|
||||
in [
|
||||
(output "DP-1" [
|
||||
(leaf "mode" "2560x1440@169.900")
|
||||
(leaf "scale" 1.0)
|
||||
(leaf "position" {
|
||||
x = 0;
|
||||
y = 0;
|
||||
})
|
||||
(leaf "transform" "normal")
|
||||
])
|
||||
(output "eDP-1" [
|
||||
(leaf "mode" "2560x1440@165.003")
|
||||
(leaf "scale" 1.5)
|
||||
(leaf "position" {
|
||||
x = 2560;
|
||||
y = 0;
|
||||
})
|
||||
(leaf "transform" "normal")
|
||||
])
|
||||
];
|
||||
# settings = {
|
||||
# outputs = {
|
||||
# DP-1 = {
|
||||
# mode = {
|
||||
# width = 2560;
|
||||
# height = 1440;
|
||||
# refresh = 169.900;
|
||||
# };
|
||||
# scale = 1;
|
||||
# position = {
|
||||
# x = 0;
|
||||
# y = 0;
|
||||
# };
|
||||
# };
|
||||
# eDP-1 = {
|
||||
# mode = {
|
||||
# width = 2560;
|
||||
# height = 1440;
|
||||
# refresh = 165.003;
|
||||
# };
|
||||
# scale = 1.5;
|
||||
# position = {
|
||||
# x = 2560;
|
||||
# y = 0;
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
561
home/david/modules/programs/niri/config.nix
Normal file
561
home/david/modules/programs/niri/config.nix
Normal file
|
|
@ -0,0 +1,561 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
osConfig,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) getExe getExe';
|
||||
inherit
|
||||
(inputs.niri-flake.lib.kdl)
|
||||
# node with args, props and children
|
||||
# node:: \lambda name -> [argOrProp] -> [child] -> Output
|
||||
# arg: single value
|
||||
# prop: attr contains one or more key-value pair
|
||||
# children: node
|
||||
node
|
||||
# node without children
|
||||
# leaf:: \lambda name -> [argOrProp] -> Output
|
||||
leaf
|
||||
# node only name
|
||||
# flag:: \lambda name -> Output
|
||||
flag
|
||||
# node without args/props
|
||||
# plain:: \lambda name -> [child] -> Output
|
||||
plain
|
||||
;
|
||||
|
||||
DISPLAY = ":1";
|
||||
|
||||
bash = getExe config.programs.bash.package;
|
||||
swaylock = getExe config.programs.swaylock.package;
|
||||
fuzzel = getExe config.programs.fuzzel.package;
|
||||
waybar = getExe config.programs.waybar.package;
|
||||
swaync = getExe config.services.swaync.package;
|
||||
fcitx5 = getExe' osConfig.i18n.inputMethod.package "fcitx5";
|
||||
|
||||
polkit-kde-agent = getExe' pkgs.kdePackages.polkit-kde-agent-1 "polkit-kde-agent";
|
||||
wpctl = getExe' pkgs.wireplumber "wpctl";
|
||||
swaybg = getExe pkgs.swaybg;
|
||||
xwayland-satellite = getExe pkgs.xwayland-satellite;
|
||||
ghostty = getExe config.programs.ghostty.package;
|
||||
wl-paste = getExe' pkgs.wl-clipboard "wl-paste";
|
||||
wl-copy = getExe' pkgs.wl-clipboard "wl-copy";
|
||||
cliphist = getExe' pkgs.cliphist "cliphist";
|
||||
in
|
||||
(
|
||||
let
|
||||
spawn = leaf "spawn";
|
||||
in [
|
||||
(plain "binds" [
|
||||
(plain "Mod+V" [
|
||||
(spawn [bash "-c" "${cliphist} list | ${fuzzel} --dmenu | ${cliphist} decode | ${wl-copy}"])
|
||||
])
|
||||
(plain "Mod+Shift+P" [
|
||||
(spawn [swaylock "--screenshots" "--clock" "--indicator" "--indicator-radius" "100" "--indicator-thickness" "7" "--effect-blur" "7x5" "--effect-vignette" "0.5:0.5" "--grace" "2" "--fade-in" "0.5"])
|
||||
])
|
||||
(plain "Mod+Shift+Slash" [
|
||||
(flag "show-hotkey-overlay")
|
||||
])
|
||||
(plain "Mod+T" [
|
||||
(spawn [
|
||||
ghostty
|
||||
])
|
||||
])
|
||||
(plain "Mod+Shift+T" [
|
||||
(flag "toggle-column-tabbed-display")
|
||||
])
|
||||
(plain "Mod+Space" [
|
||||
(spawn fuzzel)
|
||||
])
|
||||
(node "XF86AudioRaiseVolume" {allow-when-locked = true;} [
|
||||
(spawn [wpctl "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"])
|
||||
])
|
||||
(node "XF86AudioLowerVolume" {allow-when-locked = true;} [
|
||||
(spawn [wpctl "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"])
|
||||
])
|
||||
(node "XF86AudioMute" {allow-when-locked = true;} [
|
||||
(spawn [wpctl "set-volume" "@DEFAULT_AUDIO_SINK@" "toggle"])
|
||||
])
|
||||
(node "XF86AudioMicMute" {allow-when-locked = true;} [
|
||||
(spawn [wpctl "set-volume" "@DEFAULT_AUDIO_SOURCE@" "toggle"])
|
||||
])
|
||||
(plain "Mod+Q" [
|
||||
(flag "close-window")
|
||||
])
|
||||
(node "Mod+O" {repeat = false;} [
|
||||
(flag "toggle-overview")
|
||||
])
|
||||
(plain "Mod+Left" [
|
||||
(flag "focus-column-left")
|
||||
])
|
||||
(plain "Mod+Down" [
|
||||
(flag "focus-window-down")
|
||||
])
|
||||
(plain "Mod+Up" [
|
||||
(flag "focus-window-up")
|
||||
])
|
||||
(plain "Mod+Right" [
|
||||
(flag "focus-column-right")
|
||||
])
|
||||
(plain "Mod+H" [
|
||||
(flag "focus-column-or-monitor-left")
|
||||
])
|
||||
(plain "Mod+J" [
|
||||
(flag "focus-window-or-workspace-down")
|
||||
])
|
||||
(plain "Mod+K" [
|
||||
(flag "focus-window-or-workspace-up")
|
||||
])
|
||||
(plain "Mod+L" [
|
||||
(flag "focus-column-or-monitor-right")
|
||||
])
|
||||
(plain "Mod+Shift+Left" [
|
||||
(flag "move-column-left")
|
||||
])
|
||||
(plain "Mod+Shift+Down" [
|
||||
(flag "move-window-down")
|
||||
])
|
||||
(plain "Mod+Shift+Up" [
|
||||
(flag "move-window-up")
|
||||
])
|
||||
(plain "Mod+Shift+Right" [
|
||||
(flag "move-column-right")
|
||||
])
|
||||
(plain "Mod+Shift+H" [
|
||||
(flag "move-column-left-or-to-monitor-left")
|
||||
])
|
||||
(plain "Mod+Shift+J" [
|
||||
(flag "move-window-down-or-to-workspace-down")
|
||||
])
|
||||
(plain "Mod+Shift+K" [
|
||||
(flag "move-window-up-or-to-workspace-up")
|
||||
])
|
||||
(plain "Mod+Shift+L" [
|
||||
(flag "move-column-right-or-to-monitor-right")
|
||||
])
|
||||
(plain "Mod+Home" [
|
||||
(flag "focus-column-first")
|
||||
])
|
||||
(plain "Mod+End" [
|
||||
(flag "focus-column-last")
|
||||
])
|
||||
(plain "Mod+Ctrl+Home" [
|
||||
(flag "move-column-to-first")
|
||||
])
|
||||
(plain "Mod+Ctrl+End" [
|
||||
(flag "move-column-to-last")
|
||||
])
|
||||
(plain "Mod+Ctrl+Left" [
|
||||
(flag "focus-monitor-left")
|
||||
])
|
||||
(plain "Mod+Ctrl+Down" [
|
||||
(flag "focus-monitor-down")
|
||||
])
|
||||
(plain "Mod+Ctrl+Up" [
|
||||
(flag "focus-monitor-up")
|
||||
])
|
||||
(plain "Mod+Ctrl+Right" [
|
||||
(flag "focus-monitor-right")
|
||||
])
|
||||
(plain "Mod+Ctrl+H" [
|
||||
(flag "focus-monitor-left")
|
||||
])
|
||||
(plain "Mod+Ctrl+J" [
|
||||
(flag "focus-monitor-down")
|
||||
])
|
||||
(plain "Mod+Ctrl+K" [
|
||||
(flag "focus-monitor-up")
|
||||
])
|
||||
(plain "Mod+Ctrl+L" [
|
||||
(flag "focus-monitor-right")
|
||||
])
|
||||
(plain "Mod+Shift+Ctrl+Left" [
|
||||
(flag "move-column-to-monitor-left")
|
||||
])
|
||||
(plain "Mod+Shift+Ctrl+Down" [
|
||||
(flag "move-column-to-monitor-down")
|
||||
])
|
||||
(plain "Mod+Shift+Ctrl+Up" [
|
||||
(flag "move-column-to-monitor-up")
|
||||
])
|
||||
(plain "Mod+Shift+Ctrl+Right" [
|
||||
(flag "move-column-to-monitor-right")
|
||||
])
|
||||
(plain "Mod+Shift+Ctrl+H" [
|
||||
(flag "move-column-to-monitor-left")
|
||||
])
|
||||
(plain "Mod+Shift+Ctrl+J" [
|
||||
(flag "move-column-to-monitor-down")
|
||||
])
|
||||
(plain "Mod+Shift+Ctrl+K" [
|
||||
(flag "move-column-to-monitor-up")
|
||||
])
|
||||
(plain "Mod+Shift+Ctrl+L" [
|
||||
(flag "move-column-to-monitor-right")
|
||||
])
|
||||
(plain "Mod+Page_Down" [
|
||||
(flag "focus-workspace-down")
|
||||
])
|
||||
(plain "Mod+Page_Up" [
|
||||
(flag "focus-workspace-up")
|
||||
])
|
||||
(plain "Mod+U" [
|
||||
(flag "focus-workspace-down")
|
||||
])
|
||||
(plain "Mod+I" [
|
||||
(flag "focus-workspace-up")
|
||||
])
|
||||
(plain "Mod+Shift+Page_Down" [
|
||||
(flag "move-column-to-workspace-down")
|
||||
])
|
||||
(plain "Mod+Shift+Page_Up" [
|
||||
(flag "move-column-to-workspace-up")
|
||||
])
|
||||
(plain "Mod+Shift+U" [
|
||||
(flag "move-column-to-workspace-down")
|
||||
])
|
||||
(plain "Mod+Shift+I" [
|
||||
(flag "move-column-to-workspace-up")
|
||||
])
|
||||
(plain "Mod+Ctrl+Page_Down" [
|
||||
(flag "move-workspace-down")
|
||||
])
|
||||
(plain "Mod+Ctrl+Page_Up" [
|
||||
(flag "move-workspace-up")
|
||||
])
|
||||
(plain "Mod+Ctrl+U" [
|
||||
(flag "move-workspace-down")
|
||||
])
|
||||
(plain "Mod+Ctrl+I" [
|
||||
(flag "move-workspace-up")
|
||||
])
|
||||
(node "Mod+Shift+WheelScrollDown" {cooldown-ms = 150;} [
|
||||
(flag "focus-workspace-down")
|
||||
])
|
||||
(node "Mod+Shift+WheelScrollUp" {cooldown-ms = 150;} [
|
||||
(flag "focus-workspace-up")
|
||||
])
|
||||
(plain "Mod+WheelScrollDown" [
|
||||
(flag "focus-column-right")
|
||||
])
|
||||
(plain "Mod+WheelScrollUp" [
|
||||
(flag "focus-column-left")
|
||||
])
|
||||
(plain "Mod+1" [
|
||||
(leaf "focus-workspace" 1)
|
||||
])
|
||||
(plain "Mod+2" [
|
||||
(leaf "focus-workspace" 2)
|
||||
])
|
||||
(plain "Mod+3" [
|
||||
(leaf "focus-workspace" 3)
|
||||
])
|
||||
(plain "Mod+4" [
|
||||
(leaf "focus-workspace" 4)
|
||||
])
|
||||
(plain "Mod+5" [
|
||||
(leaf "focus-workspace" 5)
|
||||
])
|
||||
(plain "Mod+6" [
|
||||
(leaf "focus-workspace" 6)
|
||||
])
|
||||
(plain "Mod+7" [
|
||||
(leaf "focus-workspace" 7)
|
||||
])
|
||||
(plain "Mod+8" [
|
||||
(leaf "focus-workspace" 8)
|
||||
])
|
||||
(plain "Mod+9" [
|
||||
(leaf "focus-workspace" 9)
|
||||
])
|
||||
(plain "Mod+Shift+1" [
|
||||
(leaf "move-column-to-workspace" 1)
|
||||
])
|
||||
(plain "Mod+Shift+2" [
|
||||
(leaf "move-column-to-workspace" 2)
|
||||
])
|
||||
(plain "Mod+Shift+3" [
|
||||
(leaf "move-column-to-workspace" 3)
|
||||
])
|
||||
(plain "Mod+Shift+4" [
|
||||
(leaf "move-column-to-workspace" 4)
|
||||
])
|
||||
(plain "Mod+Shift+5" [
|
||||
(leaf "move-column-to-workspace" 5)
|
||||
])
|
||||
(plain "Mod+Shift+6" [
|
||||
(leaf "move-column-to-workspace" 6)
|
||||
])
|
||||
(plain "Mod+Shift+7" [
|
||||
(leaf "move-column-to-workspace" 7)
|
||||
])
|
||||
(plain "Mod+Shift+8" [
|
||||
(leaf "move-column-to-workspace" 8)
|
||||
])
|
||||
(plain "Mod+Shift+9" [
|
||||
(leaf "move-column-to-workspace" 9)
|
||||
])
|
||||
(plain "Mod+F" [
|
||||
(flag "toggle-window-floating")
|
||||
])
|
||||
(plain "Mod+Shift+F" [
|
||||
(flag "toggle-windowed-fullscreen")
|
||||
])
|
||||
(plain "Mod+Tab" [
|
||||
(flag "focus-window-previous")
|
||||
])
|
||||
(plain "Mod+Shift+Tab" [
|
||||
(flag "switch-focus-between-floating-and-tiling")
|
||||
])
|
||||
(plain "Mod+BracketLeft" [
|
||||
(flag "consume-or-expel-window-left")
|
||||
])
|
||||
(plain "Mod+BracketRight" [
|
||||
(flag "consume-or-expel-window-right")
|
||||
])
|
||||
(plain "Mod+Comma" [
|
||||
(flag "consume-window-into-column")
|
||||
])
|
||||
(plain "Mod+Period" [
|
||||
(flag "expel-window-from-column")
|
||||
])
|
||||
(plain "Mod+R" [
|
||||
(flag "switch-preset-column-width")
|
||||
])
|
||||
(plain "Mod+Shift+R" [
|
||||
(flag "switch-preset-window-height")
|
||||
])
|
||||
(plain "Mod+Ctrl+R" [
|
||||
(flag "reset-window-height")
|
||||
])
|
||||
(plain "Mod+M" [
|
||||
(flag "maximize-column")
|
||||
])
|
||||
(plain "Mod+Shift+M" [
|
||||
(flag "fullscreen-window")
|
||||
])
|
||||
(plain "Mod+Z" [
|
||||
(flag "center-column")
|
||||
])
|
||||
(plain "Mod+Minus" [
|
||||
(leaf "set-column-width" "-10%")
|
||||
])
|
||||
(plain "Mod+Equal" [
|
||||
(leaf "set-column-width" "+10%")
|
||||
])
|
||||
(plain "Mod+Shift+Minus" [
|
||||
(leaf "set-window-height" "-10%")
|
||||
])
|
||||
(plain "Mod+Shift+Equal" [
|
||||
(leaf "set-window-height" "+10%")
|
||||
])
|
||||
(plain "Print" [
|
||||
(flag "screenshot")
|
||||
])
|
||||
(plain "Ctrl+Print" [
|
||||
(flag "screenshot-screen")
|
||||
])
|
||||
(plain "Alt+Print" [
|
||||
(flag "screenshot-window")
|
||||
])
|
||||
(plain "Mod+Shift+Q" [
|
||||
(flag "quit")
|
||||
])
|
||||
(plain "Mod+E" [
|
||||
(flag "expand-column-to-available-width")
|
||||
])
|
||||
(plain "Mod+Shift+S" [
|
||||
(flag "toggle-keyboard-shortcuts-inhibit")
|
||||
])
|
||||
(plain "Mod+Shift+C" [
|
||||
(flag "set-dynamic-cast-window")
|
||||
])
|
||||
(plain "Mod+Shift+Ctrl+C" [
|
||||
(flag "clear-dynamic-cast-target")
|
||||
])
|
||||
])
|
||||
] # binds
|
||||
)
|
||||
++ (
|
||||
let
|
||||
spawn-at-startup = leaf "spawn-at-startup";
|
||||
in [
|
||||
(leaf "screenshot-path" "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%d_%H:%M:%S.png")
|
||||
(plain "hotkey-overlay" [
|
||||
(flag "skip-at-startup")
|
||||
])
|
||||
(flag "prefer-no-csd")
|
||||
(spawn-at-startup [waybar])
|
||||
(spawn-at-startup [swaync])
|
||||
(spawn-at-startup [swaybg "-i" "${config.home.homeDirectory}/wallpaper/01.png"])
|
||||
(spawn-at-startup [fcitx5 "-d" "--replace"])
|
||||
(spawn-at-startup [xwayland-satellite DISPLAY])
|
||||
(spawn-at-startup [polkit-kde-agent])
|
||||
(spawn-at-startup [wl-paste "--watch" cliphist "store"])
|
||||
(plain "input" [
|
||||
(plain "touchpad" [
|
||||
(leaf "click-method" "clickfinger")
|
||||
(flag "dwt")
|
||||
(leaf "scroll-method" "two-finger")
|
||||
(leaf "tap-button-map" "left-right-middle")
|
||||
])
|
||||
])
|
||||
(plain "cursor" [
|
||||
(leaf "hide-after-inactive-ms" 3000)
|
||||
(flag "hide-when-typing")
|
||||
])
|
||||
(plain "layout" [
|
||||
(plain "border" [
|
||||
(leaf "width" 4)
|
||||
(leaf "active-color" "#7fc8ff")
|
||||
(leaf "inactive-color" "#505050")
|
||||
])
|
||||
(plain "focus-ring" [
|
||||
(flag "off")
|
||||
(leaf "width" 4)
|
||||
(leaf "active-color" "#7fc8ff")
|
||||
(leaf "inactive-color" "#505050")
|
||||
])
|
||||
(plain "tab-indicator" [
|
||||
(flag "hide-when-single-tab")
|
||||
])
|
||||
(plain "preset-column-widths" [
|
||||
(leaf "proportion" (1. / 4.))
|
||||
(leaf "proportion" (1. / 3.))
|
||||
(leaf "proportion" (1. / 2.))
|
||||
(leaf "proportion" (2. / 3.))
|
||||
(leaf "proportion" (3. / 4.))
|
||||
(leaf "proportion" (4. / 4.))
|
||||
])
|
||||
(flag "always-center-single-column")
|
||||
(leaf "center-focused-column" "never")
|
||||
(leaf "default-column-display" "tabbed")
|
||||
(plain "default-column-width" [
|
||||
(leaf "proportion" (1. / 2.))
|
||||
])
|
||||
(flag "empty-workspace-above-first")
|
||||
(leaf "gaps" 16)
|
||||
])
|
||||
(plain "animations" [
|
||||
(plain "window-close" [
|
||||
(leaf "spring" {
|
||||
damping-ratio = 1.0;
|
||||
stiffness = 800;
|
||||
epsilon = 0.0001;
|
||||
})
|
||||
])
|
||||
])
|
||||
(plain "environment" [
|
||||
(leaf "DISPLAY" DISPLAY)
|
||||
])
|
||||
] # others
|
||||
)
|
||||
++ (
|
||||
let
|
||||
window-rule = plain "window-rule";
|
||||
match = leaf "match";
|
||||
in [
|
||||
(window-rule [
|
||||
(leaf "draw-border-with-background" true)
|
||||
(leaf "geometry-corner-radius" 12.0)
|
||||
(leaf "clip-to-geometry" true)
|
||||
])
|
||||
(window-rule [
|
||||
(match {app-id = "^showmethekey-gtk$";})
|
||||
(leaf "geometry-corner-radius" 0.0)
|
||||
(leaf "clip-to-geometry" false)
|
||||
(leaf "open-floating" true)
|
||||
(leaf "open-focused" false)
|
||||
(plain "default-column-width" [
|
||||
(leaf "fixed" 300)
|
||||
])
|
||||
(plain "default-window-height" [
|
||||
(leaf "fixed" 70)
|
||||
])
|
||||
(leaf "draw-border-with-background" true)
|
||||
(leaf "default-floating-position" {
|
||||
relative-to = "bottom-right";
|
||||
x = 20;
|
||||
y = 20;
|
||||
})
|
||||
(plain "focus-ring" [
|
||||
(flag "off")
|
||||
])
|
||||
(plain "border" [
|
||||
(flag "off")
|
||||
])
|
||||
(plain "shadow" [
|
||||
(flag "off")
|
||||
])
|
||||
(leaf "baba-is-float" true)
|
||||
(leaf "tiled-state" false)
|
||||
])
|
||||
(window-rule [
|
||||
(match {app-id = "^org\\.keepassxc\\.KeePassXC$";})
|
||||
(match {app-id = "^org\\.gnome\\.World\\.Secrets$";})
|
||||
(leaf "block-out-from" "screen-capture")
|
||||
])
|
||||
(window-rule [
|
||||
(match {
|
||||
app-id = "^com\\.mitchellh\\.ghostty$";
|
||||
is-active = true;
|
||||
})
|
||||
(leaf "draw-border-with-background" false)
|
||||
])
|
||||
(window-rule [
|
||||
(match {
|
||||
app-id = "^com\\.mitchellh\\.ghostty$";
|
||||
is-active = false;
|
||||
})
|
||||
(leaf "opacity" 0.8)
|
||||
(leaf "draw-border-with-background" false)
|
||||
])
|
||||
(window-rule [
|
||||
(match {is-window-cast-target = true;})
|
||||
(plain "focus-ring" [
|
||||
(leaf "active-color" "#f38ba8")
|
||||
(leaf "inactive-color" "#7d0d2d")
|
||||
])
|
||||
(plain "border" [
|
||||
(leaf "active-color" "#f38ba8")
|
||||
(leaf "inactive-color" "#7d0d2d")
|
||||
])
|
||||
(plain "tab-indicator" [
|
||||
(leaf "active-color" "#f38ba8")
|
||||
(leaf "inactive-color" "#7d0d2d")
|
||||
])
|
||||
(plain "shadow" [
|
||||
(flag "on")
|
||||
])
|
||||
])
|
||||
(window-rule [
|
||||
(match {
|
||||
app-id = "^org\\.telegram\\.desktop$";
|
||||
title = "Media viewer";
|
||||
})
|
||||
(leaf "open-floating" true)
|
||||
(leaf "open-fullscreen" false)
|
||||
])
|
||||
] # window-rule
|
||||
)
|
||||
++ (
|
||||
let
|
||||
layer-rule = plain "layer-rule";
|
||||
match = leaf "match";
|
||||
in [
|
||||
(layer-rule [
|
||||
(match {namespace = "^swaync-notification-window$";})
|
||||
(match {namespace = "^swaync-control-center$";})
|
||||
(leaf "block-out-from" "screen-capture")
|
||||
])
|
||||
(layer-rule [
|
||||
(match {namespace = "^launcher$";})
|
||||
(plain "shadow" [
|
||||
(flag "on")
|
||||
])
|
||||
(leaf "geometry-corner-radius" 10.0)
|
||||
])
|
||||
] # layer-rule
|
||||
)
|
||||
|
|
@ -1,19 +1,25 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
} @ args: let
|
||||
cfg = config.david.programs.niri;
|
||||
in {
|
||||
options = {
|
||||
david.programs.niri = {
|
||||
enable = lib.mkEnableOption "niri";
|
||||
extraConfig = lib.mkOption {
|
||||
type = inputs.niri-flake.lib.kdl.types.kdl-document;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
youthlic.programs.niri = {
|
||||
enable = true;
|
||||
config = ./config.kdl;
|
||||
# settings = lib.mkMerge [(import ./settings.nix args) cfg.settings];
|
||||
config = (lib.toList (import ./config.nix args)) ++ (lib.toList cfg.extraConfig);
|
||||
};
|
||||
david.programs.wluma.enable = true;
|
||||
};
|
||||
|
|
|
|||
402
home/david/modules/programs/niri/settings.nix
Normal file
402
home/david/modules/programs/niri/settings.nix
Normal file
|
|
@ -0,0 +1,402 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) getExe getExe';
|
||||
DISPLAY = ":1";
|
||||
bash = getExe pkgs.bash;
|
||||
swaylock = getExe pkgs.swaylock-effects;
|
||||
fuzzel = getExe pkgs.fuzzel;
|
||||
wpctl = getExe' pkgs.wireplumber "wpctl";
|
||||
waybar = getExe pkgs.waybar;
|
||||
swaync = getExe pkgs.swaynotificationcenter;
|
||||
swaybg = getExe pkgs.swaybg;
|
||||
fcitx5 = getExe' osConfig.i18n.inputMethod.package "fcitx5";
|
||||
xwayland-satellite = getExe pkgs.xwayland-satellite;
|
||||
polkit-kde-agent = getExe' pkgs.kdePackages.polkit-kde-agent-1 "polkit-kde-agent";
|
||||
wl-paste = getExe' pkgs.wl-clipboard "wl-paste";
|
||||
wl-copy = getExe' pkgs.wl-clipboard "wl-copy";
|
||||
cliphist = getExe' pkgs.cliphist "cliphist";
|
||||
ghostty = getExe pkgs.ghostty;
|
||||
in {
|
||||
binds = let
|
||||
inherit (config.lib.niri.actions) spawn show-hotkey-overlay toggle-column-tabbed-display close-window toggle-overview focus-column-left focus-window-down focus-window-up focus-column-right focus-column-or-monitor-left focus-window-or-workspace-down focus-window-or-workspace-up focus-column-or-monitor-right move-column-left move-window-down move-window-up move-column-right move-column-left-or-to-monitor-left move-window-down-or-to-workspace-down move-window-up-or-to-workspace-up move-column-right-or-to-monitor-right focus-column-first focus-column-last move-column-to-first move-column-to-last focus-monitor-left focus-monitor-down focus-monitor-up focus-monitor-right move-column-to-monitor-left move-column-to-monitor-down move-column-to-monitor-up move-column-to-monitor-right focus-workspace-up focus-workspace-down move-column-to-workspace-down move-column-to-workspace-up move-workspace-down move-workspace-up focus-workspace move-column-to-workspace toggle-window-floating toggle-windowed-fullscreen focus-window-previous switch-focus-between-floating-and-tiling consume-or-expel-window-left consume-or-expel-window-right consume-window-into-column expel-window-from-column switch-preset-column-width switch-preset-window-height reset-window-height maximize-column fullscreen-window center-column set-column-width set-window-height screenshot screenshot-window quit expand-column-to-available-width toggle-keyboard-shortcuts-inhibit set-dynamic-cast-window clear-dynamic-cast-target;
|
||||
in {
|
||||
"Mod+V".action = spawn bash "-c" "${cliphist} list | ${fuzzel} --dmenu | ${cliphist} decode | ${wl-copy}";
|
||||
"Mod+Shift+P".action = spawn swaylock "--screenshots" "--clock" "--indicator" "--indicator-radius" "100" "--indicator-thickness" "7" "--effect-blur" "7x5" "--effect-vignette" "0.5:0.5" "--grace" "2" "--fade-in" "0.5";
|
||||
"Mod+Shift+Slash".action = show-hotkey-overlay;
|
||||
"Mod+T".action = spawn ghostty;
|
||||
"Mod+Shift+T".action = toggle-column-tabbed-display;
|
||||
"Mod+Space".action = spawn fuzzel;
|
||||
XF86AudioRaiseVolume = {
|
||||
action = spawn wpctl "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
XF86AudioLowerVolume = {
|
||||
action = spawn wpctl "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
XF86AudioMute = {
|
||||
action = spawn wpctl "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
XF86AudioMicMute = {
|
||||
action = spawn wpctl "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"Mod+Q".action = close-window;
|
||||
"Mod+O".action = toggle-overview;
|
||||
"Mod+Left".action = focus-column-left;
|
||||
"Mod+Down".action = focus-window-down;
|
||||
"Mod+Up".action = focus-window-up;
|
||||
"Mod+Right".action = focus-column-right;
|
||||
"Mod+H".action = focus-column-or-monitor-left;
|
||||
"Mod+J".action = focus-window-or-workspace-down;
|
||||
"Mod+K".action = focus-window-or-workspace-up;
|
||||
"Mod+L".action = focus-column-or-monitor-right;
|
||||
"Mod+Shift+Left".action = move-column-left;
|
||||
"Mod+Shift+Down".action = move-window-down;
|
||||
"Mod+Shift+Up".action = move-window-up;
|
||||
"Mod+Shift+Right".action = move-column-right;
|
||||
"Mod+Shift+H".action = move-column-left-or-to-monitor-left;
|
||||
"Mod+Shift+J".action = move-window-down-or-to-workspace-down;
|
||||
"Mod+Shift+K".action = move-window-up-or-to-workspace-up;
|
||||
"Mod+Shift+L".action = move-column-right-or-to-monitor-right;
|
||||
"Mod+Home".action = focus-column-first;
|
||||
"Mod+End".action = focus-column-last;
|
||||
"Mod+Ctrl+Home".action = move-column-to-first;
|
||||
"Mod+Ctrl+End".action = move-column-to-last;
|
||||
"Mod+Ctrl+Left".action = focus-monitor-left;
|
||||
"Mod+Ctrl+Down".action = focus-monitor-down;
|
||||
"Mod+Ctrl+Up".action = focus-monitor-up;
|
||||
"Mod+Ctrl+Right".action = focus-monitor-right;
|
||||
"Mod+Ctrl+H".action = focus-monitor-left;
|
||||
"Mod+Ctrl+J".action = focus-monitor-down;
|
||||
"Mod+Ctrl+K".action = focus-monitor-up;
|
||||
"Mod+Ctrl+L".action = focus-monitor-right;
|
||||
"Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left;
|
||||
"Mod+Shift+Ctrl+Down".action = move-column-to-monitor-down;
|
||||
"Mod+Shift+Ctrl+Up".action = move-column-to-monitor-up;
|
||||
"Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right;
|
||||
"Mod+Shift+Ctrl+H".action = move-column-to-monitor-left;
|
||||
"Mod+Shift+Ctrl+J".action = move-column-to-monitor-down;
|
||||
"Mod+Shift+Ctrl+K".action = move-column-to-monitor-up;
|
||||
"Mod+Shift+Ctrl+L".action = move-column-to-monitor-right;
|
||||
"Mod+Page_Down".action = focus-workspace-down;
|
||||
"Mod+Page_Up".action = focus-workspace-up;
|
||||
"Mod+U".action = focus-workspace-down;
|
||||
"Mod+I".action = focus-workspace-up;
|
||||
"Mod+Shift+Page_Down".action = move-column-to-workspace-down;
|
||||
"Mod+Shift+Page_Up".action = move-column-to-workspace-up;
|
||||
"Mod+Shift+U".action = move-column-to-workspace-down;
|
||||
"Mod+Shift+I".action = move-column-to-workspace-up;
|
||||
"Mod+Ctrl+Page_Down".action = move-workspace-down;
|
||||
"Mod+Ctrl+Page_Up".action = move-workspace-up;
|
||||
"Mod+Ctrl+U".action = move-workspace-down;
|
||||
"Mod+Ctrl+I".action = move-workspace-up;
|
||||
"Mod+Shift+WheelScrollDown" = {
|
||||
action = focus-workspace-down;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+Shift+WheelScrollUp" = {
|
||||
action = focus-workspace-up;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+WheelScrollDown".action = focus-column-right;
|
||||
"Mod+WheelScrollUp".action = focus-column-left;
|
||||
"Mod+1".action = focus-workspace 1;
|
||||
"Mod+2".action = focus-workspace 2;
|
||||
"Mod+3".action = focus-workspace 3;
|
||||
"Mod+4".action = focus-workspace 4;
|
||||
"Mod+5".action = focus-workspace 5;
|
||||
"Mod+6".action = focus-workspace 6;
|
||||
"Mod+7".action = focus-workspace 7;
|
||||
"Mod+8".action = focus-workspace 8;
|
||||
"Mod+9".action = focus-workspace 9;
|
||||
"Mod+Shift+1".action = move-column-to-workspace 1;
|
||||
"Mod+Shift+2".action = move-column-to-workspace 2;
|
||||
"Mod+Shift+3".action = move-column-to-workspace 3;
|
||||
"Mod+Shift+4".action = move-column-to-workspace 4;
|
||||
"Mod+Shift+5".action = move-column-to-workspace 5;
|
||||
"Mod+Shift+6".action = move-column-to-workspace 6;
|
||||
"Mod+Shift+7".action = move-column-to-workspace 7;
|
||||
"Mod+Shift+8".action = move-column-to-workspace 8;
|
||||
"Mod+Shift+9".action = move-column-to-workspace 9;
|
||||
"Mod+F".action = toggle-window-floating;
|
||||
"Mod+Shift+F".action = toggle-windowed-fullscreen;
|
||||
"Mod+Tab".action = focus-window-previous;
|
||||
"Mod+Shift+Tab".action = switch-focus-between-floating-and-tiling;
|
||||
"Mod+BracketLeft".action = consume-or-expel-window-left;
|
||||
"Mod+BracketRight".action = consume-or-expel-window-right;
|
||||
"Mod+Comma".action = consume-window-into-column;
|
||||
"Mod+Period".action = expel-window-from-column;
|
||||
"Mod+R".action = switch-preset-column-width;
|
||||
"Mod+Shift+R".action = switch-preset-window-height;
|
||||
"Mod+Ctrl+R".action = reset-window-height;
|
||||
"Mod+M".action = maximize-column;
|
||||
"Mod+Shift+M".action = fullscreen-window;
|
||||
"Mod+Z".action = center-column;
|
||||
"Mod+Minus".action = set-column-width "-10%";
|
||||
"Mod+Equal".action = set-column-width "+10%";
|
||||
"Mod+Shift+Minus".action = set-window-height "-10%";
|
||||
"Mod+Shift+Equal".action = set-window-height "+10%";
|
||||
"Print".action = screenshot;
|
||||
# since niri add another parameter for the variant, the regex can not parse the action
|
||||
# [Track] https://github.com/sodiboo/niri-flake/issues/922
|
||||
"Ctrl+Print".action.screenshot-screen = [];
|
||||
"Alt+Print".action = screenshot-window;
|
||||
"Mod+Shift+Q".action = quit;
|
||||
"Mod+E".action = expand-column-to-available-width;
|
||||
"Mod+Shift+S".action = toggle-keyboard-shortcuts-inhibit;
|
||||
"Mod+Shift+C".action = set-dynamic-cast-window;
|
||||
"Mod+Shift+Ctrl+C".action = clear-dynamic-cast-target;
|
||||
};
|
||||
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%d_%H:%M:%S.png";
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
prefer-no-csd = true;
|
||||
spawn-at-startup = [
|
||||
{
|
||||
command = [waybar];
|
||||
}
|
||||
{
|
||||
command = [swaync];
|
||||
}
|
||||
{
|
||||
command = [swaybg "-i" "${config.home.homeDirectory}/wallpaper/01.png"];
|
||||
}
|
||||
{
|
||||
command = [fcitx5 "-d" "--replace"];
|
||||
}
|
||||
{
|
||||
command = [xwayland-satellite DISPLAY];
|
||||
}
|
||||
{
|
||||
command = [polkit-kde-agent];
|
||||
}
|
||||
{
|
||||
command = [wl-paste "--watch" cliphist "store"];
|
||||
}
|
||||
];
|
||||
input = {
|
||||
touchpad = {
|
||||
click-method = "clickfinger";
|
||||
dwt = true;
|
||||
scroll-method = "two-finger";
|
||||
tap-button-map = "left-right-middle";
|
||||
};
|
||||
warp-mouse-to-focus = true;
|
||||
};
|
||||
cursor = {
|
||||
hide-after-inactive-ms = 3000;
|
||||
hide-when-typing = true;
|
||||
};
|
||||
layout = {
|
||||
border = {
|
||||
enable = true;
|
||||
width = 4;
|
||||
active = {
|
||||
color = "#7fc8ff";
|
||||
};
|
||||
inactive = {
|
||||
color = "#505050";
|
||||
};
|
||||
};
|
||||
focus-ring = {
|
||||
enable = false;
|
||||
width = 4;
|
||||
active = {
|
||||
color = "#7fc8ff";
|
||||
};
|
||||
inactive = {
|
||||
color = "#505050";
|
||||
};
|
||||
};
|
||||
preset-column-widths = [
|
||||
{
|
||||
proportion = 1. / 4.;
|
||||
}
|
||||
{
|
||||
proportion = 1. / 3.;
|
||||
}
|
||||
{
|
||||
proportion = 1. / 2.;
|
||||
}
|
||||
{
|
||||
proportion = 2. / 3.;
|
||||
}
|
||||
{
|
||||
proportion = 3. / 4.;
|
||||
}
|
||||
{
|
||||
proportion = 4. / 4.;
|
||||
}
|
||||
];
|
||||
always-center-single-column = true;
|
||||
center-focused-column = "never";
|
||||
default-column-display = "tabbed";
|
||||
default-column-width = {
|
||||
proportion = 1. / 2.;
|
||||
};
|
||||
empty-workspace-above-first = true;
|
||||
gaps = 16;
|
||||
};
|
||||
animations = {
|
||||
enable = true;
|
||||
window-close = {
|
||||
spring = {
|
||||
damping-ratio = 1.0;
|
||||
stiffness = 800;
|
||||
epsilon = 0.0001;
|
||||
};
|
||||
};
|
||||
};
|
||||
environment = {
|
||||
inherit DISPLAY;
|
||||
};
|
||||
window-rules = [
|
||||
{
|
||||
draw-border-with-background = true;
|
||||
geometry-corner-radius = {
|
||||
bottom-left = 12.;
|
||||
bottom-right = 12.;
|
||||
top-left = 12.;
|
||||
top-right = 12.;
|
||||
};
|
||||
clip-to-geometry = true;
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
app-id = "^showmethekey-gtk$";
|
||||
}
|
||||
];
|
||||
geometry-corner-radius = {
|
||||
bottom-left = 0.0;
|
||||
bottom-right = 0.0;
|
||||
top-left = 0.0;
|
||||
top-right = 0.0;
|
||||
};
|
||||
clip-to-geometry = false;
|
||||
open-floating = true;
|
||||
open-focused = false;
|
||||
default-column-width = {
|
||||
fixed = 300;
|
||||
};
|
||||
default-window-height = {
|
||||
fixed = 70;
|
||||
};
|
||||
draw-border-with-background = false;
|
||||
default-floating-position = {
|
||||
relative-to = "bottom-right";
|
||||
x = 20;
|
||||
y = 20;
|
||||
};
|
||||
focus-ring.enable = false;
|
||||
border.enable = false;
|
||||
shadow.enable = false;
|
||||
baba-is-float = true;
|
||||
# tiled-state = false;
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
app-id = "^org\\.keepassxc\\.KeePassXC$";
|
||||
}
|
||||
{
|
||||
app-id = "^org\\.gnome\\.World\\.Secrets$";
|
||||
}
|
||||
];
|
||||
block-out-from = "screen-capture";
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
app-id = "^com\\.mitchellh\\.ghostty$";
|
||||
is-active = true;
|
||||
}
|
||||
];
|
||||
draw-border-with-background = false;
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
app-id = "^com\\.mitchellh\\.ghostty$";
|
||||
is-active = false;
|
||||
}
|
||||
];
|
||||
opacity = 0.8;
|
||||
draw-border-with-background = false;
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
is-window-cast-target = true;
|
||||
}
|
||||
];
|
||||
focus-ring = {
|
||||
active = {
|
||||
color = "#f38ba8";
|
||||
};
|
||||
inactive = {
|
||||
color = "#7d0d2d";
|
||||
};
|
||||
};
|
||||
border = {
|
||||
active = {
|
||||
color = "#f38ba8";
|
||||
};
|
||||
inactive = {
|
||||
color = "#7d0d2d";
|
||||
};
|
||||
};
|
||||
tab-indicator = {
|
||||
active = {
|
||||
color = "#f38ba8";
|
||||
};
|
||||
inactive = {
|
||||
color = "#7d0d2d";
|
||||
};
|
||||
};
|
||||
shadow.enable = true;
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
app-id = "^org\\.telegram\\.desktop$";
|
||||
title = "Media viewer";
|
||||
}
|
||||
];
|
||||
open-floating = true;
|
||||
}
|
||||
];
|
||||
layer-rules = [
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
namespace = "^swaync-notification-window$";
|
||||
}
|
||||
{
|
||||
namespace = "^swaync-control-center$";
|
||||
}
|
||||
];
|
||||
block-out-from = "screen-capture";
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
namespace = "^launcher$";
|
||||
}
|
||||
];
|
||||
shadow.enable = true;
|
||||
geometry-corner-radius = {
|
||||
top-left = 10.;
|
||||
top-right = 10.;
|
||||
bottom-left = 10.;
|
||||
bottom-right = 10.;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
config,
|
||||
lib,
|
||||
osConfig ? null,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.niri;
|
||||
|
|
@ -11,12 +12,11 @@ in {
|
|||
options = {
|
||||
youthlic.programs.niri = {
|
||||
enable = lib.mkEnableOption "niri";
|
||||
# settings = lib.mkOption {
|
||||
# type = lib.types.attrs;
|
||||
# };
|
||||
config = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
example = ./config.kdl;
|
||||
description = ''
|
||||
the pach to config.kdl
|
||||
'';
|
||||
type = inputs.niri-flake.lib.kdl.types.kdl-document;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -66,7 +66,8 @@ in {
|
|||
swaylock.enable = true;
|
||||
};
|
||||
programs.niri = {
|
||||
config = builtins.readFile cfg.config;
|
||||
# settings = cfg.settings;
|
||||
config = cfg.config;
|
||||
package = niri;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue