Merge pull request #182 from DreamMaoMao/chname

change: change project name to mango
This commit is contained in:
DreamMaoMao 2025-07-30 15:18:39 +08:00 committed by GitHub
commit b812f07095
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 97 additions and 98 deletions

View file

@ -1,6 +1,6 @@
--- ---
name: Bug report name: Bug report
about: Something in maomaowm isn't working correctly about: Something in mango isn't working correctly
title: "" title: ""
labels: "A: bug" labels: "A: bug"
assignees: "" assignees: ""
@ -8,13 +8,13 @@ assignees: ""
## Info ## Info
<!--Paste maomao version from running "maomao -v"--> <!--Paste mango version from running "mango -v"-->
<!-- <!--
Wlroots library needs to be built from this repository to avoid crashes Wlroots library needs to be built from this repository to avoid crashes
https://github.com/DreamMaoMao/wlroots.git https://github.com/DreamMaoMao/wlroots.git
--> -->
maomao version: mango version:
wlroots version: wlroots version:
## Description ## Description

4
.gitignore vendored
View file

@ -2,8 +2,8 @@
/.vscode /.vscode
/result /result
config.h config.h
maomao mango
maomao.o mango.o
util.o util.o
*-protocol.h *-protocol.h
*-protocol.c *-protocol.c

View file

@ -1,4 +1,4 @@
maomaowm - wayland compositor base wlroots mango - wayland compositor base wlroots
Copyright © 2025 DreamMaoMao Copyright © 2025 DreamMaoMao

View file

