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.Before = [ "graphical-session.target" ];
Unit.BindsTo = [ "graphical-session.target" ];
Install.WantedBy = [ "plasma-workspace.target" ];
Install.WantedBy = [ "graphical-session.target" ];
};
# XWayland target
xwayland = {
@ -282,7 +282,7 @@ in
Unit.After = [ "graphical-session-pre.target" ];
Unit.Before = [ "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;
xwayland-display = ":12";
xwayland-display = ":0";
in
{
@ -67,22 +67,12 @@ in
"10" = { name = "🎲 misc"; };
"99" = { name = "📧 Email"; };
};
# systemd.user.services.niri = lib.mkIf cfg.enable {
# Unit.Wants = [ "tray.target" "xwayland.target" ];
# };
systemd.user.services.niri = lib.mkIf cfg.enable {
Unit = {
Description = "A scrollable-tiling Wayland compositor";
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";
};
systemd.user.services.swaync.Install.WantedBy = [ "niri.service" ];
systemd.user.services.swaync.Unit.After = [ "niri.service" ];
systemd.user.targets.tray.Unit.After = [ "niri.service" ];
systemd.user.services.waybar.Unit.After = [ "niri.service" ];
systemd.user.services.waybar.Install.WantedBy = [ "niri.service" ];
systemd.user.targets.xwayland.Unit.After = [ "niri.service" ];
# xwayland-satellite
systemd.user.services.niri-xwayland-satellite = lib.mkIf cfg.enable {
@ -92,8 +82,9 @@ in
Before = [ "xwayland.target" "xdg-desktop-autostart.target" ];
After = [ "niri.service" ];
};
Install.RequiredBy = [ "niri.service" ];
Install.UpheldBy = [ "niri.service" ];
Service.Slice = "session.slice";
Service.Type = "notify";
Service.ExecStart = "${lib.getExe pkgs.xwayland-satellite} ${xwayland-display}";
};
@ -143,8 +134,6 @@ in
{ command = [ (lib.getExe pkgs.swaybg) "-i" "${wallpaper}" "-m" "fill" ]; }
# Waybar
{ 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 = {
@ -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
{
matches = [{ app-id = "kitty"; }];

View file

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

View file

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

View file

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