Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 63 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MangoWC

<img width="255" height="256" alt="mango-transparency-256" src="https://github.com/DreamMaoMao/mangowc/blob/main/assets/mango-transparency-256.png" />

# Mango Wayland Compositor
<div>
<img src="https://github.com/DreamMaoMao/mangowc/blob/main/assets/mango-transparency-256.png" alt="MangoWC Logo" width="120"/>
</div>

This project's development is based on [dwl](https://codeberg.org/dwl/dwl/).

Expand All @@ -23,25 +23,22 @@ This project's development is based on [dwl](https://codeberg.org/dwl/dwl/).
- Ipc support(get/send message from/to compositor by external program)
- Hycov-like overview
- Window effects from scenefx (blur, shadow, corner radius, opacity)
- Zero flickering - every frame is perfect.

Master-Stack Layout

https://github.com/user-attachments/assets/a9d4776e-b50b-48fb-94ce-651d8a749b8a
https://github.com/user-attachments/assets/bb83004a-0563-4b48-ad89-6461a9b78b1f

Scroller Layout
# Mango's Vision

https://github.com/user-attachments/assets/c9bf9415-fad1-4400-bcdc-3ad2d76de85a
**Mango's primary goal is stability**: After months of testing and development—and aside from a few lingering GPU compatibility issues—it should now be stable enough. I don't plan on making many breaking changes.

Layer animation

https://github.com/user-attachments/assets/014c893f-115c-4ae9-8342-f9ae3e9a0df0
**Mango's preference is practicality**: I tend to add features that genuinely help with daily workflows—things that make our work more convenient.

**Mango won't cater to every user preference**: For niche feature requests, I'll take a wait-and-see approach. I'll only consider adding them if they get a significant number of upvotes.