@ -1,15 +1,14 @@
# Maomaowm # Mango
This project's development is based on [dwl](https://codeberg.org/dwl/dwl/). This project's development is based on [dwl](https://codeberg.org/dwl/dwl/).
"Since many people have asked about the meaning of this compositor's name, 'Maomao' is an online alias I've been using for years - it comes from the first two characters of the Chinese word for 'caterpillar' (毛毛虫). You can basically think of it as meaning 'caterpillar'.
1. **Lightweight & Fast Build** 1. **Lightweight & Fast Build**
- _Maomao_ is as lightweight as _dwl_, and can be built completely within a few seconds. Despite this, _Maomao_ does not compromise on functionality. - _Mango_ is as lightweight as _dwl_, and can be built completely within a few seconds. Despite this, _Mango_ does not compromise on functionality.
2. **Feature Highlights** 2. **Feature Highlights**
- In addition to basic WM functionality, Maomao provides: - In addition to basic WM functionality, Mango provides:
- Excellent xwayland support. - Excellent xwayland support.
- Base tags not workspaces (supports separate window layouts for each tag) - Base tags not workspaces (supports separate window layouts for each tag)
- Smooth and customizable complete animations (window open/move/close, tag enter/leave,layer open/close/move) - Smooth and customizable complete animations (window open/move/close, tag enter/leave,layer open/close/move)
@ -72,7 +71,7 @@ https://github.com/user-attachments/assets/014c893f-115c-4ae9-8342-f9ae3e9a0df0
## Arch Linux ## Arch Linux
```bash ```bash
yay -S maomaowm-git yay -S mango-git
``` ```
@ -87,12 +86,12 @@ eselect repository enable guru
emerge --sync guru emerge --sync guru
``` ```
Then, add `gui-libs/scenefx` and `gui-wm/maomaowm` to the `package.accept_keywords`. Then, add `gui-libs/scenefx` and `gui-wm/mango` to the `package.accept_keywords`.
Finally, install the package: Finally, install the package:
```bash ```bash
emerge --ask --verbose gui-wm/maomaowm emerge --ask --verbose gui-wm/mango
``` ```
Patching wlroots is done by getting the patch with git from [the repository](https://github.com/DreamMaoMao/wlroots.git) Patching wlroots is done by getting the patch with git from [the repository](https://github.com/DreamMaoMao/wlroots.git)
@ -112,8 +111,8 @@ cd scenefx
meson build -Dprefix=/usr meson build -Dprefix=/usr
sudo ninja -C build install sudo ninja -C build install
git clone https://github.com/DreamMaoMao/maomaowm.git git clone https://github.com/DreamMaoMao/mango.git
cd maomaowm cd mango
meson build -Dprefix=/usr meson build -Dprefix=/usr
sudo ninja -C build install sudo ninja -C build install
``` ```
@ -135,7 +134,7 @@ sudo ninja -C build install
- alt+return: open foot terminal - alt+return: open foot terminal
- alt+q: kill client - alt+q: kill client
- alt+left/right/up/down: focus direction - alt+left/right/up/down: focus direction
- super+m: quit maomao - super+m: quit mango
## My Dotfiles ## My Dotfiles
@ -148,19 +147,19 @@ yay -S rofi-wayland foot xdg-desktop-portal-wlr swaybg waybar wl-clip-persist cl
- use my config - use my config
```bash ```bash
git clone https://github.com/DreamMaoMao/maomao-config.git ~/.config/maomao git clone https://github.com/DreamMaoMao/mango-config.git ~/.config/mango
``` ```
## Config Documentation ## Config Documentation
Refer to the [wiki](https://github.com/DreamMaoMao/maomaowm/wiki/) Refer to the [wiki](https://github.com/DreamMaoMao/mango/wiki/)
# NixOS + Home-manager # NixOS + Home-manager
The repo contains a flake that provides a NixOS module and a home-manager module for maomaowm. The repo contains a flake that provides a NixOS module and a home-manager module for mango.
Use the NixOS module to install maomaowm with other necessary components of a working Wayland environment. Use the NixOS module to install mango with other necessary components of a working Wayland environment.
Use the home-manager module to declare configuration and autostart for maomaowm. Use the home-manager module to declare configuration and autostart for mango.
Here's an example of using the modules in a flake: Here's an example of using the modules in a flake:
@ -173,7 +172,7 @@ Here's an example of using the modules in a flake:
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
maomaowm.url = "github:DreamMaoMao/maomaowm"; mango.url = "github:DreamMaoMao/mango";
}; };
outputs = outputs =
inputs@{ self, flake-parts, ... }: inputs@{ self, flake-parts, ... }:
@ -187,10 +186,10 @@ Here's an example of using the modules in a flake:
modules = [ modules = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
# Add maomaowm nixos module # Add mango nixos module
inputs.maomaowm.nixosModules.maomaowm inputs.mango.nixosModules.mango
{ {
programs.maomaowm.enable = true; programs.mango.enable = true;
} }
{ {
home-manager = { home-manager = {
@ -202,7 +201,7 @@ Here's an example of using the modules in a flake:
( (
{ ... }: { ... }:
{ {
wayland.windowManager.maomaowm = { wayland.windowManager.mango = {
enable = true; enable = true;
settings = '' settings = ''
# see config.conf # see config.conf
@ -216,8 +215,8 @@ Here's an example of using the modules in a flake:
) )
] ]
++ [ ++ [
# Add maomaowm hm module # Add mango hm module
inputs.maomaowm.hmModules.maomaowm inputs.mango.hmModules.mango
]; ];
}; };
} }
@ -229,18 +228,18 @@ Here's an example of using the modules in a flake:
} }
``` ```
# Packaging maomaowm # Packaging mango
To package maomaowm for other distributions, you can check the reference setup for: To package mango for other distributions, you can check the reference setup for:
- [nix](https://github.com/DreamMaoMao/maomaowm/blob/main/nix/default.nix) - [nix](https://github.com/DreamMaoMao/mango/blob/main/nix/default.nix)
- [arch](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=maomaowm-git). - [arch](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mango-git).
Currently building maomaowm requires a patched version of `wlroots-0.19`. If possible, the patch can be extracted from the [latest commit](https://github.com/DreamMaoMao/wlroots.git) Currently building mango requires a patched version of `wlroots-0.19`. If possible, the patch can be extracted from the [latest commit](https://github.com/DreamMaoMao/wlroots.git)
and applied on `prepare` step. If it is not possible, you will need to create a separate `wlroots` package and make it a build dependency. and applied on `prepare` step. If it is not possible, you will need to create a separate `wlroots` package and make it a build dependency.
You might also need to package `scenefx` for your distribution, check availability [here](https://github.com/wlrfx/scenefx.git). You might also need to package `scenefx` for your distribution, check availability [here](https://github.com/wlrfx/scenefx.git).
If you encounter build errors when packaging `maomaowm`, feel free to create an issue and ask a question, but If you encounter build errors when packaging `mango`, feel free to create an issue and ask a question, but
Read The Friendly Manual on packaging software in your distribution first. Read The Friendly Manual on packaging software in your distribution first.
# Thanks to These Reference Repositories # Thanks to These Reference Repositories

View file

@ -1,4 +1,4 @@
# More option see https://github.com/DreamMaoMao/maomaowm/wiki/ # More option see https://github.com/DreamMaoMao/mango/wiki/
# Window effect # Window effect
blur=0 blur=0

View file

@ -23,8 +23,8 @@
]; ];
flake = { flake = {
hmModules.maomaowm = import ./nix/hm-modules.nix self; hmModules.mango = import ./nix/hm-modules.nix self;
nixosModules.maomaowm = import ./nix/nixos-modules.nix self; nixosModules.mango = import ./nix/nixos-modules.nix self;
}; };
perSystem = { perSystem = {
@ -36,7 +36,7 @@
(pkgs) (pkgs)
callPackage callPackage
; ;
maomaowm = callPackage ./nix { mango = callPackage ./nix {
inherit (inputs.mmsg.packages.${pkgs.system}) mmsg; inherit (inputs.mmsg.packages.${pkgs.system}) mmsg;
inherit (inputs.scenefx.packages.${pkgs.system}) scenefx; inherit (inputs.scenefx.packages.${pkgs.system}) scenefx;
}; };
@ -45,14 +45,14 @@
buildInputs = old.buildInputs ++ []; buildInputs = old.buildInputs ++ [];
}; };
in { in {
packages.default = maomaowm; packages.default = mango;
overlayAttrs = { overlayAttrs = {
inherit (config.packages) maomaowm; inherit (config.packages) mango;
}; };
packages = { packages = {
inherit maomaowm; inherit mango;
}; };
devShells.default = maomaowm.overrideAttrs shellOverride; devShells.default = mango.overrideAttrs shellOverride;
formatter = pkgs.alejandra; formatter = pkgs.alejandra;
}; };
systems = [ systems = [

7
mango.desktop Normal file
View file

@ -0,0 +1,7 @@
[Desktop Entry]
Encoding=UTF-8
Name=Mango
Comment=mango WM
Exec=mango
Icon=mango
Type=Application

View file

@ -1,7 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Name=Maomao
Comment=maomao WM
Exec=maomao
Icon=maomao
Type=Application

View file

@ -1,4 +1,4 @@
project('maomao', ['c', 'cpp'], project('mango', ['c', 'cpp'],
version : '0.7.3' version : '0.7.3'
) )
@ -68,8 +68,8 @@ if xcb.found() and xlibs.found()
c_args += '-DXWAYLAND' c_args += '-DXWAYLAND'
endif endif
executable('maomao', executable('mango',
'src/maomao.c', 'src/mango.c',
'src/common/util.c', 'src/common/util.c',
wayland_sources, wayland_sources,
dependencies : [ dependencies : [
@ -89,7 +89,7 @@ executable('maomao',
) )
desktop_install_dir = join_paths(prefix, 'share/wayland-sessions') desktop_install_dir = join_paths(prefix, 'share/wayland-sessions')
install_data('maomao.desktop', install_dir : desktop_install_dir) install_data('mango.desktop', install_dir : desktop_install_dir)
# 安装 config.conf # 安装 config.conf
install_data('config.conf', install_dir : join_paths(sysconfdir, 'maomao')) install_data('config.conf', install_dir : join_paths(sysconfdir, 'mango'))

View file

@ -22,7 +22,7 @@
wlroots_0_19, wlroots_0_19,
libGL, libGL,
}: let }: let
pname = "maomaowm"; pname = "mango";
# Use patched wlroots from github.com/DreamMaoMao/wlroots # Use patched wlroots from github.com/DreamMaoMao/wlroots
wlroots-git = wlroots_0_19.overrideAttrs ( wlroots-git = wlroots_0_19.overrideAttrs (
final: prev: { final: prev: {
@ -71,14 +71,14 @@ in
]; ];
passthru = { passthru = {
providedSessions = ["maomao"]; providedSessions = ["mango"];
inherit mmsg; inherit mmsg;
}; };
meta = { meta = {
mainProgram = "maomao"; mainProgram = "mango";
description = "A streamlined but feature-rich Wayland compositor"; description = "A streamlined but feature-rich Wayland compositor";
homepage = "https://github.com/DreamMaoMao/maomaowm"; homepage = "https://github.com/DreamMaoMao/mango";
license = lib.licenses.gpl3Plus; license = lib.licenses.gpl3Plus;
maintainers = []; maintainers = [];
platforms = lib.platforms.unix; platforms = lib.platforms.unix;

View file

@ -4,8 +4,8 @@ self: {
pkgs, pkgs,
... ...
}: let }: let
inherit (self.packages.${pkgs.system}) maomaowm; inherit (self.packages.${pkgs.system}) mango;
cfg = config.wayland.windowManager.maomaowm; cfg = config.wayland.windowManager.mango;
variables = lib.concatStringsSep " " cfg.systemd.variables; variables = lib.concatStringsSep " " cfg.systemd.variables;
extraCommands = lib.concatStringsSep " && " cfg.systemd.extraCommands; extraCommands = lib.concatStringsSep " && " cfg.systemd.extraCommands;
systemdActivation = ''${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}''; systemdActivation = ''${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}'';
@ -15,7 +15,7 @@ self: {
''; '';
in { in {
options = { options = {
wayland.windowManager.maomaowm = with lib; { wayland.windowManager.mango = with lib; {
enable = mkOption { enable = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
@ -26,8 +26,8 @@ in {
default = pkgs.stdenv.isLinux; default = pkgs.stdenv.isLinux;
example = false; example = false;
description = '' description = ''
Whether to enable {file}`maomao-session.target` on Whether to enable {file}`mango-session.target` on
maomao startup. This links to mango startup. This links to
{file}`graphical-session.target`. {file}`graphical-session.target`.
Some important environment variables will be imported to systemd Some important environment variables will be imported to systemd
and dbus user environment before reaching the target, including and dbus user environment before reaching the target, including
@ -59,7 +59,7 @@ in {
type = types.listOf types.str; type = types.listOf types.str;
default = [ default = [
"systemctl --user reset-failed" "systemctl --user reset-failed"
"systemctl --user start maomao-session.target" "systemctl --user start mango-session.target"
]; ];
description = '' description = ''
Extra commands to run after D-Bus activation. Extra commands to run after D-Bus activation.
@ -71,7 +71,7 @@ in {
''; '';
}; };
settings = mkOption { settings = mkOption {
description = "maomaowm config content"; description = "mango config content";
type = types.str; type = types.str;
default = ""; default = "";
example = '' example = ''
@ -92,30 +92,30 @@ in {
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = [maomaowm]; home.packages = [mango];
home.activation = home.activation =
lib.optionalAttrs (cfg.autostart_sh != "") { lib.optionalAttrs (cfg.autostart_sh != "") {
createMaomaoScript = lib.hm.dag.entryAfter ["clearMaomaoConfig"] '' createMangoScript = lib.hm.dag.entryAfter ["clearMangoConfig"] ''
cat ${autostart_sh} > $HOME/.config/maomao/autostart.sh cat ${autostart_sh} > $HOME/.config/mango/autostart.sh
chmod +x $HOME/.config/maomao/autostart.sh chmod +x $HOME/.config/mango/autostart.sh
''; '';
} }
// lib.optionalAttrs (cfg.settings != "") { // lib.optionalAttrs (cfg.settings != "") {
createMaomaoConfig = lib.hm.dag.entryAfter ["clearMaomaoConfig"] '' createMangoConfig = lib.hm.dag.entryAfter ["clearMangoConfig"] ''
cat > $HOME/.config/maomao/config.conf <<EOF cat > $HOME/.config/mango/config.conf <<EOF
${cfg.settings} ${cfg.settings}
EOF EOF
''; '';
} }
// { // {
clearMaomaoConfig = lib.hm.dag.entryAfter ["writeBoundary"] '' clearMangoConfig = lib.hm.dag.entryAfter ["writeBoundary"] ''
rm -rf $HOME/.config/maomao rm -rf $HOME/.config/mango
mkdir -p $HOME/.config/maomao mkdir -p $HOME/.config/mango
''; '';
}; };
systemd.user.targets.maomao-session = lib.mkIf cfg.systemd.enable { systemd.user.targets.mango-session = lib.mkIf cfg.systemd.enable {
Unit = { Unit = {
Description = "maomao compositor session"; Description = "mango compositor session";
Documentation = ["man:systemd.special(7)"]; Documentation = ["man:systemd.special(7)"];
BindsTo = ["graphical-session.target"]; BindsTo = ["graphical-session.target"];
Wants = Wants =

View file

@ -4,15 +4,15 @@ self: {
pkgs, pkgs,
... ...
}: let }: let
cfg = config.programs.maomaowm; cfg = config.programs.mango;
in { in {
options = { options = {
programs.maomaowm = { programs.mango = {
enable = lib.mkEnableOption "maomaowm, a wayland compositor based on dwl"; enable = lib.mkEnableOption "mango, a wayland compositor based on dwl";
package = lib.mkOption { package = lib.mkOption {
type = lib.types.package; type = lib.types.package;
default = self.packages.${pkgs.system}.maomaowm; default = self.packages.${pkgs.system}.mango;
description = "The maomaowm package to use"; description = "The mango package to use";
}; };
}; };
}; };

View file

@ -164,7 +164,7 @@ I would probably just submit raphi's patchset but I don't think that would be po
</request> </request>
<request name="quit" since="2"> <request name="quit" since="2">
<description summary="Quit maomao">This request allows clients to instruct the compositor to quit maomao.</description> <description summary="Quit mango">This request allows clients to instruct the compositor to quit mango.</description>
</request> </request>
<request name="dispatch" since="2"> <request name="dispatch" since="2">

View file

@ -2508,11 +2508,11 @@ void parse_config(void) {
config.tag_rules_count = 0; config.tag_rules_count = 0;
config.cursor_theme = NULL; config.cursor_theme = NULL;
// 获取 MAOMAOCONFIG 环境变量 // 获取 MANGOCONFIG 环境变量
const char *maomaoconfig = getenv("MAOMAOCONFIG"); const char *mangoconfig = getenv("MANGOCONFIG");
// 如果 MAOMAOCONFIG 环境变量不存在或为空,则使用 HOME 环境变量 // 如果 MANGOCONFIG 环境变量不存在或为空,则使用 HOME 环境变量
if (!maomaoconfig || maomaoconfig[0] == '\0') { if (!mangoconfig || mangoconfig[0] == '\0') {
// 获取当前用户家目录 // 获取当前用户家目录
const char *homedir = getenv("HOME"); const char *homedir = getenv("HOME");
if (!homedir) { if (!homedir) {
@ -2520,18 +2520,18 @@ void parse_config(void) {
return; return;
} }
// 构建日志文件路径 // 构建日志文件路径
snprintf(filename, sizeof(filename), "%s/.config/maomao/config.conf", snprintf(filename, sizeof(filename), "%s/.config/mango/config.conf",
homedir); homedir);
// 检查文件是否存在 // 检查文件是否存在
if (access(filename, F_OK) != 0) { if (access(filename, F_OK) != 0) {
// 如果文件不存在,则使用 /etc/maomao/config.conf // 如果文件不存在,则使用 /etc/mango/config.conf
snprintf(filename, sizeof(filename), "%s/maomao/config.conf", snprintf(filename, sizeof(filename), "%s/mango/config.conf",
SYSCONFDIR); SYSCONFDIR);
} }
} else { } else {
// 使用 MAOMAOCONFIG 环境变量作为配置文件夹路径 // 使用 MANGOCONFIG 环境变量作为配置文件夹路径
snprintf(filename, sizeof(filename), "%s/config.conf", maomaoconfig); snprintf(filename, sizeof(filename), "%s/config.conf", mangoconfig);
} }
set_value_default(); set_value_default();

View file

@ -1,7 +1,7 @@
// TODO: remove this file in the future, replace all global variables with // TODO: remove this file in the future, replace all global variables with
// config.xxx // config.xxx
/* speedie's maomao config */ /* speedie's mango config */
#define COLOR(hex) \ #define COLOR(hex) \
{((hex >> 24) & 0xFF) / 255.0f, ((hex >> 16) & 0xFF) / 255.0f, \ {((hex >> 24) & 0xFF) / 255.0f, ((hex >> 16) & 0xFF) / 255.0f, \

View file

@ -27,17 +27,17 @@ int isdescprocess(pid_t p, pid_t c) {
} }
char *get_autostart_path(char *autostart_path, unsigned int buf_size) { char *get_autostart_path(char *autostart_path, unsigned int buf_size) {
const char *maomaoconfig = getenv("MAOMAOCONFIG"); const char *mangoconfig = getenv("MANGOCONFIG");
if (maomaoconfig && maomaoconfig[0] != '\0') { if (mangoconfig && mangoconfig[0] != '\0') {
snprintf(autostart_path, buf_size, "%s/autostart.sh", maomaoconfig); snprintf(autostart_path, buf_size, "%s/autostart.sh", mangoconfig);
} else { } else {
const char *homedir = getenv("HOME"); const char *homedir = getenv("HOME");
if (!homedir) { if (!homedir) {
fprintf(stderr, "Error: HOME environment variable not set.\n"); fprintf(stderr, "Error: HOME environment variable not set.\n");
return NULL; return NULL;
} }
snprintf(autostart_path, buf_size, "%s/.config/maomao/autostart.sh", snprintf(autostart_path, buf_size, "%s/.config/mango/autostart.sh",
homedir); homedir);
} }

View file

@ -4282,7 +4282,7 @@ void create_output(struct wlr_backend *backend, void *data) {
void setup(void) { void setup(void) {
setenv("XCURSOR_SIZE", "24", 1); setenv("XCURSOR_SIZE", "24", 1);
setenv("XDG_CURRENT_DESKTOP", "maomao", 1); setenv("XDG_CURRENT_DESKTOP", "mango", 1);
parse_config(); parse_config();
init_baked_points(); init_baked_points();
@ -5260,7 +5260,7 @@ int main(int argc, char *argv[]) {
else if (c == 'd') else if (c == 'd')
log_level = WLR_DEBUG; log_level = WLR_DEBUG;
else if (c == 'v') else if (c == 'v')
die("maomao " VERSION); die("mango " VERSION);
else else
goto usage; goto usage;
} }