summaryrefslogtreecommitdiff
path: root/README.md
blob: 05054c82e16b37f4bf85019d846a7e7560919751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<div align="center">
    <img src="images/sxwm_logo.png" width="30%">
</div>

<p align="center">
<h3>High Performance</h3>
<h3>Easy Config</h3>
</p>

<details>
<summary><h2>Patch Notes</h2></summary>
### v1.1.1
- **NEW**: *Xinerama Support*, *Can swap windows holding Mod + Shift + Dragging*.
- **FIXED**: New windows in `global_floating` mode will spawn in the middle.
</details>

<a href="1"><img src="images/1.png" width="45%" align="right"></a>

Here we have a **minimal**, **tiling**, and **configurable** window manager.
- **Tiling & Floating**: Seamlessly switch between layouts.
- **Workspaces**: Workspaces work with your bar.
- **Bars work too**: BAR BAR BAR?! Why not try [sxbar](https://github.com/uint23/sxbar)
- **Lightweight**: Single C file plus a small header and config.
- **Easy Config**: All settings in `config`.
<br>

<a href="2"><img src="images/2.png" width="45%" align="right"></a>

- **Master-Stack**: Use the DWM native and super productive layout.
- **Keyboard-driven**: Full coverage via `MOD` + keys.
- **Mouse Support**: Focus under cursor, move, swap & resize with mouse.
- **Zero Dependencies**: Only requires `libX11`.
- **Compiles on a Toaster**: As long as it has a decently modern compiler.

<br clear="right">

---

## Default Configuration

All options reside in `config` (which is just a header-file) with clear comments.
Keybindings are also easy to understand and quick to implement.
No more bindsym or C code
```c
CMD(terminal,  "st");
CMD(browser,   "firefox");

static const Binding binds[] =
{
/*————< MODIFIER(S) >< KEY >—————< FUNCTION >——*/

/*———————< Here are your functions calls >————— — */

	CALL(MOD|SHIFT,     e,          quit),
	CALL(MOD|SHIFT,     q,          close_focused),

	CALL(MOD,           j,          focus_next),
	CALL(MOD, 			k,          focus_prev),

	CALL(MOD|SHIFT,     j,          move_master_next),
	CALL(MOD|SHIFT,     k,          move_master_prev),

	CALL(MOD,           equal,      inc_gaps),
	CALL(MOD,           minus,      dec_gaps),

	CALL(MOD,           space,      toggle_floating),
	CALL(MOD|SHIFT,     space,      toggle_floating_global),
   .....
```

---

## Default Keybindings

**Window Management**

| Combo                        | Action                    |
| ---------------------------- | ------------------------- |
| `Mouse`                      | Focus under cursor        |
| `MOD` + `Left Mouse`         | Move window by mouse      |
| `MOD` + `Right Mouse`        | Resize window by mouse    |
| `MOD` + `j` / `k`            | Focus next / previous     |
| `MOD` + `Shift` + `j` / `k`  | Move in master stack      |
| `MOD` + `Space`              | Toggle floating           |
| `MOD` + `Shift` + `Space`    | Toggle all floating       |
| `MOD` + `=` / `-`            | Inc/Dec gaps              |
| `MOD` + `f`                  | Fullscreen toggle         |
| `MOD` + `c`                  | Center window             |
| `MOD` + `q`                  | Close focused window      |
| `MOD` + `1-9`                | Switch workspace 1–9      |
| `MOD` + `Shift` + `1-9`      | Move window to WS 1–9     |

**Programs**

| Combo                | Action     | Programs (by default)   |
| -------------------- | ---------- | --------- |
| `MOD` + `Return`     | Terminal   | `st`      |
| `MOD` + `b`          | Browser    | `firefox` |

---

## Dependencies

- `libX11` (Xorg client library) `Xinerama` (if you want multi-monitor support)
- GCC / Clang & Make

---

## Makefile Targets

Below are the available `make` targets for streamlining common tasks:

| Target           | Description                                                         |
| ---------------- | ------------------------------------------------------------------- |
| `make` or `make all` | Compile the source files into the `sxwm` binary.                |
| `make clean`     | Remove object files (`*.o`) and build artifacts.                    |
| `make install`   | Install `sxwm` to `$(PREFIX)/bin` (default `/usr/local/bin`).       |
| `make uninstall` | Remove the installed binary from `$(PREFIX)/bin`.                   |
| `make clean install` | Runs `make clean` then `make install`.                          |

> You can override the install directory by specifying `PREFIX` or `DESTDIR`, for example:
> ```sh
> make install PREFIX=$HOME/.local
> ```

---

## Installation

### Arch linux - AUR

   ```bash
   yay -S sxwm
   ```

### Build from source

1. **Clone repository**

   ```bash
   git clone --depth=1 https://github.com/uint23/sxwm.git
   cd sxwm/
   make
   sudo make clean install
   ```

2. **Run**

   Add `sxwm` to `~/.xinitrc`:
   ```bash
   exec sxwm
   ```

---

## Thanks & Inspiration

- [dwm](https://dwm.suckless.org) - Tiling & source code
- [i3](https://i3wm.org) - Making configuring easy
- [sowm](https://github.com/dylanaraps/sowm) - README inspo :)
- [tinywm](http://incise.org/tinywm.html) - idk, just cool to see how a wm works

---

<p align="center">
  <em>Contributions welcome! Open issues or submit PRs.</em>
</p>