feat: improve niri+noctalia

This commit is contained in:
Leon Schwarzäugl 2026-03-05 23:12:30 +01:00
parent ec4e302f44
commit a0d3e701a5
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
8 changed files with 280 additions and 60 deletions

View file

@ -8,6 +8,7 @@
package = pkgs.niri-stable; # which package to use for niri validation
settings = {
gestures.hot-corners.enable = false;
hotkey-overlay.skip-at-startup = true;
debug = {
honor-xdg-activation-with-invalid-serial = [ ];
};
@ -105,17 +106,19 @@
};
binds = with config.lib.niri.actions; let
sh = spawn "sh" "-c";
resizer = "niri-resize & sleep 0.05";
in
{
"Mod+Shift+t".action = toggle-window-rule-opacity;
"Mod+m".action = focus-workspace-previous;
"Mod+Shift+Space".action = toggle-window-floating;
"Mod+Shift+f".action = fullscreen-window;
"Mod+q".action = sh "${resizer} && niri msg action close-window";
"Mod+f".action = sh "${resizer} && exec firefox";
# "Mod+q".action = sh "${resizer} && niri msg action close-window";
"Mod+q".action = sh "niri msg action close-window";
# "Mod+f".action = sh "${resizer} && exec firefox";
"Mod+f".action = sh "exec firefox";
# "Mod+Space".action = spawn "noctalia-shell" "ipc" "call" "launcher" "toggle";
"Mod+Space".action = sh "${resizer} && exec noctalia-shell ipc call launcher toggle";
# "Mod+Space".action = sh "${resizer} && exec noctalia-shell ipc call launcher toggle";
"Mod+Space".action = sh "exec noctalia-shell ipc call launcher toggle";
# "Mod+Space".action = sh "${resizer} & exec fuzzel";
"Mod+z".action = spawn "noctalia-shell" "ipc" "call" "bar" "toggle";
"Mod+Shift+c".action = spawn "qalculate-gtk";
@ -130,11 +133,16 @@
"Mod+Shift+s".action.screenshot-window = { write-to-disk = true; };
# "Mod+Shift+v".action = spawn "wf-recorder" "-g" "'$(slurp -f %o -or)'" "-f" "~/Videos/screenrecord_$(date +%Y-%m-%d-%H%M%S).mkv";
"Mod+e".action = sh "${resizer} && exec emacsclient -nquc -a emacs -e '(dashboard-open)'";
"Mod+c".action = sh "${resizer} && exec emacsclient -ce '(org-capture)'";
"Mod+t".action = sh "${resizer} && exec emacsclient -ce '(org-agenda)'";
"Mod+Shift+m".action = sh "${resizer} && exec emacsclient -ce '(mu4e)'";
"Mod+Shift+a".action = sh "${resizer} && exec emacsclient -ce '(swarsel/open-calendar)'";
# "Mod+e".action = sh "${resizer} && exec emacsclient -nquc -a emacs -e '(dashboard-open)'";
"Mod+e".action = sh "exec emacsclient -nquc -a emacs -e '(dashboard-open)'";
# "Mod+c".action = sh "${resizer} && exec emacsclient -ce '(org-capture)'";
"Mod+c".action = sh "exec emacsclient -ce '(org-capture)'";
# "Mod+t".action = sh "${resizer} && exec emacsclient -ce '(org-agenda)'";
"Mod+t".action = sh "exec emacsclient -ce '(org-agenda)'";
# "Mod+Shift+m".action = sh "${resizer} && exec emacsclient -ce '(mu4e)'";
"Mod+Shift+m".action = sh "exec emacsclient -ce '(mu4e)'";
# "Mod+Shift+a".action = sh "${resizer} && exec emacsclient -ce '(swarsel/open-calendar)'";
"Mod+Shift+a".action = sh "exec emacsclient -ce '(swarsel/open-calendar)'";
"Mod+a".action = spawn "swarselcheck-niri" "-s";
"Mod+x".action = spawn "swarselcheck-niri" "-k";
@ -159,7 +167,8 @@
# "Mod+Shift+e".action = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
# "Mod+r".action = "mode resize";
# "Mod+Return".action = "exec kitty";
"Mod+Return".action = sh "${resizer} && exec kitty -o confirm_os_window_close=0";
# "Mod+Return".action = sh "${resizer} && exec kitty -o confirm_os_window_close=0";
"Mod+Return".action = sh "exec kitty -o confirm_os_window_close=0";
"XF86AudioRaiseVolume".action = spawn "noctalia-shell" "ipc" "call" "volume" "increase";
"XF86AudioLowerVolume".action = spawn "noctalia-shell" "ipc" "call" "volume" "decrease";
"XF86AudioMute".action = spawn "noctalia-shell" "ipc" "call" "volume" "muteOutput";
@ -205,7 +214,7 @@
# { command = [ "niri" "msg" "action" "focus-workspace" "2" ]; }
# { command = [ "noctalia-shell" ]; }
# { argv = [ "pkill" "mako" ]; }
{ argv = [ "systemctl" "--user" "restart" "noctalia-shell.target" "tray.target" ]; }
{ argv = [ "systemctl" "--user" "restart" "noctalia-shell.target" ]; }
];
# workspaces = {
# "01-Main" = {
@ -218,5 +227,33 @@
};
};
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
config.niri = {
default = [
"gtk"
"gnome"
];
"org.freedesktop.impl.portal.Access" = [ "gtk" ];
"org.freedesktop.impl.portal.Notification" = [ "gtk" ];
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
"org.freedesktop.impl.portal.FileChooser" = [ "gtk" ];
"org.freedesktop.impl.portal.ScreenCast" = [ "xdg-desktop-portal-gnome" ];
"org.freedesktop.impl.portal.Screenshot" = [ "xdg-desktop-portal-gnome" ];
};
extraPortals = [
pkgs.gnome-keyring
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-gnome
];
};
swarselmodules.gnome-keyring = lib.swarselsystems.mkStrong true;
home.packages = [
pkgs.nirius
];
};
}

