Merge remote-tracking branch 'origin/main' into scenefx

This commit is contained in:
DreamMaoMao 2025-06-18 08:17:19 +08:00
commit 31bd2814d2
10 changed files with 438 additions and 291 deletions

31
.github/workflows/lock.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: Lock Threads
on:
schedule:
- cron: "30 12 * * *"
workflow_dispatch:
concurrency:
group: lock
jobs:
lock:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
discussions: write
steps:
- uses: dessant/lock-threads@v5
with:
issue-inactive-days: "30"
issue-comment: >
I'm going to lock this issue because it has been closed for _30 days_. ⏳
This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please file a new
issue and complete the issue template so we can capture all the details
necessary to investigate further.
pr-inactive-days: "30"
discussion-inactive-days: "30"
process-only: "issues,prs,discussions"

28
.github/workflows/stale.yml vendored Normal file
View file

@ -0,0 +1,28 @@
name: Close manually marked stale issues
on:
schedule:
- cron: "30 12 * * *" # 每天 UTC 12:30 运行
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
# 禁用自动标记 stale仅手动标记的 issue 会被处理)
days-before-issue-stale: -1
# 手动标记后14 天后关闭
days-before-issue-close: 14
# 使用的标签(必须和你手动添加的标签一致)
stale-issue-label: "stale"
# 自动关闭时自动加上的标签
close-issue-label: "automatic-closing"
# 关闭时的提示信息
close-issue-message: "This issue was closed because it was marked as stale and had no activity for 14 days."
# 禁用 PR 处理
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -13,14 +13,13 @@
}; };
}; };
outputs = outputs = {
{ self,
self, flake-parts,
flake-parts, treefmt-nix,
treefmt-nix, ...
... } @ inputs:
}@inputs: flake-parts.lib.mkFlake {inherit inputs;} {
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ imports = [
inputs.flake-parts.flakeModules.easyOverlay inputs.flake-parts.flakeModules.easyOverlay
]; ];
@ -30,37 +29,35 @@
nixosModules.maomaowm = import ./nix/nixos-modules.nix self; nixosModules.maomaowm = import ./nix/nixos-modules.nix self;
}; };
perSystem = perSystem = {
{ config,
config, pkgs,
pkgs, ...
... }: let
}: inherit
let (pkgs)
inherit (pkgs) callPackage
callPackage ;
; maomaowm = callPackage ./nix {
maomaowm = callPackage ./nix { inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) wlroots;
inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) wlroots; inherit (inputs.mmsg.packages.${pkgs.system}) mmsg;
inherit (inputs.mmsg.packages.${pkgs.system}) mmsg;
};
shellOverride = old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ ];
buildInputs = old.buildInputs ++ [ ];
};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in
{
packages.default = maomaowm;
overlayAttrs = {
inherit (config.packages) maomaowm;
};
packages = {
inherit maomaowm;
};
devShells.default = maomaowm.overrideAttrs shellOverride;
formatter = treefmtEval.config.build.wrapper;
}; };
systems = [ "x86_64-linux" ]; shellOverride = old: {
nativeBuildInputs = old.nativeBuildInputs ++ [];
buildInputs = old.buildInputs ++ [];
};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in {
packages.default = maomaowm;
overlayAttrs = {
inherit (config.packages) maomaowm;
};
packages = {
inherit maomaowm;
};
devShells.default = maomaowm.overrideAttrs shellOverride;
formatter = treefmtEval.config.build.wrapper;
};
systems = ["x86_64-linux"];
}; };
} }

View file

