diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e1a1d5d..af52b6e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Something in maomaowm isn't working correctly +about: Something in mango isn't working correctly title: "" labels: "A: bug" assignees: "" @@ -8,13 +8,13 @@ assignees: "" ## Info - + -maomao version: +mango version: wlroots version: ## Description diff --git a/.gitignore b/.gitignore index f09b303..7681f94 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,8 @@ /.vscode /result config.h -maomao -maomao.o +mango +mango.o util.o *-protocol.h *-protocol.c diff --git a/LICENSE b/LICENSE index 14d89f6..73ba05f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -maomaowm - wayland compositor base wlroots +mango - wayland compositor base wlroots Copyright © 2025 DreamMaoMao diff --git a/README.md b/README.md index 41ef35a..0175a38 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ -# Maomaowm +# Mango 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** - - _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** - - In addition to basic WM functionality, Maomao provides: + - In addition to basic WM functionality, Mango provides: - Excellent xwayland support. - 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) @@ -72,7 +71,7 @@ https://github.com/user-attachments/assets/014c893f-115c-4ae9-8342-f9ae3e9a0df0 ## Arch Linux ```bash -yay -S maomaowm-git +yay -S mango-git ``` @@ -87,12 +86,12 @@ eselect repository enable 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: ```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) @@ -112,8 +111,8 @@ cd scenefx meson build -Dprefix=/usr sudo ninja -C build install -git clone https://github.com/DreamMaoMao/maomaowm.git -cd maomaowm +git clone https://github.com/DreamMaoMao/mango.git +cd mango meson build -Dprefix=/usr sudo ninja -C build install ``` @@ -135,7 +134,7 @@ sudo ninja -C build install - alt+return: open foot terminal - alt+q: kill client - alt+left/right/up/down: focus direction -- super+m: quit maomao +- super+m: quit mango ## My Dotfiles @@ -148,19 +147,19 @@ yay -S rofi-wayland foot xdg-desktop-portal-wlr swaybg waybar wl-clip-persist cl - use my config ```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 -Refer to the [wiki](https://github.com/DreamMaoMao/maomaowm/wiki/) +Refer to the [wiki](https://github.com/DreamMaoMao/mango/wiki/) # NixOS + Home-manager -The repo contains a flake that provides a NixOS module and a home-manager module for maomaowm. -Use the NixOS module to install maomaowm with other necessary components of a working Wayland environment. -Use the home-manager module to declare configuration and autostart 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 mango with other necessary components of a working Wayland environment. +Use the home-manager module to declare configuration and autostart for mango. 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"; }; flake-parts.url = "github:hercules-ci/flake-parts"; - maomaowm.url = "github:DreamMaoMao/maomaowm"; + mango.url = "github:DreamMaoMao/mango"; }; outputs = inputs@{ self, flake-parts, ... }: @@ -187,10 +186,10 @@ Here's an example of using the modules in a flake: modules = [ inputs.home-manager.nixosModules.home-manager - # Add maomaowm nixos module - inputs.maomaowm.nixosModules.maomaowm + # Add mango nixos module + inputs.mango.nixosModules.mango { - programs.maomaowm.enable = true; + programs.mango.enable = true; } { 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; settings = '' # see config.conf @@ -216,8 +215,8 @@ Here's an example of using the modules in a flake: ) ] ++ [ - # Add maomaowm hm module - inputs.maomaowm.hmModules.maomaowm + # Add mango hm module + 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) -- [arch](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=maomaowm-git). +- [nix](https://github.com/DreamMaoMao/mango/blob/main/nix/default.nix) +- [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. 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. # Thanks to These Reference Repositories diff --git a/config.conf b/config.conf index aaa699b..6e4aaa0 100644 --- a/config.conf +++ b/config.conf @@ -1,4 +1,4 @@ -# More option see https://github.com/DreamMaoMao/maomaowm/wiki/ +# More option see https://github.com/DreamMaoMao/mango/wiki/ # Window effect blur=0 diff --git a/flake.nix b/flake.nix index fed394a..9da1168 100644 --- a/flake.nix +++ b/flake.nix @@ -23,8 +23,8 @@ ]; flake = { - hmModules.maomaowm = import ./nix/hm-modules.nix self; - nixosModules.maomaowm = import ./nix/nixos-modules.nix self; + hmModules.mango = import ./nix/hm-modules.nix self; + nixosModules.mango = import ./nix/nixos-modules.nix self; }; perSystem = { @@ -36,7 +36,7 @@ (pkgs) callPackage ; - maomaowm = callPackage ./nix { + mango = callPackage ./nix { inherit (inputs.mmsg.packages.${pkgs.system}) mmsg; inherit (inputs.scenefx.packages.${pkgs.system}) scenefx; }; @@ -45,14 +45,14 @@ buildInputs = old.buildInputs ++ []; }; in { - packages.default = maomaowm; + packages.default = mango; overlayAttrs = { - inherit (config.packages) maomaowm; + inherit (config.packages) mango; }; packages = { - inherit maomaowm; + inherit mango; }; - devShells.default = maomaowm.overrideAttrs shellOverride; + devShells.default = mango.overrideAttrs shellOverride; formatter = pkgs.alejandra; }; systems = [ diff --git a/mango.desktop b/mango.desktop new file mode 100644 index 0000000..0c109ce --- /dev/null +++ b/mango.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Mango +Comment=mango WM +Exec=mango +Icon=mango +Type=Application diff --git a/maomao.desktop b/maomao.desktop deleted file mode 100644 index ef51780..0000000 --- a/maomao.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Maomao -Comment=maomao WM -Exec=maomao -Icon=maomao -Type=Application diff --git a/meson.build b/meson.build index f6d8e06..26efee0 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('maomao', ['c', 'cpp'], +project('mango', ['c', 'cpp'], version : '0.7.3' ) @@ -68,8 +68,8 @@ if xcb.found() and xlibs.found() c_args += '-DXWAYLAND' endif -executable('maomao', - 'src/maomao.c', +executable('mango', + 'src/mango.c', 'src/common/util.c', wayland_sources, dependencies : [ @@ -89,7 +89,7 @@ executable('maomao', ) 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 -install_data('config.conf', install_dir : join_paths(sysconfdir, 'maomao')) +install_data('config.conf', install_dir : join_paths(sysconfdir, 'mango')) diff --git a/nix/default.nix b/nix/default.nix index 62f5716..bcbca20 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -22,7 +22,7 @@ wlroots_0_19, libGL, }: let - pname = "maomaowm"; + pname = "mango"; # Use patched wlroots from github.com/DreamMaoMao/wlroots wlroots-git = wlroots_0_19.overrideAttrs ( final: prev: { @@ -71,14 +71,14 @@ in ]; passthru = { - providedSessions = ["maomao"]; + providedSessions = ["mango"]; inherit mmsg; }; meta = { - mainProgram = "maomao"; + mainProgram = "mango"; description = "A streamlined but feature-rich Wayland compositor"; - homepage = "https://github.com/DreamMaoMao/maomaowm"; + homepage = "https://github.com/DreamMaoMao/mango"; license = lib.licenses.gpl3Plus; maintainers = []; platforms = lib.platforms.unix; diff --git a/nix/hm-modules.nix b/nix/hm-modules.nix index 83533f5..38875a4 100644 --- a/nix/hm-modules.nix +++ b/nix/hm-modules.nix @@ -4,8 +4,8 @@ self: { pkgs, ... }: let - inherit (self.packages.${pkgs.system}) maomaowm; - cfg = config.wayland.windowManager.maomaowm; + inherit (self.packages.${pkgs.system}) mango; + cfg = config.wayland.windowManager.mango; variables = lib.concatStringsSep " " cfg.systemd.variables; extraCommands = lib.concatStringsSep " && " cfg.systemd.extraCommands; systemdActivation = ''${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}''; @@ -15,7 +15,7 @@ self: { ''; in { options = { - wayland.windowManager.maomaowm = with lib; { + wayland.windowManager.mango = with lib; { enable = mkOption { type = types.bool; default = false; @@ -26,8 +26,8 @@ in { default = pkgs.stdenv.isLinux; example = false; description = '' - Whether to enable {file}`maomao-session.target` on - maomao startup. This links to + Whether to enable {file}`mango-session.target` on + mango startup. This links to {file}`graphical-session.target`. Some important environment variables will be imported to systemd and dbus user environment before reaching the target, including @@ -59,7 +59,7 @@ in { type = types.listOf types.str; default = [ "systemctl --user reset-failed" - "systemctl --user start maomao-session.target" + "systemctl --user start mango-session.target" ]; description = '' Extra commands to run after D-Bus activation. @@ -71,7 +71,7 @@ in { ''; }; settings = mkOption { - description = "maomaowm config content"; + description = "mango config content"; type = types.str; default = ""; example = '' @@ -92,30 +92,30 @@ in { }; config = lib.mkIf cfg.enable { - home.packages = [maomaowm]; + home.packages = [mango]; home.activation = lib.optionalAttrs (cfg.autostart_sh != "") { - createMaomaoScript = lib.hm.dag.entryAfter ["clearMaomaoConfig"] '' - cat ${autostart_sh} > $HOME/.config/maomao/autostart.sh - chmod +x $HOME/.config/maomao/autostart.sh + createMangoScript = lib.hm.dag.entryAfter ["clearMangoConfig"] '' + cat ${autostart_sh} > $HOME/.config/mango/autostart.sh + chmod +x $HOME/.config/mango/autostart.sh ''; } // lib.optionalAttrs (cfg.settings != "") { - createMaomaoConfig = lib.hm.dag.entryAfter ["clearMaomaoConfig"] '' - cat > $HOME/.config/maomao/config.conf < $HOME/.config/mango/config.conf < - This request allows clients to instruct the compositor to quit maomao. + This request allows clients to instruct the compositor to quit mango. diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 760112a..d4256ea 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -2508,11 +2508,11 @@ void parse_config(void) { config.tag_rules_count = 0; config.cursor_theme = NULL; - // 获取 MAOMAOCONFIG 环境变量 - const char *maomaoconfig = getenv("MAOMAOCONFIG"); + // 获取 MANGOCONFIG 环境变量 + const char *mangoconfig = getenv("MANGOCONFIG"); - // 如果 MAOMAOCONFIG 环境变量不存在或为空,则使用 HOME 环境变量 - if (!maomaoconfig || maomaoconfig[0] == '\0') { + // 如果 MANGOCONFIG 环境变量不存在或为空,则使用 HOME 环境变量 + if (!mangoconfig || mangoconfig[0] == '\0') { // 获取当前用户家目录 const char *homedir = getenv("HOME"); if (!homedir) { @@ -2520,18 +2520,18 @@ void parse_config(void) { return; } // 构建日志文件路径 - snprintf(filename, sizeof(filename), "%s/.config/maomao/config.conf", + snprintf(filename, sizeof(filename), "%s/.config/mango/config.conf", homedir); // 检查文件是否存在 if (access(filename, F_OK) != 0) { - // 如果文件不存在,则使用 /etc/maomao/config.conf - snprintf(filename, sizeof(filename), "%s/maomao/config.conf", + // 如果文件不存在,则使用 /etc/mango/config.conf + snprintf(filename, sizeof(filename), "%s/mango/config.conf", SYSCONFDIR); } } else { - // 使用 MAOMAOCONFIG 环境变量作为配置文件夹路径 - snprintf(filename, sizeof(filename), "%s/config.conf", maomaoconfig); + // 使用 MANGOCONFIG 环境变量作为配置文件夹路径 + snprintf(filename, sizeof(filename), "%s/config.conf", mangoconfig); } set_value_default(); diff --git a/src/config/preset.h b/src/config/preset.h index c1db4d9..e2782ff 100644 --- a/src/config/preset.h +++ b/src/config/preset.h @@ -1,7 +1,7 @@ // TODO: remove this file in the future, replace all global variables with // config.xxx -/* speedie's maomao config */ +/* speedie's mango config */ #define COLOR(hex) \ {((hex >> 24) & 0xFF) / 255.0f, ((hex >> 16) & 0xFF) / 255.0f, \ diff --git a/src/fetch/common.h b/src/fetch/common.h index 16f180d..6f7b076 100644 --- a/src/fetch/common.h +++ b/src/fetch/common.h @@ -27,17 +27,17 @@ int isdescprocess(pid_t p, pid_t c) { } 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') { - snprintf(autostart_path, buf_size, "%s/autostart.sh", maomaoconfig); + if (mangoconfig && mangoconfig[0] != '\0') { + snprintf(autostart_path, buf_size, "%s/autostart.sh", mangoconfig); } else { const char *homedir = getenv("HOME"); if (!homedir) { fprintf(stderr, "Error: HOME environment variable not set.\n"); return NULL; } - snprintf(autostart_path, buf_size, "%s/.config/maomao/autostart.sh", + snprintf(autostart_path, buf_size, "%s/.config/mango/autostart.sh", homedir); } diff --git a/src/maomao.c b/src/mango.c similarity index 99% rename from src/maomao.c rename to src/mango.c index b4f1e34..136bf38 100644 --- a/src/maomao.c +++ b/src/mango.c @@ -4282,7 +4282,7 @@ void create_output(struct wlr_backend *backend, void *data) { void setup(void) { setenv("XCURSOR_SIZE", "24", 1); - setenv("XDG_CURRENT_DESKTOP", "maomao", 1); + setenv("XDG_CURRENT_DESKTOP", "mango", 1); parse_config(); init_baked_points(); @@ -5260,7 +5260,7 @@ int main(int argc, char *argv[]) { else if (c == 'd') log_level = WLR_DEBUG; else if (c == 'v') - die("maomao " VERSION); + die("mango " VERSION); else goto usage; }