From cf536b8ed2ca3a74f9ad5cd76a5393e71fc0513a Mon Sep 17 00:00:00 2001 From: sioodmy Date: Thu, 30 May 2024 10:38:45 +0200 Subject: [PATCH] feat: update niri config --- home/rice/foot.nix | 4 +--- home/rice/niri/binds.nix | 11 +++++++---- home/rice/niri/config.nix | 29 +++++++++++++++++++++++------ system/wayland/default.nix | 2 +- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/home/rice/foot.nix b/home/rice/foot.nix index 0d17be60..8096a867 100644 --- a/home/rice/foot.nix +++ b/home/rice/foot.nix @@ -16,13 +16,12 @@ title = "foot"; locked-title = "no"; term = "xterm-256color"; - font = "monospace:size=10.5"; + font = "monospace:size=9"; vertical-letter-offset = "-0.75"; pad = "12x21 center"; resize-delay-ms = 100; notify = "notify-send -a \${app-id} -i \${app-id} \${title} \${body}"; selection-target = "primary"; - # box-drawings-uses-font-glyphs = "yes"; dpi-aware = "yes"; bold-text-in-bright = "no"; word-delimiters = ",│`|:\"'()[]{}<>"; @@ -89,7 +88,6 @@ select-extend-character-wise = "Control+BTN_RIGHT"; select-word = "BTN_LEFT-2"; select-word-whitespace = "Control+BTN_LEFT-2"; - #select-row = "BTN_LEFT-3"; }; }; }; diff --git a/home/rice/niri/binds.nix b/home/rice/niri/binds.nix index 8f99d14a..b2915683 100644 --- a/home/rice/niri/binds.nix +++ b/home/rice/niri/binds.nix @@ -3,18 +3,21 @@ pkgs, lib, ... -}: { +}: let + inherit (lib) getExe; +in{ programs.niri.settings.binds = with config.lib.niri.actions; let sh = spawn "sh" "-c"; + run = x: spawn "run-as-service" (builtins.toString (getExe x)); in { "Mod+Return" = { - action = spawn "${pkgs.foot}/bin/foot"; + action = run config.programs.foot.package; cooldown-ms = 500; }; - "Mod+Space".action = spawn "${pkgs.fuzzel}/bin/fuzzel"; + "Mod+Space".action = run config.programs.fuzzel.package; "Mod+V".action = sh "${pkgs.cliphist}/bin/cliphist list | fuzzel --dmenu | cliphist decode | wl-copy"; - "Mod+Shift+Period".action = spawn "emoji"; + "Mod+semicolon".action = spawn "emoji"; "Mod+Shift+L".action = sh "niri msg action power-off-monitors; gtklock"; "XF86AudioRaiseVolume".action = spawn "pamixer" "-i" "5"; diff --git a/home/rice/niri/config.nix b/home/rice/niri/config.nix index 4a7f60a5..9cff2449 100644 --- a/home/rice/niri/config.nix +++ b/home/rice/niri/config.nix @@ -1,9 +1,6 @@ -{ - theme, - ... -}: +{theme, pkgs, ...}: with theme.colors; { - imports = [ ./binds.nix ]; + imports = [./binds.nix]; programs.niri.settings = { spawn-at-startup = [ { @@ -12,6 +9,26 @@ with theme.colors; { "waybar" ]; } + { + command = [ + "${pkgs.dbus}/bin/dbus-update-activation-environment" + "--systemd" + "DISPLAY" + "WAYLAND_DISPLAY" + "SWAYSOCK" + "XDG_CURRENT_DESKTOP" + "XDG_SESSION_TYPE" + "NIXOS_OZONE_WL" + "XCURSOR_THEME" + "XCURSOR_SIZE" + "XDG_DATA_DIRS" + ]; + } + { + command = [ + "/usr/libexec/polkit-gnome-authentication-agent-1" + ]; + } ]; outputs."eDP-1".position = { x = 0; @@ -102,9 +119,9 @@ with theme.colors; { } ]; - prefer-no-csd = true; hotkey-overlay.skip-at-startup = true; screenshot-path = "~/pics/ss/ss%Y-%m-%d %H-%M-%S.png"; }; + } diff --git a/system/wayland/default.nix b/system/wayland/default.nix index 40687873..2062fe8e 100644 --- a/system/wayland/default.nix +++ b/system/wayland/default.nix @@ -17,7 +17,7 @@ DIRENV_LOG_FORMAT = ""; WLR_DRM_NO_ATOMIC = "1"; QT_AUTO_SCREEN_SCALE_FACTOR = "1"; - QT_QPA_PLATFORM = "wayland;xcb"; + QT_QPA_PLATFORM = "wayland"; DISABLE_QT_COMPAT = "0"; QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; MOZ_ENABLE_WAYLAND = "1";