mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-07 08:44:09 +09:00
systemd
This commit is contained in:
@@ -1,24 +1,157 @@
|
||||
{ lib, pkgs, ... }:
|
||||
let
|
||||
action = key: name: {
|
||||
"@key" = key;
|
||||
action = {
|
||||
"@name" = name;
|
||||
};
|
||||
};
|
||||
|
||||
execute = key: command: {
|
||||
"@key" = key;
|
||||
action = {
|
||||
"@name" = "Execute";
|
||||
"@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
|
||||
{
|
||||
xdg.configFile = {
|
||||
"labwc/rc.xml".source = ./rc.xml;
|
||||
wayland.windowManager.labwc = {
|
||||
enable = true;
|
||||
# NixOS owns the package so Home Manager only generates the user config.
|
||||
package = null;
|
||||
|
||||
"labwc/environment".text = ''
|
||||
XKB_DEFAULT_LAYOUT=jp
|
||||
XKB_DEFAULT_OPTIONS=ctrl:nocaps
|
||||
'';
|
||||
rc = {
|
||||
core = {
|
||||
decoration = "client";
|
||||
gap = 10;
|
||||
autoEnableOutputs = "yes";
|
||||
reuseOutputMode = "yes";
|
||||
};
|
||||
|
||||
"labwc/autostart".text = ''
|
||||
# Pull in graphical-session.target so Home Manager services such as
|
||||
# portals, Vicinae, and the idle manager follow the labwc session.
|
||||
${lib.getExe' pkgs.systemd "systemctl"} --user --no-block start labwc-session.target
|
||||
theme = {
|
||||
name = "Dracula";
|
||||
cornerRadius = 8;
|
||||
dropShadows = "yes";
|
||||
dropShadowsOnTiled = "yes";
|
||||
};
|
||||
|
||||
# labwc does not run XDG autostart entries itself. Start the input method
|
||||
# explicitly so both native Wayland and XWayland applications can use it.
|
||||
fcitx5 -d --replace >/dev/null 2>&1 &
|
||||
windowSwitcher = {
|
||||
"@preview" = "yes";
|
||||
"@outlines" = "yes";
|
||||
osd = {
|
||||
"@style" = "thumbnail";
|
||||
};
|
||||
};
|
||||
|
||||
NOCTALIA_CONFIG_HOME="$HOME/.config/noctalia-labwc" noctalia >/dev/null 2>&1 &
|
||||
${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1 >/dev/null 2>&1 &
|
||||
'';
|
||||
focus = {
|
||||
followMouse = "yes";
|
||||
followMouseRequiresMovement = "yes";
|
||||
raiseOnFocus = "no";
|
||||
};
|
||||
|
||||
desktops = {
|
||||
"@number" = 9;
|
||||
"@popupTime" = 500;
|
||||
"@prefix" = "Workspace";
|
||||
};
|
||||
|
||||
keyboard = {
|
||||
default = true;
|
||||
numlock = "on";
|
||||
keybind = [
|
||||
(action "W-q" "Close")
|
||||
(action "W-f" "ToggleMaximize")
|
||||
(action "W-Tab" "NextWindow")
|
||||
(action "W-S-Tab" "PreviousWindow")
|
||||
(action "W-j" "NextWindow")
|
||||
(action "W-k" "PreviousWindow")
|
||||
{
|
||||
"@key" = "W-a";
|
||||
action = {
|
||||
"@name" = "ShowMenu";
|
||||
"@menu" = "client-list-combined-menu";
|
||||
};
|
||||
position = {
|
||||
x = "center";
|
||||
y = "center";
|
||||
};
|
||||
}
|
||||
(execute "W-t" "ghostty")
|
||||
(execute "W-d" "vicinae toggle")
|
||||
(execute "W-e" "nautilus --new-window")
|
||||
(execute "W-l" "loginctl lock-session")
|
||||
(execute "W-v" "vicinae vicinae://launch/clipboard/history?toggle=true")
|
||||
(execute "W-space" "ghostty +toggle-quick-terminal")
|
||||
(execute "W-p" "wdisplays")
|
||||
(execute "W-s" "noctalia msg panel-toggle control-center")
|
||||
(execute "W-comma" "noctalia msg settings-toggle")
|
||||
(action "W-S-e" "Exit")
|
||||
]
|
||||
++ desktopKeybinds
|
||||
++ [
|
||||
(execute "XF86AudioRaiseVolume" "noctalia msg volume-up")
|
||||
(execute "XF86AudioLowerVolume" "noctalia msg volume-down")
|
||||
(execute "XF86AudioMute" "noctalia msg volume-mute")
|
||||
(execute "XF86AudioMicMute" "noctalia msg mic-mute")
|
||||
(execute "XF86MonBrightnessUp" "noctalia msg brightness-up")
|
||||
(execute "XF86MonBrightnessDown" "noctalia msg brightness-down")
|
||||
];
|
||||
};
|
||||
|
||||
mouse.default = true;
|
||||
|
||||
libinput.device = [
|
||||
{
|
||||
"@category" = "touchpad";
|
||||
naturalScroll = "yes";
|
||||
tap = "yes";
|
||||
tapAndDrag = "yes";
|
||||
dragLock = "yes";
|
||||
clickMethod = "clickfinger";
|
||||
scrollMethod = "twoFinger";
|
||||
scrollFactor = "4.0";
|
||||
}
|
||||
{
|
||||
"@category" = "non-touch";
|
||||
pointerSpeed = "-0.1";
|
||||
accelProfile = "flat";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
environment = [
|
||||
"XKB_DEFAULT_LAYOUT=jp"
|
||||
"XKB_DEFAULT_OPTIONS=ctrl:nocaps"
|
||||
];
|
||||
|
||||
# Pull in graphical-session.target so Home Manager services such as
|
||||
# portals, Vicinae, and the idle manager follow the labwc session.
|
||||
systemd.extraCommands = [
|
||||
"${lib.getExe' pkgs.systemd "systemctl"} --user --no-block start labwc-session.target"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user