tonybtw.com

tonybtw.com

https://git.tonybtw.com/tonybtw.com.git git://git.tonybtw.com/tonybtw.com.git
12,228 bytes raw
1
#+TITLE: MangoWC Installation + Customization Guide
2
#+AUTHOR: Tony, btw
3
#+date: 2025-10-15
4
#+HUGO_TITLE: MangoWC Installation + Customization Guide
5
#+HUGO_FRONT_MATTER_FORMAT: yaml
6
#+HUGO_CUSTOM_FRONT_MATTER: :image "/img/mangowc.png" :showTableOfContents true
7
#+HUGO_BASE_DIR: ~/repos/tonybtw.com
8
#+HUGO_SECTION: tutorial/mangowc
9
#+EXPORT_FILE_NAME: index
10
#+OPTIONS: toc:nil broken-links:mark
11
#+HUGO_AUTO_SET_HEADLINE_SECTION: nil
12
#+DESCRIPTION: This is a quick and painless tutorial on how to setup Hyprland on NixOS using flakes + home manager, and optionally using UWSM (the Universal Wayland Session Manager)
13
14
* Intro
15
What's up guys, my name is Tony, and today I'm gonna give you a quick and painless guide on installing and configuring MangoWC.
16
17
MangoWC is a wayland compositor inspired by DWL, but turned into something much greater. It has adopted new features such as scrolling, scratchpad functionality, overview, gestures, animations, and more. It very well may be the best wayland compositor out there.
18
19
A quote from the developer:
20
#+begin_quote
21
"Mango is as lightweight as dwl, and can be built completely within a few seconds. Despite this, Mango does not compromise on functionality."
22
– DreamMaoMao
23
#+end_quote
24
25
* Install Dependencies for Mango
26
27
Alright so I'm on arch linux, btw, but this is going to work on NixOS, Gentoo, Slackware, etc. I'll leave install instructions for all 3 of those distributions in this written guide in a link below the subscribe button.
28
29
For arch, here are the dependencies we need to install:
30
31
[[https://github.com/DreamMaoMao/mangowc][Mango's Official Github]]
32
33
#+begin_src sh
34
yay -S mangowc-git
35
#+end_src
36
37
** Requirements for MangoWC
38
- glibc
39
- wayland
40
- wayland-protocols
41
- libinput
42
- libdrm
43
- libxkbcommon
44
- pixman
45
- git
46
- meson
47
- ninja
48
- libdisplay-info
49
- libliftoff
50
- hwdata
51
- seatd
52
- pcre2
53
54
** Extra stuff for my setup today:
55
- foot (terminal emulator)
56
- wmenu (a dmenu clone for wayland)
57
- wl-clipboard (wayland clipboard tool)
58
- grim, slurp for screenshots
59
- swaybg (for wallpapers)
60
- firefox (web browser)
61
- ttf-jetbrains-mono-nerd (font)
62
* Installation Guide per Distro:
63
** Arch Linux
64
65
For Arch Linux, installation is straightforward using the AUR:
66
67
#+begin_src sh
68
yay -S mangowc-git
69
#+end_src
70
71
Then install the required dependencies:
72
73
#+begin_src sh
74
sudo pacman -Sy foot wl-clipboard wmenu grim slurp swaybg firefox ttf-jetbrains-mono-nerd
75
#+end_src
76
77
** NixOS
78
79
For NixOS, you'll need to add MangoWC as a flake input to your configuration.
80
First, add the flake input to your =flake.nix=:
81
82
#+begin_src nix
83
{
84
  inputs = {
85
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
86
    mangowc = {
87
      url = "github:DreamMaoMao/mangowc";
88
      inputs.nixpkgs.follows = "nixpkgs";
89
    };
90
  };
91
92
  outputs = { self, nixpkgs, mangowc, ... }: {
93
    nixosConfigurations.yourHostname = nixpkgs.lib.nixosSystem {
94
      system = "x86_64-linux";
95
      modules = [
96
        ./configuration.nix
97
        mangowc.nixosModules.default
98
      ];
99
    };
100
  };
101
}
102
#+end_src
103
104
Then enable MangoWC in your =configuration.nix=:
105
106
#+begin_src nix
107
{ config, pkgs, ... }:
108
109
{
110
  programs.mangowc.enable = true;
111
112
  environment.systemPackages = with pkgs; [
113
    foot
114
    wmenu
115
    wl-clipboard
116
    grim
117
    slurp
118
    swaybg
119
    firefox
120
  ];
121
122
  fonts.packages = with pkgs; [
123
    nerd-fonts.jetbrains-mono
124
  ];
125
}
126
#+end_src
127
128
Rebuild your system:
129
130
#+begin_src sh
131
sudo nixos-rebuild switch --flake .#your_hostname
132
#+end_src
133
134
** Gentoo
135
136
For Gentoo users, you'll need to add MangoWC via an overlay or manually compile it.
137
138
First, install the dependencies:
139
140
#+begin_src sh
141
sudo emerge --ask \
142
  dev-libs/wayland \
143
  dev-libs/wayland-protocols \
144
  gui-libs/wlroots \
145
  dev-libs/libinput \
146
  x11-libs/libdrm \
147
  x11-libs/libxkbcommon \
148
  x11-libs/pixman \
149
  dev-util/meson \
150
  dev-util/ninja \
151
  sys-apps/hwdata \
152
  sys-auth/seatd \
153
  dev-libs/libpcre2 \
154
  gui-apps/foot \
155
  gui-apps/wmenu \
156
  gui-apps/wl-clipboard \
157
  gui-apps/grim \
158
  gui-apps/slurp \
159
  gui-apps/swaybg \
160
  www-client/firefox \
161
  media-fonts/jetbrains-mono
162
#+end_src
163
164
Then clone and build MangoWC from source:
165
166
#+begin_src sh
167
git clone https://github.com/DreamMaoMao/mangowc
168
cd mangowc
169
meson setup build
170
ninja -C build
171
sudo ninja -C build install
172
#+end_src
173
174
* Load MangoWC
175
176
We're in mangowc now by and as you can see, it's literally just a blank screen with a mouse cursor. Super minimal.
177
178
Let's jump into mango's config.conf and get started with some keybinds.
179
So lets hit Alt + Enter to open foot, by defualt.
180
181
Open up .config/mango/config.conf, and lets change a few keybinds, and add a wmenu script.
182
183
#+begin_src conf
184
bind=SUPER,Return,spawn,foot
185
bind=SUPER,q,killclient,
186
bind=SUPER,d,spawn,wmenu-run -l 10
187
#+end_src
188
189
We can reload the config file with Super R. Now we can spawn terminals with Super Enter as we are used to. Alright this is nice, but we can do better. I personally could get by just like this, with no bar, but lets add one.
190
191
Let's add some custom binds for movements, and whatnot later, but for now lets move on to the bar. I encourage you to play around with this file and add/change your binds as needed, and a great place to start especially if you are coming over from dwm is to checkout ArgosNothing's DWM config conversion, and add stuff to it. He made this mango config and this article about it on my website here:
192
https://tonybtw.com/community/mango
193
194
* Waybar + Autostart
195
196
So the file structure for the config directory is gonna be pretty simple today, we're just going to use an autostart.sh, a config.conf, and we'll put waybar's config.jsonc and style.css in here. This will allow you to use waybar with other configs as needed, and not disrupt your other wayland compositor's waybar configs.
197
198
#+begin_src sh
199
/home/tony/.config/mango
200
├── autostart.sh
201
├── config.conf
202
├── config.jsonc
203
├── menu.sh
204
├── rebar.sh
205
└── style.css
206
#+end_src
207
208
I already made a video about waybar, so I'm just going to clone my waybar config and start it up with autostart.sh. If you want guidance on customizing waybar, I encourage you to check out the waybar video.
209
210
#+begin_src
211
git clone https://github.com/tonybanters/waybar
212
cp waybar/* ~/.config/mango/.
213
#+end_src
214
215
And let's add waybar to our autostart.sh
216
217
#+begin_src
218
vim ~/.config/mango/autostart.sh
219
waybar -c ~/.config/mango/config.jsonc -s ~/.config/mango/style.css >/dev/null 2>&1 &
220
#+end_src
221
222
This will tell mango to start up with a wallpaper, and waybar.
223
So we're ready to launch Mango at this point. Let's go ahead and do so, by typing `mango`
224
225
* Wallpaper
226
We need a wallpaper. With swaybg, we can set one, but we need to download one first. so lets open firefox, and head over to wallhaven.cc and pick one from there.
227
228
Let's grab this one, and put it in ~/walls/wall1.png
229
230
Now we can set that with
231
232
#+begin_src sh
233
swaybg -i ~/walls/wall1.png & disown
234
#+end_src
235
236
Let's add disown here so when we close this terminal, our wallpaper persists.
237
238
But we see the issue here, we want this wallpaper to be enabled whenever we launch mangoWC. We can accomplish this simply by adding it to autostart.sh
239
240
#+begin_src sh
241
vim ~/.config/mango/autostart.sh
242
waybar -c ~/.config/mango/config.jsonc -s ~/.config/mango/style.css >/dev/null 2>&1 &
243
swaybg -i ~/walls/wall1.png >/dev/null 2>&1 &
244
#+end_src
245
246
Now if we relaunch mangoWC, we see our wallpaper persists.
247
248
* Screenshot Script
249
We can add a screenshot script here with `grim`, `slurp`, and `wl-copy`
250
251
#+begin_src sh
252
#!/bin/sh
253
grim -l 0 -g "$(slurp)" - | wl-copy
254
#+end_src
255
256
And bind this screenshot in our config.conf here:
257
258
#+begin_src conf
259
bind=SUPER,s,spawn,snip
260
#+end_src
261
262
* My Keybinds:
263
264
Here's a breakdown of all the essential keybinds for MangoWC. These are configured in your =~/.config/mango/config.conf= file:
265
266
** Basic Controls
267
268
| Keybind              | Action              | Description                                      |
269
|----------------------+---------------------+--------------------------------------------------|
270
| =Super + Enter=      | Launch Terminal     | Opens foot terminal emulator                     |
271
| =Super + d=          | Application Launcher| Opens wmenu for launching applications           |
272
| =Super + q=          | Kill Window         | Closes the currently focused window              |
273
| =Super + Shift + r=  | Reload Config       | Reloads the MangoWC configuration file           |
274
| =Super + R=          | Reload Waybar       | Runs the rebar script to restart waybar         |
275
| =Super + s=          | Screenshot          | Takes a screenshot of selected area (using snip.sh) |
276
277
** Workspace Management
278
279
| Keybind         | Action          | Description                              |
280
|-----------------+-----------------+------------------------------------------|
281
| =Super + 1-9=   | Switch Tag      | Switches to workspace/tag 1 through 9    |
282
| =Super + i=     | Increase Master | Adds one more window to master area      |
283
| =Super + p=     | Decrease Master | Removes one window from master area      |
284
| =Super + 0=     | Toggle Overview | Shows overview of all windows/workspaces |
285
286
** Window Management
287
288
| Keybind                 | Action       | Description                              |
289
|-------------------------+--------------+------------------------------------------|
290
| =Super + j=             | Focus Next   | Focuses the next window in the stack     |
291
| =Super + k=             | Focus Previous | Focuses the previous window in the stack |
292
| =Super + h=             | Focus Left   | Focuses the window to the left           |
293
| =Super + l=             | Focus Right  | Focuses the window to the right          |
294
| =Super + Shift + j=     | Swap Down    | Swaps current window with the one below  |
295
| =Super + Shift + k=     | Swap Up      | Swaps current window with the one above  |
296
| =Super + Shift + h=     | Swap Left    | Swaps current window with the one on the left |
297
| =Super + Shift + l=     | Swap Right   | Swaps current window with the one on the right |
298
| =Ctrl + Shift + j/k/h/l= | Smart Move   | Moves window in specified direction      |
299
300
** Layout Controls
301
302
| Keybind             | Action           | Description                             |
303
|---------------------+------------------+-----------------------------------------|
304
| =Super + t=         | Tile Layout      | Sets layout to tiled mode               |
305
| =Super + v=         | Vertical Grid    | Sets layout to vertical grid            |
306
| =Super + c=         | Spiral Layout    | Sets layout to spiral mode              |
307
| =Super + x=         | Scroller Layout  | Sets layout to scroller mode            |
308
| =Super + n=         | Switch Layout    | Cycles through available layouts        |
309
| =Super + a=         | Toggle Gaps      | Toggles window gaps on/off              |
310
| =Super + f=         | Toggle Float     | Toggles floating mode for current window |
311
| =Super + Shift + f= | Toggle Fullscreen | Toggles fullscreen for current window   |
312
313
** Mouse Bindings
314
315
| Keybind                | Action        | Description                              |
316
|------------------------+---------------+------------------------------------------|
317
| =Super + Left Click=   | Move Window   | Click and drag to move floating windows  |
318
| =Super + Right Click=  | Resize Window | Click and drag to resize windows         |
319
320
** Touchpad Gestures
321
322
| Gesture                          | Action          | Description                              |
323
|----------------------------------+-----------------+------------------------------------------|
324
| 3-finger swipe left/right/up/down | Focus Direction | Focuses window in the swipe direction    |
325
| 4-finger swipe left              | Previous Tag    | Switches to previous tag with clients    |
326
| 4-finger swipe right             | Next Tag        | Switches to next tag with clients        |
327
| 4-finger swipe up/down           | Toggle Overview | Shows/hides workspace overview           |
328
* Final Thoughts
329
Thanks so much for checking out this tutorial. If you got value from it, and you want to find more tutorials like this, check out
330
my youtube channel here: [[https://youtube.com/@tony-btw][YouTube]], or my website here: [[https://www.tonybtw.com][tony,btw]]
331
332
You can support me here: [[https://ko-fi.com/tonybtw][kofi]]