making niri better

This commit is contained in:
Chris Cochrun 2025-09-02 15:27:55 -05:00
parent d6d16bfe7f
commit 8885ccc00e
3 changed files with 107 additions and 21 deletions

View file

@ -153,6 +153,7 @@
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
# hyprland.nixosModules.default # hyprland.nixosModules.default
# stylix.nixosModules.stylix # stylix.nixosModules.stylix
niri.nixosModules.niri
# nixos-cosmic.nixosModules.default # nixos-cosmic.nixosModules.default
nixos-hardware.nixosModules.common-gpu-amd nixos-hardware.nixosModules.common-gpu-amd
{ {

View file

@ -46,17 +46,17 @@ in {
enable = true; enable = true;
config = { config = {
common = { common = {
default = [ "hyprland" ]; default = [ "cosmic" ];
"org.freedesktop.impl.portal.FileChooser" = [ "kde" ]; "org.freedesktop.impl.portal.FileChooser" = [ "cosmic" ];
"org.freedesktop.impl.portal.OpenUri" = [ "kde" ]; "org.freedesktop.impl.portal.OpenUri" = [ "cosmic" ];
}; };
hyprland = { hyprland = {
default = [ "hyprland" ]; default = [ "hyprland" ];
"org.freedesktop.impl.portal.FileChooser" = [ "kde" ]; "org.freedesktop.impl.portal.FileChooser" = [ "cosmic" ];
"org.freedesktop.impl.portal.OpenUri" = [ "kde" ]; "org.freedesktop.impl.portal.OpenUri" = [ "cosmic" ];
}; };
}; };
extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde pkgs.xdg-desktop-portal-gtk ]; extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-cosmic ];
xdgOpenUsePortal = true; xdgOpenUsePortal = true;
}; };
mimeApps = { mimeApps = {
@ -1614,6 +1614,7 @@ in {
exec = "alacritty -e mpv --profile=slow %U"; exec = "alacritty -e mpv --profile=slow %U";
terminal = true; terminal = true;
categories = [ "Application" ]; categories = [ "Application" ];
noDisplay = true;
mimeType = [ mimeType = [
"audio/ogg" "audio/ogg"
"audio/mpeg" "audio/mpeg"
@ -1627,6 +1628,7 @@ in {
genericName = "Show images in current directory in IMV"; genericName = "Show images in current directory in IMV";
exec = "/home/chris/bin/rifle-imv %U"; exec = "/home/chris/bin/rifle-imv %U";
terminal = false; terminal = false;
noDisplay = true;
categories = [ "Application" ]; categories = [ "Application" ];
mimeType = [ "image/gif" "image/jpeg" "image/png" "image/heif" ]; mimeType = [ "image/gif" "image/jpeg" "image/png" "image/heif" ];
}; };

View file

@ -58,6 +58,35 @@ in
home.packages = with pkgs; [ home.packages = with pkgs; [
cosmic-extra-niri cosmic-extra-niri
]; ];
xdg.desktopEntries = {
cosmic-settings = {
name = "Cosmic Settings";
genericName = "Cosmic Settings App";
exec = "${pkgs.cosmic-settings}/bin/cosmic-settings";
terminal = false;
type = "Application";
categories = [ "Application" "Settings" "COSMIC" ];
icon = "com.system76.CosmicSettings";
};
cosmic-settings-power = {
name = "Cosmic Power Settings";
genericName = "Cosmic Power Settings App";
exec = "${pkgs.cosmic-settings}/bin/cosmic-settings power";
terminal = false;
type = "Application";
categories = [ "Application" "Settings" "COSMIC" ];
icon = "preferences-power-and-battery";
};
cosmic-settings-about = {
name = "Cosmic About Settings";
genericName = "Cosmic About Settings App";
exec = "${pkgs.cosmic-settings}/bin/cosmic-settings about";
terminal = false;
type = "Application";
categories = [ "Application" "Settings" "COSMIC" ];
icon = "preferences-about";
};
};
programs.niri = { programs.niri = {
# enable = true; # enable = true;
settings = { settings = {
@ -66,10 +95,12 @@ in
in { in {
"XF86AudioRaiseVolume".action.spawn = ["pamixer" "--allow-boost" "-i" "5"]; "XF86AudioRaiseVolume".action.spawn = ["pamixer" "--allow-boost" "-i" "5"];
"XF86AudioLowerVolume".action.spawn = ["pamixer" "--allow-boost" "-d" "5"]; "XF86AudioLowerVolume".action.spawn = ["pamixer" "--allow-boost" "-d" "5"];
"Super+E".action.spawn = ["${pkgs.nushell}/bin/nu" "/home/chris/nirilof emacs 'emacslient -c'"]; "Super+E".action.spawn = ["${pkgs.nushell}/bin/nu" "/home/chris/bin/nirilof" "emacs" "'emacslient -c'"];
"Super+Return".action.spawn = "alacritty"; "Super+Return".action.spawn = "alacritty";
"Super+B".action = spawn ["${pkgs.nushell}/bin/nu" "/home/chris/nirilof org.qutebrowser.qutebrowser qutebrowser"]; "Super+B".action = spawn ["${pkgs.nushell}/bin/nu" "/home/chris/bin/nirilof" "org.qutebrowser.qutebrowser" "qutebrowser"];
"Super+Space".action.spawn = "cosmic-launcher"; "Super+Space".action.spawn = "cosmic-launcher";
"Super+Alt+Space".action.spawn = ["rofi" "-no-lazy-grab" "-modi" "combi" "-show" "combi" "-combi-modi" "'drun,run'"];
# "Super+Space".action.spawn = "rofi -i -show window";
"Super+V".action= spawn ["${pkgs.fish}/bin/fish" "-c" "${pkgs.cliphist}/bin/cliphist list | ${pkgs.rofi-wayland}/bin/rofi -p '󱃔 ' -dmenu | ${pkgs.cliphist}/bin/cliphist decode | ${pkgs.wl-clipboard}/bin/wl-copy"]; "Super+V".action= spawn ["${pkgs.fish}/bin/fish" "-c" "${pkgs.cliphist}/bin/cliphist list | ${pkgs.rofi-wayland}/bin/rofi -p '󱃔 ' -dmenu | ${pkgs.cliphist}/bin/cliphist decode | ${pkgs.wl-clipboard}/bin/wl-copy"];
"Super+I".action.spawn = ["alacritty" "--class" "btm" "-e" "btm"]; "Super+I".action.spawn = ["alacritty" "--class" "btm" "-e" "btm"];
"Super+A".action.spawn = ["alacritty" "--class" "pulsemixer" "-e" "pulsemixer"]; "Super+A".action.spawn = ["alacritty" "--class" "pulsemixer" "-e" "pulsemixer"];
@ -80,11 +111,15 @@ in
"Super+C".action = close-window; "Super+C".action = close-window;
"Super+Shift+C".action = center-window; "Super+Shift+C".action = center-window;
"Super+P".action.spawn = "/home/chris/bin/rbw.sh"; "Super+P".action.spawn = "/home/chris/bin/rbw.sh";
"Super+Left".action = focus-column-left; "Super+Up".action = focus-window-or-monitor-up;
"Super+H".action = focus-column-left; "Super+K".action = focus-window-or-monitor-up;
"Super+Down".action = focus-window-or-monitor-down;
"Super+J".action = focus-window-or-monitor-down;
"Super+Left".action = focus-column-or-monitor-left;
"Super+H".action = focus-column-or-monitor-left;
"Super+Shift+H".action = move-column-left; "Super+Shift+H".action = move-column-left;
"Super+Right".action = focus-column-right; "Super+Right".action = focus-column-or-monitor-right;
"Super+L".action = focus-column-right; "Super+L".action = focus-column-or-monitor-right;
"Super+Shift+L".action = move-column-right; "Super+Shift+L".action = move-column-right;
"Super+Ctrl+L".action = set-column-width "+10%"; "Super+Ctrl+L".action = set-column-width "+10%";
"Super+Ctrl+H".action = set-column-width "-10%"; "Super+Ctrl+H".action = set-column-width "-10%";
@ -92,19 +127,26 @@ in
"Super+W".action = switch-preset-column-width; "Super+W".action = switch-preset-column-width;
"Super+Comma".action = consume-or-expel-window-left; "Super+Comma".action = consume-or-expel-window-left;
"Super+Period".action = consume-or-expel-window-right; "Super+Period".action = consume-or-expel-window-right;
"Super+Alt+L".action = focus-monitor-right;
"Super+Alt+H".action = focus-monitor-left;
}; };
spawn-at-startup = [ spawn-at-startup = [
{ argv = ["dbus-update-activation-environment --systemd --all"]; }
{ argv = ["${pkgs.xwayland-satellite}/bin/xwayland-satellite"]; } { argv = ["${pkgs.xwayland-satellite}/bin/xwayland-satellite"]; }
{ argv = ["waybar"]; } { argv = ["waybar"]; }
{ argv = ["cosmic-osd"]; } { argv = ["cosmic-osd"]; }
{ argv = ["kwalled6"]; } { argv = ["cosmic-idle"]; }
{ argv = ["cosmic-settings-daemon"]; }
{ argv = ["kwalletd6"]; }
{ argv = ["swww-daemon"]; } { argv = ["swww-daemon"]; }
{ argv = ["systemctl --user start jellyfin-mpv-shim"]; }
{ argv = ["systemctl --user start nextcloud-client"]; }
{ argv = ["systemctl --user start syncthingtray"]; }
{ argv = ["rbw-agent"]; } { argv = ["rbw-agent"]; }
{ argv = ["/usr/lib/kdeconnectd"]; } { argv = ["/usr/lib/kdeconnectd"]; }
{ argv = ["kdeconnect-indicator"]; } { argv = ["kdeconnect-indicator"]; }
{ argv = ["wl-paste --watch cliphist store"]; } { argv = ["wl-paste --watch cliphist store"]; }
{ argv = ["swww img /home/chris/pics/wallpapers/tech.jpg --resize crop -t grow --transition-bezier .14,0,.14,.99"]; } { argv = ["swww img /home/chris/pics/wallpapers/tech.jpg --resize crop -t grow --transition-bezier .14,0,.14,.99"]; }
{ argv = ["dbus-update-activation-environment --systemd --all"]; }
]; ];
workspaces = { workspaces = {
"main" = { "main" = {
@ -114,10 +156,10 @@ in
window-rules = [ window-rules = [
{ {
geometry-corner-radius = { geometry-corner-radius = {
top-left = 16.0; top-left = 14.0;
top-right = 16.0; top-right = 14.0;
bottom-left = 16.0; bottom-left = 14.0;
bottom-right = 16.0; bottom-right = 14.0;
}; };
clip-to-geometry = true; clip-to-geometry = true;
draw-border-with-background = false; draw-border-with-background = false;
@ -130,6 +172,11 @@ in
matches = [{app-id = "org.qutebrowser.qutebrowser";}]; matches = [{app-id = "org.qutebrowser.qutebrowser";}];
open-on-workspace = "main"; open-on-workspace = "main";
} }
{
matches = [{app-id = "mpv";}];
open-on-workspace = "main";
open-on-output = "DP-1";
}
{ {
matches = [{app-id = "com.system76.CosmicFiles";}]; matches = [{app-id = "com.system76.CosmicFiles";}];
open-floating = true; open-floating = true;
@ -147,6 +194,7 @@ in
]; ];
layout = { layout = {
center-focused-column = "never"; center-focused-column = "never";
always-center-single-column = true;
preset-column-widths = [ preset-column-widths = [
{ proportion = 1. / 3.; } { proportion = 1. / 3.; }
{ proportion = 1. / 2.; } { proportion = 1. / 2.; }
@ -186,15 +234,50 @@ in
theme = "phinger-cursors-light"; theme = "phinger-cursors-light";
}; };
outputs = { outputs = {
"eDP-1" = { "laptop" = {
enable = true; enable = true;
name = "A"; name = "eDP-1";
mode = { mode = {
height = 1504; height = 1504;
width = 2256; width = 2256;
refresh = 60.0; refresh = 60.0;
}; };
}; };
"desktop-center" = {
enable = true;
name = "DP-1";
scale = 1.5;
position.x = 1080;
position.y = 0;
mode = {
height = 2160;
width = 3640;
refresh = 60.0;
};
};
"desktop-right" = {
enable = true;
name = "DP-2";
position.x = 3640;
position.y = 0;
mode = {
height = 900;
width = 1600;
refresh = 59.94600;
};
};
"desktop-left" = {
enable = true;
name = "HDMI-A-1";
transform.rotation = 90;
position.x = 0;
position.y = 0;
mode = {
height = 1080;
width = 1920;
refresh = 60.0;
};
};
}; };
input = { input = {
mod-key = "Super"; mod-key = "Super";
@ -206,7 +289,7 @@ in
}; };
keyboard = { keyboard = {
repeat-delay = 180; repeat-delay = 180;
repeat-rate = 180; repeat-rate = 240;
}; };
warp-mouse-to-focus = { warp-mouse-to-focus = {
enable = true; enable = true;