# Our discord
[mangowc](https://discord.gg/CPjbDxesh5)

# Supported layouts

- tile
- scroller
- monocle
Expand All @@ -51,21 +48,20 @@ https://github.com/user-attachments/assets/014c893f-115c-4ae9-8342-f9ae3e9a0df0
- vertical_tile
- vertical_grid
- vertical_scroller
- tgmix

# Installation

[![Packaging status](https://repology.org/badge/vertical-allrepos/mangowc.svg)](https://repology.org/project/mangowc/versions)

## Dependencies

- glibc
- wayland
- wayland-protocols
- libinput
- libdrm
- libxkbcommon
- pixman
- git
- meson
- ninja
- libdisplay-info
- libliftoff
- hwdata
Expand All @@ -75,7 +71,7 @@ https://github.com/user-attachments/assets/014c893f-115c-4ae9-8342-f9ae3e9a0df0
- libxcb

## Arch Linux
The package is in the Arch User Repository and is availble for manual download [here](https://aur.archlinux.org/packages/mangowc-git) or through a AUR helper like yay:
The package is in the Arch User Repository and is available for manual download [here](https://aur.archlinux.org/packages/mangowc-git) or through a AUR helper like yay:
```bash
yay -S mangowc-git

Expand Down Expand Up @@ -108,6 +104,43 @@ Then, install the package:
```bash
dnf install mangowc
```
## OpenSUSE
The package is in the third-party obs repository.

install the package:

```bash
sudo zypper install opi
opi install mangowc
```
## Guix System
The package definition is described in the source repository.
First, add `mangowc` channel to `channels.scm` file:

```scheme
;; In $HOME/.config/guix/channels.scm
(cons (channel
(name 'mangowc)
(url "https://github.com/DreamMaoMao/mangowc.git")
(branch "main"))
... ;; Your other channels
%default-channels)
```

Then, run `guix pull` and after update you can either run
`guix install mangowc` or add it to your configuration via:

```scheme
(use-modules (mangowc)) ;; Add mangowc module

;; Add mangowc to packages list
(packages (cons*
mangowc-git
... ;; Other packages you specified
%base-packages))
```

And then rebuild your system.

## Other

Expand Down Expand Up @@ -285,3 +318,15 @@ Read The Friendly Manual on packaging software in your distribution first.
- https://github.com/swaywm/sway - Sample of Wayland protocol

- https://github.com/wlrfx/scenefx - Make it simple to add window effect.


# Sponsor
At present, I can only accept sponsorship through an encrypted connection.
If you find this project helpful to you, you can offer sponsorship in the following ways.

<img width="650" height="870" alt="image" src="https://github.com/user-attachments/assets/8c860317-90d2-4071-971d-f1a92b674469" />


Thanks to the following friends for their sponsorship of this project

[@tonybanters](https://github.com/tonybanters)
7 changes: 3 additions & 4 deletions config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ focused_opacity=1.0
unfocused_opacity=1.0

# Animation Configuration(support type:zoom,slide)
# tag_animation_direction: 0-horizontal,1-vertical
# tag_animation_direction: 1-horizontal,0-vertical
animations=1
layer_animations=1
animation_type_open=slide
Expand Down Expand Up @@ -240,12 +240,11 @@ bind=CTRL+ALT,Left,resizewin,-50,+0
bind=CTRL+ALT,Right,resizewin,+50,+0

# Mouse Button Bindings
# NONE mode key only work in ov mode
# btn_left and btn_right can't bind none mod key
mousebind=SUPER,btn_left,moveresize,curmove
mousebind=NONE,btn_middle,togglemaximizescreen,0
mousebind=SUPER,btn_right,moveresize,curresize
mousebind=NONE,btn_left,toggleoverview,1
mousebind=NONE,btn_right,killclient,0


# Axis Bindings
axisbind=SUPER,UP,viewtoleft_have_client
Expand Down
1 change: 1 addition & 0 deletions mango.desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[Desktop Entry]
Encoding=UTF-8
Name=Mango
DesktopNames=mango;wlroots
Comment=mango WM
Exec=mango
Icon=mango
Expand Down
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('mango', ['c', 'cpp'],
version : '0.10.8',
version : '0.12.3',
)

subdir('protocols')
Expand Down Expand Up @@ -56,7 +56,7 @@ endif
if is_git_repo
# 如果是 Git 目录,获取 Commit Hash 和最新的 tag
commit_hash = run_command(git, 'rev-parse', '--short', 'HEAD', check : false).stdout().strip()
latest_tag = run_command(git, 'describe', '--tags', '--abbrev=0', check : false).stdout().strip()
latest_tag = meson.project_version()
version_with_hash = '@0@(@1@)'.format(latest_tag, commit_hash)
else
# 如果不是 Git 目录,使用项目版本号和 "release" 字符串
Expand Down
4 changes: 2 additions & 2 deletions mmsg/arg.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

extern char *argv0;

/* use main(int argc, char *argv[]) */
/* use main(int32_t argc, char *argv[]) */
#define ARGBEGIN \
for (argv0 = *argv, argv++, argc--; \
argv[0] && argv[0][0] == '-' && argv[0][1]; argc--, argv++) { \
char argc_; \
char **argv_; \
int brk_; \
int32_t brk_; \
if (argv[0][1] == '-' && argv[0][2] == '\0') { \
argv++; \
argc--; \
Expand Down
92 changes: 64 additions & 28 deletions mmsg/mmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ static enum {
WATCH = 1 << 2 | GET,
} mode = NONE;

static int Oflag;
static int Tflag;
static int Lflag;
static int oflag;
static int tflag;
static int lflag;
static int cflag;
static int vflag;
static int mflag;
static int fflag;
static int qflag;
static int dflag;
static int xflag;
static int eflag;
static int kflag;
static int bflag;
static int Aflag;
static int32_t Oflag;
static int32_t Tflag;
static int32_t Lflag;
static int32_t oflag;
static int32_t tflag;
static int32_t lflag;
static int32_t cflag;
static int32_t vflag;
static int32_t mflag;
static int32_t fflag;
static int32_t qflag;
static int32_t dflag;
static int32_t xflag;
static int32_t eflag;
static int32_t kflag;
static int32_t bflag;
static int32_t Aflag;

static uint32_t occ, seltags, total_clients, urg;

static char *output_name;
static int tagcount;
static int32_t tagcount;
static char *tagset;
static char *layout_name;
static int layoutcount, layout_idx;
static int32_t layoutcount, layout_idx;
static char *client_tags;
static char *dispatch_cmd;
static char *dispatch_arg1;
Expand Down Expand Up @@ -87,7 +87,7 @@ static void noop_description(void *data, struct wl_output *wl_output,

// 将 n 转换为 9 位二进制字符串,结果存入 buf(至少长度 10)
void bin_str_9bits(char *buf, uint32_t n) {
for (int i = 8; i >= 0; i--) {
for (int32_t i = 8; i >= 0; i--) {
*buf++ = ((n >> i) & 1) ? '1' : '0';
}
*buf = '\0'; // 字符串结尾
Expand Down Expand Up @@ -324,7 +324,7 @@ static void dwl_ipc_output_frame(void *data,
if (tflag) {
uint32_t mask = seltags;
char *t = tagset;
int i = 0;
int32_t i = 0;

for (; *t && *t >= '0' && *t <= '9'; t++)
i = *t - '0' + i * 10;
Expand Down Expand Up @@ -354,7 +354,7 @@ static void dwl_ipc_output_frame(void *data,
if (cflag) {
uint32_t and = ~0, xor = 0;
char *t = client_tags;
int i = 0;
int32_t i = 0;

for (; *t && *t >= '0' && *t <= '9'; t++)
i = *t - '0' + i * 10;
Expand Down Expand Up @@ -500,16 +500,52 @@ static const struct wl_registry_listener registry_listener = {

static void usage(void) {
fprintf(stderr,
"usage:"
"\t%s [-OTLq]\n"
"\t%s [-o <output>] -s [-t <tags>] [-l <layout>] [-c <tags>] [-d "
"mmsg - MangoWC IPC\n"
"\n"
"SYNOPSIS:\n"
"\tmmsg [-OTLq]\n"
"\tmmsg [-o <output>] -s [-t <tags>] [-l <layout>] [-c <tags>] [-d "
"<cmd>,<arg1>,<arg2>,<arg3>,<arg4>,<arg5>]\n"
"\t%s [-o <output>] (-g | -w) [-OotlcvmfxekbA]\n",
argv0, argv0, argv0);
"\tmmsg [-o <output>] (-g | -w) [-OotlcvmfxekbA]\n"
"\n"
"OPERATION MODES:\n"
"\t-g Get values (tags, layout, focused client)\n"
"\t-s Set values (switch tags, layouts)\n"
"\t-w Watch mode (stream events)\n"
"\n"
"GENERAL OPTIONS:\n"
"\t-O Get all output (monitor) information\n"
"\t-T Get number of tags\n"
"\t-L Get all available layouts\n"
"\t-q Quit MangoWC\n"
"\t-o <output> Select output (monitor)\n"
"\n"
"GET OPTIONS (used with -g or -w):\n"
"\t-O Get output name\n"
"\t-o Get output (monitor) focus information\n"
"\t-t Get selected tags\n"
"\t-l Get current layout\n"
"\t-c Get title and appid of focused clients\n"
"\t-v Get visibility of statusbar\n"
"\t-m Get fullscreen status\n"
"\t-f Get floating status\n"
"\t-x Get focused client geometry\n"
"\t-e Get name of last focused layer\n"
"\t-k Get current keyboard layout\n"
"\t-b Get current keybind mode\n"
"\t-A Get scale factor of monitor\n"
"\n"
"SET OPTIONS (used with -s):\n"
"\t-o <output> Select output (monitor)\n"
"\t-t <tags> Set selected tags (can be used with [+-^.] "
"modifiers)\n"
"\t-l <layout> Set current layout\n"
"\t-c <tags> Get title and appid of focused client\n"
"\t-d <cmd>,<args...> Dispatch internal command (max 5 args)\n");
exit(2);
}

int main(int argc, char *argv[]) {
int32_t main(int32_t argc, char *argv[]) {
ARGBEGIN {
case 'q':
qflag = 1;
Expand Down
2 changes: 1 addition & 1 deletion protocols/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
wayland_scanner = find_program('wayland-scanner')
wayland_protos_dep = dependency('wayland-protocols')
wl_protocol_dir = wayland_protos_dep.get_pkgconfig_variable('pkgdatadir')
wl_protocol_dir = wayland_protos_dep.get_variable(pkgconfig:'pkgdatadir')
wayland_scanner_code = generator(
wayland_scanner,
output: '@BASENAME@-protocol.c',
Expand Down
Loading