fcitx5 on labwc

This commit is contained in:
2026-08-03 11:44:15 +09:00
parent d67d53644e
commit d5e4c90710
3 changed files with 89 additions and 71 deletions
Generated
+9 -9
View File
@@ -588,11 +588,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable" "xwayland-satellite-unstable": "xwayland-satellite-unstable"
}, },
"locked": { "locked": {
"lastModified": 1785360640, "lastModified": 1785705919,
"narHash": "sha256-fg8SdA1SbiY1QhEuHLd9mSc99PIesiHEwf31O7oO044=", "narHash": "sha256-fkLVrf2tZ/822v+kF2NgXxQD5ugMNTgGlUd7Y1kHEHg=",
"owner": "sodiboo", "owner": "sodiboo",
"repo": "niri-flake", "repo": "niri-flake",
"rev": "014fda2da9e9667b8da9c5d6258743415456fba4", "rev": "50e136c5452ae98638d066454391c7ba7e16410a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -621,11 +621,11 @@
"niri-unstable": { "niri-unstable": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1784570726, "lastModified": 1785701241,
"narHash": "sha256-9EMn69JBcFWFgUM7f0VBAX+jBby5b9H3M59U75+5yI4=", "narHash": "sha256-ircVOzPWRircI39ac/tqJajr5OoJxEVrDlBb05TULEk=",
"owner": "YaLTeR", "owner": "YaLTeR",
"repo": "niri", "repo": "niri",
"rev": "7f26c3ee804fb6ed458ef7fb0e3c794f14e0b3bc", "rev": "feb3e43f1475e0865bb89cbd1e898b34d1d2ccf6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -908,11 +908,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1785318670, "lastModified": 1785571196,
"narHash": "sha256-dN6Ou5x/+23FZLEpYP3IffO+NyJFzUlGumt1uu3MMaY=", "narHash": "sha256-KoTsyMQqnXQZq8deCEnu4QkyldkwH/bpMMhUcfMdGIw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0954f7ee2f6bb3dc7d4e3d0d8bcb8fd4bde4cfc5", "rev": "148bab9c1c3c53136ecb44a6ea356a0ed5b39b06",
"type": "github" "type": "github"
}, },
"original": { "original": {
+47 -61
View File
@@ -1,6 +1,7 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
let let
systemctl = lib.getExe' pkgs.systemd "systemctl"; systemctl = lib.getExe' pkgs.systemd "systemctl";
action = key: name: { action = key: name: {
"@key" = key; "@key" = key;
action = { action = {
@@ -15,29 +16,6 @@ let
"@command" = command; "@command" = command;
}; };
}; };
desktopKeybinds = lib.concatMap (
desktop:
let
number = toString desktop;
in
[
{
"@key" = "W-${number}";
action = {
"@name" = "GoToDesktop";
"@to" = number;
};
}
{
"@key" = "W-C-${number}";
action = {
"@name" = "SendToDesktop";
"@to" = number;
};
}
]
) (lib.range 1 9);
in in
{ {
wayland.windowManager.labwc = { wayland.windowManager.labwc = {
@@ -45,40 +23,18 @@ in
# NixOS owns the package so Home Manager only generates the user config. # NixOS owns the package so Home Manager only generates the user config.
package = null; package = null;
systemd = {
enable = true;
variables = [
"DISPLAY"
"WAYLAND_DISPLAY"
"XDG_CURRENT_DESKTOP"
"XDG_SESSION_TYPE"
];
};
rc = { rc = {
core = {
decoration = "client";
gap = 10;
autoEnableOutputs = "yes";
reuseOutputMode = "yes";
};
theme = {
name = "Dracula";
cornerRadius = 8;
dropShadows = "yes";
dropShadowsOnTiled = "yes";
};
windowSwitcher = {
"@preview" = "yes";
"@outlines" = "yes";
osd = {
"@style" = "thumbnail";
};
};
focus = {
followMouse = "yes";
followMouseRequiresMovement = "yes";
raiseOnFocus = "no";
};
desktops = {
"@number" = 1;
"@popupTime" = 500;
"@prefix" = "Workspace";
};
keyboard = { keyboard = {
default = true; default = true;
@@ -136,7 +92,6 @@ in
(execute "W-comma" "noctalia msg settings-toggle") (execute "W-comma" "noctalia msg settings-toggle")
(action "W-S-e" "Exit") (action "W-S-e" "Exit")
] ]
++ desktopKeybinds
++ [ ++ [
(execute "XF86AudioRaiseVolume" "noctalia msg volume-up") (execute "XF86AudioRaiseVolume" "noctalia msg volume-up")
(execute "XF86AudioLowerVolume" "noctalia msg volume-down") (execute "XF86AudioLowerVolume" "noctalia msg volume-down")
@@ -147,6 +102,40 @@ in
]; ];
}; };
core = {
decoration = "client";
gap = 10;
autoEnableOutputs = "yes";
reuseOutputMode = "yes";
};
theme = {
name = "Dracula";
cornerRadius = 8;
dropShadows = "yes";
dropShadowsOnTiled = "yes";
};
windowSwitcher = {
"@preview" = "yes";
"@outlines" = "yes";
osd = {
"@style" = "thumbnail";
};
};
focus = {
followMouse = "yes";
followMouseRequiresMovement = "yes";
raiseOnFocus = "no";
};
desktops = {
"@number" = 1;
"@popupTime" = 500;
"@prefix" = "Workspace";
};
mouse.default = true; mouse.default = true;
libinput.device = [ libinput.device = [
@@ -159,6 +148,7 @@ in
clickMethod = "clickfinger"; clickMethod = "clickfinger";
scrollMethod = "twoFinger"; scrollMethod = "twoFinger";
scrollFactor = "4.0"; scrollFactor = "4.0";
disableWhileTyping = "yes";
} }
{ {
"@category" = "non-touch"; "@category" = "non-touch";
@@ -174,10 +164,6 @@ in
]; ];
}; };
xdg.configFile."labwc/autostart".text = lib.mkAfter ''
${systemctl} --user --no-block start labwc-session.target
'';
xdg.configFile."labwc/shutdown".text = lib.mkAfter '' xdg.configFile."labwc/shutdown".text = lib.mkAfter ''
${systemctl} --user stop graphical-session.target ${systemctl} --user stop graphical-session.target
''; '';
+33 -1
View File
@@ -1,4 +1,9 @@
{ inputs, pkgs, ... }: {
inputs,
pkgs,
lib,
...
}:
let let
unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system}; unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in in
@@ -7,4 +12,31 @@ in
enable = true; enable = true;
package = unstable.labwc; package = unstable.labwc;
}; };
# NixOS decides whether a graphical session manages graphical-session.target
# itself by checking XDG_CURRENT_DESKTOP against a hard-coded list. Labwc is
# currently absent from that list, so NixOS starts
# nixos-fake-graphical-session.target before Labwc is ready.
#
# This configuration uses Home Manager's Labwc systemd integration, which
# imports the Wayland environment and starts labwc-session.target correctly.
# Mark the Labwc session as systemd-aware before the display-manager wrapper
# performs its hard-coded check. Otherwise services such as Fcitx5 can start
# before WAYLAND_DISPLAY is available.
#
# Despite the services.xserver namespace, this session wrapper is also used
# for Wayland sessions by display managers such as Ly.
services.xserver.displayManager.sessionCommands = lib.mkAfter ''
case ":''${XDG_CURRENT_DESKTOP:-}:" in
*:labwc:*)
case ":$XDG_CURRENT_DESKTOP:" in
*:X-NIXOS-SYSTEMD-AWARE:*)
;;
*)
export XDG_CURRENT_DESKTOP="$XDG_CURRENT_DESKTOP:X-NIXOS-SYSTEMD-AWARE"
;;
esac
;;
esac
'';
} }