View file

@ -1,8 +1,13 @@
{ self, inputs, config, pkgs, lib, confLib, ... }:
{ self, inputs, config, pkgs, lib, confLib, type, ... }:
let
inherit (confLib.getConfig.repo.secrets.common) caldavTasksEndpoint;
inherit (config.swarselsystems) xdgDir;
in
{
imports = [
inputs.noctalia.homeModules.default
];
options.swarselmodules.optional-noctalia = lib.swarselsystems.mkTrueOption;
config = {
systemd.user = {
targets = {
@ -11,24 +16,35 @@
};
tray = {
Unit = {
After = [ "noctalia-init.service" ];
PartOf = [ "noctalia-shell.service" ];
Wants = [ "noctalia-init.service" ];
After = [
"noctalia-shell.service"
"noctalia-init.service"
];
};
Install.WantedBy = [ "noctalia-shell.target" ];
};
};
services = {
noctalia-shell = confLib.overrideTarget "noctalia-shell.target";
noctalia-shell = {
Unit.PartOf = [ "noctalia-shell.target" ];
Install.WantedBy = [ "noctalia-shell.target" ];
};
noctalia-init = {
Unit = {
Requires = [ "noctalia-shell.service" ];
After = [ "noctalia-shell.service" ];
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.coreutils}/bin/sleep 15";
ExecStart = "${pkgs.coreutils}/bin/sleep 3";
RemainAfterExit = true;
};
Install = {
WantedBy = [ "noctalia-shell.target" ];
WantedBy = [ "tray.target" ];
};
};
};
@ -38,7 +54,7 @@
fastfetch.enable = true;
noctalia-shell = {
enable = true;
package = pkgs.noctalia-shell.override { calendarSupport = true; };
package = pkgs.noctalia-shell;
systemd.enable = true;
settings = {
bar = {
@ -58,7 +74,7 @@
frameRadius = 12;
outerCorners = false;
hideOnOverview = false;
displayMode = "auto_hide";
displayMode = "non_exclusive";
autoHideDelay = 100;
autoShowDelay = 300;
screenOverrides = [ ];
@ -107,7 +123,7 @@
todos = [ ];
useCustomColors = false;
};
id = "plugin:todo";
id = "plugin:ba7043:todo";
}
];
center = [
@ -149,7 +165,7 @@
showUnreadBadge = true;
}
{
id = "plugin:ba7043:github-feed";
id = "plugin:github-feed";
}
{
id = "plugin:clipper";
@ -175,7 +191,7 @@
showPowerProfiles = true;
}
{
colorName = "primary";
iconColor = "none";
id = "SessionMenu";
}
{
@ -189,7 +205,7 @@
}
{
colorizeDistroLogo = false;
colorizeSystemIcon = "primary";
colorizeSystemIcon = "none";
customIconPath = "${self}/files/icons/swarsel.png";
enableColorization = true;
icon = "noctalia";
@ -322,9 +338,12 @@
viewMode = "list";
showCategories = false;
iconMode = "native";
density = "compact";
overviewLayer = false;
showIconBackground = false;
enableSettingsSearch = false;
enableWindowsSearch = false;
enableSessionSearch = false;
ignoreMouseInput = true;
screenshotAnnotationTool = "";
};
@ -434,36 +453,49 @@
command = "";
countdownEnabled = true;
enabled = true;
keybind = "L";
}
{
action = "suspend";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "S";
}
{
action = "hibernate";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "H";
}
{
action = "reboot";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "R";
}
{
action = "logout";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "U";
}
{
action = "shutdown";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "P";
}
{
action = "rebootToUefi";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "B";
}
];
};
@ -550,7 +582,7 @@
"unicode-picker"
"screen-recorder"
]) // {
github-feed = {
todo = {
enabled = true;
sourceUrl = "https://github.com/Swarsel/noctalia-plugins";
};
@ -561,6 +593,28 @@
enableTodoIntegration = false;
};
todo = {
caldavEnabled = true;
caldavUrl = caldavTasksEndpoint;
caldavUsername = config.swarselsystems.mainUser;
caldavPasswordType = "file";
caldavPasswordCmd = "";
caldavPasswordFile = confLib.getConfig.sops.secrets.radicale-token.path;
caldavSyncInterval = 300;
current_page_id = 1;
pages = [
{
id = 0;
name = "General";
}
{
id = 1;
name = "Work";
}
];
};
privacy-indicator = {
hideInactive = true;
iconSpacing = 4;
@ -598,8 +652,8 @@
# my fork:
showNotificationBadge = true;
colorizationEnabled = true;
colorizationIcon = "Primary";
colorizationBadge = "Tertiary";
colorizationIcon = "None";
colorizationBadge = "Primary";
colorizationBadgeText = "None";
defaultTab = 1;
enableSystemNotifications = true;
@ -615,5 +669,9 @@
};
};
};
} // lib.optionalAttrs (type != "nixos") {
sops.secrets = lib.mkIf (!config.swarselsystems.isPublic && !config.swarselsystems.isNixos) {
radicale-token = { path = "${xdgDir}/secrets/radicaleToken"; };
};
};
}