@ -18,51 +18,53 @@
ninja, ninja,
wlroots, wlroots,
mmsg, mmsg,
}: }: let
let
pname = "maomaowm"; pname = "maomaowm";
in in
stdenv.mkDerivation { stdenv.mkDerivation {
inherit pname; inherit pname;
version = "nightly"; version = "nightly";
src = ../.; src = builtins.path {
path = ../.;
name = "source";
};
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
pkg-config pkg-config
wayland-scanner wayland-scanner
];
buildInputs =
[
libinput
libxcb
libxkbcommon
pcre2
pixman
wayland
wayland-protocols
wlroots
]
++ lib.optionals enableXWayland [
libX11
xcbutilwm
xwayland
]; ];
passthru = { buildInputs =
providedSessions = [ "maomao" ]; [
inherit mmsg; libinput
}; libxcb
libxkbcommon
pcre2
pixman
wayland
wayland-protocols
wlroots
]
++ lib.optionals enableXWayland [
libX11
xcbutilwm
xwayland
];
meta = { passthru = {
mainProgram = "maomao"; providedSessions = ["maomao"];
description = "A streamlined but feature-rich Wayland compositor"; inherit mmsg;
homepage = "https://github.com/DreamMaoMao/maomaowm"; };
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ]; meta = {
platforms = lib.platforms.unix; mainProgram = "maomao";
}; description = "A streamlined but feature-rich Wayland compositor";
} homepage = "https://github.com/DreamMaoMao/maomaowm";
license = lib.licenses.mit;
maintainers = [];
platforms = lib.platforms.unix;
};
}

View file

