Compare commits

..

2 commits

5 changed files with 45 additions and 34 deletions

View file

@ -274,7 +274,7 @@ in
Unit.After = [ "graphical-session-pre.target" ]; Unit.After = [ "graphical-session-pre.target" ];
Unit.Before = [ "graphical-session.target" ]; Unit.Before = [ "graphical-session.target" ];
Unit.BindsTo = [ "graphical-session.target" ]; Unit.BindsTo = [ "graphical-session.target" ];
Install.WantedBy = [ "plasma-workspace.target" ]; Install.WantedBy = [ "graphical-session.target" ];
}; };
# XWayland target # XWayland target
xwayland = { xwayland = {
@ -282,7 +282,7 @@ in
Unit.After = [ "graphical-session-pre.target" ]; Unit.After = [ "graphical-session-pre.target" ];
Unit.Before = [ "graphical-session.target" ]; Unit.Before = [ "graphical-session.target" ];
Unit.BindsTo = [ "graphical-session.target" ]; Unit.BindsTo = [ "graphical-session.target" ];
Install.WantedBy = [ "plasma-workspace.target" ]; Install.WantedBy = [ "graphical-session.target" ];
}; };
}; };
}; };

View file

@ -10,7 +10,7 @@ let
wallpaper = config.linux.graphical.wallpaper; wallpaper = config.linux.graphical.wallpaper;
xwayland-display = ":12"; xwayland-display = ":0";
in in
{ {
@ -67,22 +67,12 @@ in
"10" = { name = "🎲 misc"; }; "10" = { name = "🎲 misc"; };
"99" = { name = "📧 Email"; }; "99" = { name = "📧 Email"; };
}; };
# systemd.user.services.niri = lib.mkIf cfg.enable { systemd.user.services.swaync.Install.WantedBy = [ "niri.service" ];
# Unit.Wants = [ "tray.target" "xwayland.target" ]; systemd.user.services.swaync.Unit.After = [ "niri.service" ];
# }; systemd.user.targets.tray.Unit.After = [ "niri.service" ];
systemd.user.services.niri = lib.mkIf cfg.enable { systemd.user.services.waybar.Unit.After = [ "niri.service" ];
Unit = { systemd.user.services.waybar.Install.WantedBy = [ "niri.service" ];
Description = "A scrollable-tiling Wayland compositor"; systemd.user.targets.xwayland.Unit.After = [ "niri.service" ];
BindsTo = [ "graphical-session.target" ];
Before = [ "graphical-session.target" "tray.target" "swaync.service" "xdg-desktop-autostart.target" ];
Wants = [ "graphical-session-pre.target" "swaync.service" "xdg-desktop-autostart.target" ];
After = [ "graphical-session-pre.target" ];
};
Service.Slice = "session.slice";
Service.Type = "notify";
Service.ExecStart = "${lib.getExe config.programs.niri.package} --session";
};
# xwayland-satellite # xwayland-satellite
systemd.user.services.niri-xwayland-satellite = lib.mkIf cfg.enable { systemd.user.services.niri-xwayland-satellite = lib.mkIf cfg.enable {
@ -92,8 +82,9 @@ in
Before = [ "xwayland.target" "xdg-desktop-autostart.target" ]; Before = [ "xwayland.target" "xdg-desktop-autostart.target" ];
After = [ "niri.service" ]; After = [ "niri.service" ];
}; };
Install.RequiredBy = [ "niri.service" ]; Install.UpheldBy = [ "niri.service" ];
Service.Slice = "session.slice"; Service.Slice = "session.slice";
Service.Type = "notify";
Service.ExecStart = "${lib.getExe pkgs.xwayland-satellite} ${xwayland-display}"; Service.ExecStart = "${lib.getExe pkgs.xwayland-satellite} ${xwayland-display}";
}; };
@ -143,8 +134,6 @@ in
{ command = [ (lib.getExe pkgs.swaybg) "-i" "${wallpaper}" "-m" "fill" ]; } { command = [ (lib.getExe pkgs.swaybg) "-i" "${wallpaper}" "-m" "fill" ]; }
# Waybar # Waybar
{ command = [ "systemctl" "--user" "start" "xdg-desktop-portal-gtk.service" "xdg-desktop-portal.service" ]; } { command = [ "systemctl" "--user" "start" "xdg-desktop-portal-gtk.service" "xdg-desktop-portal.service" ]; }
# Export XWayland DISPLAY
{ command = [ "sh" "-c" "systemctl --user set-environment DISPLAY=${xwayland-display} && systemctl --user start xwayland.target" ]; }
]; ];
layout = { layout = {
@ -227,6 +216,23 @@ in
]; ];
} }
# xwaylandvideobridge
{
matches = [{ app-id = "^xwaylandvideobridge$"; }];
open-floating = true;
focus-ring.enable = false;
opacity = 0.0;
default-floating-position = {
x = 0;
y = 0;
relative-to = "bottom-right";
};
min-width = 1;
max-width = 1;
min-height = 1;
max-height = 1;
}
# Kitty dimming # Kitty dimming
{ {
matches = [{ app-id = "kitty"; }]; matches = [{ app-id = "kitty"; }];

View file

@ -92,7 +92,9 @@ in
}; };
config.systemd.user.targets.sway-session = mkIf cfg.enable { config.systemd.user.targets.sway-session = mkIf cfg.enable {
Unit.Before = [ "tray.target" "xwayland.target" ]; Unit.Before = [ "tray.target" "xwayland.target" "xdg-desktop-portal.service" "xdg-desktop-autostart.target" ];
Unit.Upholds = [ "waybar.service" ];
Unit.Wants = [ "xdg-desktop-autostart.target" ];
}; };
# Enable waybar # Enable waybar
@ -113,10 +115,10 @@ in
] ++ lib.optionals osConfig.services.desktopManager.plasma6.enable [ ] ++ lib.optionals osConfig.services.desktopManager.plasma6.enable [
"XDG_MENU_PREFIX" "XDG_MENU_PREFIX"
]; ];
systemd.extraCommands = options.wayland.windowManager.sway.systemd.extraCommands.default # systemd.extraCommands = options.wayland.windowManager.sway.systemd.extraCommands.default
++ [ # ++ [
"systemctl --user restart xdg-desktop-portal.service" # "systemctl --user restart xdg-desktop-portal.service"
]; # ];
checkConfig = false; # Not working atm checkConfig = false; # Not working atm
config = { config = {
@ -145,10 +147,10 @@ in
menu = "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.bemenu}/bin/bemenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"; menu = "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.bemenu}/bin/bemenu | ${pkgs.findutils}/bin/xargs swaymsg exec --";
# Startup # Startup
startup = [ startup = [
# Dex for autostart # # Dex for autostart
{ command = "${pkgs.dex}/bin/dex -ae sway"; } # { command = "${pkgs.dex}/bin/dex -ae sway"; }
# Waybar # # Waybar
{ command = "systemctl --user restart waybar"; always = true; } # { command = "systemctl --user restart waybar"; always = true; }
# IME # IME
{ command = "fcitx5"; } { command = "fcitx5"; }
]; ];

View file

@ -43,8 +43,7 @@ in
}; };
}; };
config.systemd.user.services.waybar = lib.mkIf cfg.enable { config.systemd.user.services.waybar = lib.mkIf cfg.enable {
Unit.BindsTo = [ "tray.target" ]; Unit.Before = [ "tray.target" ];
Unit.After = [ "tray.target" ];
}; };
config.programs.waybar = config.programs.waybar =
let let
@ -260,7 +259,7 @@ in
lib.mkIf cfg.enable { lib.mkIf cfg.enable {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
systemd.target = "graphical-session.target"; systemd.target = "sway-session.target";
settings = cfg.makeBars barWith; settings = cfg.makeBars barWith;
style = '' style = ''
* { * {

View file

@ -46,6 +46,10 @@
tap = "enabled"; tap = "enabled";
}; };
}; };
programs.my-niri.enable = true;
programs.niri.settings = {
input.keyboard.xkb.options = "ctrl:swapcaps";
};
programs.my-waybar.extraSettings = programs.my-waybar.extraSettings =
let let
change-mode = pkgs.writeScript "change-mode" '' change-mode = pkgs.writeScript "change-mode" ''