View file

@ -30,7 +30,7 @@
description = "Leon S";
password = lib.mkIf (minimal || config.swarselsystems.isPublic) "setup";
hashedPasswordFile = lib.mkIf (!minimal && !config.swarselsystems.isPublic) config.sops.secrets.main-user-hashed-pw.path;
extraGroups = [ "wheel" ] ++ lib.optionals (!minimal && !config.swarselsystems.isMicroVM) [ "networkmanager" "syncthing" "docker" "lp" "audio" "video" "vboxusers" "libvirtd" "scanner" ];
extraGroups = [ "wheel" ] ++ lib.optionals (!minimal && !config.swarselsystems.isMicroVM) [ "networkmanager" "input" "syncthing" "docker" "lp" "audio" "video" "vboxusers" "libvirtd" "scanner" ];
packages = with pkgs; [ ];
};
};

View file

@ -19,6 +19,7 @@
xwayland-satellite-unstable
];
services.niritiling.enable = true;
programs = {
niri = {

View file

@ -11,7 +11,16 @@
services = {
upower.enable = true; # needed for battery percentage
gnome.evolution-data-server.enable = true; # needed for calendar integration
noctoggle = {
enable = true;
# noctaliaPackage = pkgs.noctalia-shell;
};
};
programs = {
gpu-screen-recorder.enable = true;
evolution.enable = true;
};
programs.gpu-screen-recorder.enable = true;
};
}