@ -1,11 +1,9 @@
self: self: {
{
lib, lib,
config, config,
pkgs, pkgs,
... ...
}: }: let
let
inherit (self.packages.${pkgs.system}) maomaowm; inherit (self.packages.${pkgs.system}) maomaowm;
cfg = config.wayland.windowManager.maomaowm; cfg = config.wayland.windowManager.maomaowm;
variables = lib.concatStringsSep " " cfg.systemd.variables; variables = lib.concatStringsSep " " cfg.systemd.variables;
@ -15,8 +13,7 @@ let
${lib.optionalString cfg.systemd.enable systemdActivation} ${lib.optionalString cfg.systemd.enable systemdActivation}
${cfg.autostart_sh} ${cfg.autostart_sh}
''; '';
in in {
{
options = { options = {
wayland.windowManager.maomaowm = with lib; { wayland.windowManager.maomaowm = with lib; {
enable = mkOption { enable = mkOption {
@ -53,7 +50,7 @@ in
"XCURSOR_THEME" "XCURSOR_THEME"
"XCURSOR_SIZE" "XCURSOR_SIZE"
]; ];
example = [ "--all" ]; example = ["--all"];
description = '' description = ''
Environment variables imported into the systemd and D-Bus user environment. Environment variables imported into the systemd and D-Bus user environment.
''; '';
@ -95,23 +92,23 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = [ maomaowm ]; home.packages = [maomaowm];
home.activation = home.activation =
lib.optionalAttrs (cfg.autostart_sh != "") { lib.optionalAttrs (cfg.autostart_sh != "") {
createMaomaoScript = lib.hm.dag.entryAfter [ "clearMaomaoConfig" ] '' createMaomaoScript = lib.hm.dag.entryAfter ["clearMaomaoConfig"] ''
cat ${autostart_sh} > $HOME/.config/maomao/autostart.sh cat ${autostart_sh} > $HOME/.config/maomao/autostart.sh
chmod +x $HOME/.config/maomao/autostart.sh chmod +x $HOME/.config/maomao/autostart.sh
''; '';
} }
// lib.optionalAttrs (cfg.settings != "") { // lib.optionalAttrs (cfg.settings != "") {
createMaomaoConfig = lib.hm.dag.entryAfter [ "clearMaomaoConfig" ] '' createMaomaoConfig = lib.hm.dag.entryAfter ["clearMaomaoConfig"] ''
cat > $HOME/.config/maomao/config.conf <<EOF cat > $HOME/.config/maomao/config.conf <<EOF
${cfg.settings} ${cfg.settings}
EOF EOF
''; '';
} }
// { // {
clearMaomaoConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] '' clearMaomaoConfig = lib.hm.dag.entryAfter ["writeBoundary"] ''
rm -rf $HOME/.config/maomao rm -rf $HOME/.config/maomao
mkdir -p $HOME/.config/maomao mkdir -p $HOME/.config/maomao
''; '';
@ -119,12 +116,14 @@ in
systemd.user.targets.maomao-session = lib.mkIf cfg.systemd.enable { systemd.user.targets.maomao-session = lib.mkIf cfg.systemd.enable {
Unit = { Unit = {
Description = "maomao compositor session"; Description = "maomao compositor session";
Documentation = [ "man:systemd.special(7)" ]; Documentation = ["man:systemd.special(7)"];
BindsTo = [ "graphical-session.target" ]; BindsTo = ["graphical-session.target"];
Wants = [ Wants =
"graphical-session-pre.target" [
] ++ lib.optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target"; "graphical-session-pre.target"
After = [ "graphical-session-pre.target" ]; ]
++ lib.optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target";
After = ["graphical-session-pre.target"];
Before = lib.optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target"; Before = lib.optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target";
}; };
}; };

View file

@ -1,14 +1,11 @@
self: self: {
{
config, config,
lib, lib,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.programs.maomaowm; cfg = config.programs.maomaowm;
in in {
{
options = { options = {
programs.maomaowm = { programs.maomaowm = {
enable = lib.mkEnableOption "maomaowm, a wayland compositor based on dwl"; enable = lib.mkEnableOption "maomaowm, a wayland compositor based on dwl";
@ -21,16 +18,22 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = [ environment.systemPackages =
cfg.package [
] ++ (if (builtins.hasAttr "mmsg" cfg.package) then [ cfg.package.mmsg ] else [ ]); cfg.package
]
++ (
if (builtins.hasAttr "mmsg" cfg.package)
then [cfg.package.mmsg]
else []
);
xdg.portal = { xdg.portal = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
wlr.enable = lib.mkDefault true; wlr.enable = lib.mkDefault true;
configPackages = [ cfg.package ]; configPackages = [cfg.package];
}; };
security.polkit.enable = lib.mkDefault true; security.polkit.enable = lib.mkDefault true;
@ -38,10 +41,9 @@ in
programs.xwayland.enable = lib.mkDefault true; programs.xwayland.enable = lib.mkDefault true;
services = { services = {
displayManager.sessionPackages = [ cfg.package ]; displayManager.sessionPackages = [cfg.package];
graphical-desktop.enable = lib.mkDefault true; graphical-desktop.enable = lib.mkDefault true;
}; };
}; };
} }

View file

@ -255,6 +255,7 @@ typedef struct {
int single_scratchpad; int single_scratchpad;
int xwayland_persistence; int xwayland_persistence;
int syncobj_enable;
struct xkb_rule_names xkb_rules; struct xkb_rule_names xkb_rules;
} Config; } Config;
@ -674,6 +675,8 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
func = tagtoright; func = tagtoright;
} else if (strcmp(func_name, "killclient") == 0) { } else if (strcmp(func_name, "killclient") == 0) {
func = killclient; func = killclient;
} else if (strcmp(func_name, "focuslast") == 0) {
func = focuslast;
} else if (strcmp(func_name, "setlayout") == 0) { } else if (strcmp(func_name, "setlayout") == 0) {
func = setlayout; func = setlayout;
(*arg).v = strdup(arg_value); (*arg).v = strdup(arg_value);
@ -700,12 +703,13 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
} else if (strcmp(func_name, "focusmon") == 0) { } else if (strcmp(func_name, "focusmon") == 0) {
func = focusmon; func = focusmon;
(*arg).i = parse_direction(arg_value); (*arg).i = parse_direction(arg_value);
if((*arg).i == UNDIR) { if ((*arg).i == UNDIR) {
(*arg).v = strdup(arg_value); (*arg).v = strdup(arg_value);
} }
} else if (strcmp(func_name, "tagmon") == 0) { } else if (strcmp(func_name, "tagmon") == 0) {
func = tagmon; func = tagmon;
(*arg).i = parse_direction(arg_value); (*arg).i = parse_direction(arg_value);
(*arg).ui = atoi(arg_value2);
} else if (strcmp(func_name, "incgaps") == 0) { } else if (strcmp(func_name, "incgaps") == 0) {
func = incgaps; func = incgaps;
(*arg).i = atoi(arg_value); (*arg).i = atoi(arg_value);
@ -915,6 +919,8 @@ void parse_config_line(Config *config, const char *line) {
config->single_scratchpad = atoi(value); config->single_scratchpad = atoi(value);
} else if (strcmp(key, "xwayland_persistence") == 0) { } else if (strcmp(key, "xwayland_persistence") == 0) {
config->xwayland_persistence = atoi(value); config->xwayland_persistence = atoi(value);
} else if (strcmp(key, "syncobj_enable") == 0) {
config->syncobj_enable = atoi(value);
} else if (strcmp(key, "no_border_when_single") == 0) { } else if (strcmp(key, "no_border_when_single") == 0) {
config->no_border_when_single = atoi(value); config->no_border_when_single = atoi(value);
} else if (strcmp(key, "snap_distance") == 0) { } else if (strcmp(key, "snap_distance") == 0) {
@ -2026,6 +2032,7 @@ void override_config(void) {
// 杂项设置 // 杂项设置
xwayland_persistence = CLAMP_INT(config.xwayland_persistence, 0, 1); xwayland_persistence = CLAMP_INT(config.xwayland_persistence, 0, 1);
syncobj_enable = CLAMP_INT(config.syncobj_enable, 0, 1);
axis_bind_apply_timeout = axis_bind_apply_timeout =
CLAMP_INT(config.axis_bind_apply_timeout, 0, 1000); CLAMP_INT(config.axis_bind_apply_timeout, 0, 1000);
focus_on_activate = CLAMP_INT(config.focus_on_activate, 0, 1); focus_on_activate = CLAMP_INT(config.focus_on_activate, 0, 1);
@ -2165,6 +2172,7 @@ void set_value_default() {
config.focus_cross_tag = focus_cross_tag; config.focus_cross_tag = focus_cross_tag;
config.single_scratchpad = single_scratchpad; config.single_scratchpad = single_scratchpad;
config.xwayland_persistence = xwayland_persistence; config.xwayland_persistence = xwayland_persistence;
config.syncobj_enable = syncobj_enable;
config.no_border_when_single = no_border_when_single; config.no_border_when_single = no_border_when_single;
config.snap_distance = snap_distance; config.snap_distance = snap_distance;
config.drag_tile_to_tile = drag_tile_to_tile; config.drag_tile_to_tile = drag_tile_to_tile;

View file

@ -87,6 +87,7 @@ float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0};
int warpcursor = 1; /* Warp cursor to focused client */ int warpcursor = 1; /* Warp cursor to focused client */
int xwayland_persistence = 1; /* xwayland persistence */ int xwayland_persistence = 1; /* xwayland persistence */
int syncobj_enable = 0;
/* layout(s) */ /* layout(s) */
Layout overviewlayout = {"󰃇", overview, "overview"}; Layout overviewlayout = {"󰃇", overview, "overview"};

View file

@ -57,4 +57,5 @@ void resizewin(const Arg *arg);
void toggle_named_scratchpad(const Arg *arg); void toggle_named_scratchpad(const Arg *arg);
void toggle_render_border(const Arg *arg); void toggle_render_border(const Arg *arg);
void create_virtual_output(const Arg *arg); void create_virtual_output(const Arg *arg);
void destroy_all_virtual_output(const Arg *arg); void destroy_all_virtual_output(const Arg *arg);
void focuslast(const Arg *arg);

File diff suppressed because it is too large Load diff