Skip to content

Commit

Permalink
documentation: user guide, feature: use any terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkae committed Jan 6, 2024
1 parent 997e371 commit 31474a4
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 16 deletions.
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
**WARNING**: This project is very much a work in progress. I have provided a rough roadmap in the timeline section.
Use at your own risk.
> **Warning**: This project is a work in progress. Only use if you are willing to encounter
> some paper cuts along the way. If you are willing to lend your time to find/fix bugs
> or submit proposals for new feature, it is greatly appreciated.
# miracle
# About
**miracle** is a wayland tiling window manager based on [Mir](https://github.com/MirServer/mir). The tiling features
will be very sway/i3-like for the first iteration, but will diverge in some important ways later on. See the [timeline](#timeline)
will be very sway/i3-like for the first iteration, but will diverge in some important. See the [timeline](#timeline)
section below for the current status and direction.

The ultimate goal of this work is to build an entire desktop envrionment on top of this window manager, but that will remain a
The ultimate goal of this work is to build an entire desktop environment on top of this window manager, but that will remain a
concern for a different repository with a different timeline.

# Building locally
# Building
**From Source**:
```sh
git clone https://github.com/mattkae/miracle.git
cd miracle
Expand All @@ -20,7 +22,7 @@ cmake ..
./bin/miracle-wm
```

# Building the snap
**Snap**:
```sh
cd miracle-wm
snapcraft
Expand All @@ -29,21 +31,25 @@ sudo snap install --dangerous --classic miracle-wm_*.snap

# Running

## On Login
**On login**:

Once installed, you may select the "Miracle WM" option from your display manager before you login (e.g. GDM or LightDM).
In most environments, this presents itself as a little "settings" button after you select your name.

## Hosted on your desktop
**Hosted**:

To run the window manager as a window in your current desktop session, simply run:
```sh
WAYLAND_DISPLAY=wayland-98 miracle-wm
```

Note that this is only useful if you want to test-drive the window manager or do some development on it for yourself.

# Usage
See the [user guide](USERGUIDE.md) for information on how to use the miracle window manager.

# Timeline
## Proof of Concept (Due: January 15th)
Version: 0.1
**Proof of Concept (Due: January 15th)** Version: 0.1

Features:
- [x] Layout new window
Expand All @@ -60,12 +66,13 @@ Features:
- [ ] Handle output deletion
- [x] Handle fullscreen

## Quality of Life + Bugfixes (Due: February 15th)
Version: 0.2
**Quality of Life + Bugfixes (Due: February 15th)** Version: 0.2

Features:
- [ ] Fix major bugs
- [ ] Configuration File
- [ ] Gap size
- [ ] Action key
- [ ] Keybindings
- [ ] Workspaces
- [ ] Moving windows between workspaces
20 changes: 20 additions & 0 deletions USERGUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
> This user manual will keep up to date with the current state of the project.
> Please note that the information in here is likely to change with future release.
# Key Commands
- `Meta + Enter`: Open new terminal
- `Meta + h`: Switch current lane to horizontal layout mode
- `Meta + v`: Switch current lane to vertical layout mode
- `Meta + Shift + Up`: Move selected window up in the tree
- `Meta + Shift + Down`: Move selected window down in the tree
- `Meta + Shift + Left`: Move selected window left in the tree
- `Meta + Shift + Right`: Move selected window right in the tree
- `Meta + Up`: Select the window above the currently selected window
- `Meta + Down`: Select the window below the currently selected window
- `Meta + Left`: Select the window to the left of the currently selected window
- `Meta + Right`: Select the window to the right of the currently selected window

# Pointer
- Hovering over a window will select the window
- Windows may be minimized, maximized, or removed using the toolbar icons
- Window CANNOT be resized or moved with the pointer
41 changes: 38 additions & 3 deletions src/miracle_window_management_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,38 @@ const int MODIFIER_MASK =
mir_input_event_modifier_ctrl |
mir_input_event_modifier_meta;

const std::string TERMINAL = "konsole";
// Note: This list was taken from i3: https://github.com/i3/i3/blob/next/i3-sensible-terminal
// We will want this to be configurable in the future.
const std::string POSSIBLE_TERMINALS[] = {
"x-terminal-emulator",
"mate-terminal",
"gnome-terminal",
"terminator",
"xfce4-terminal",
"urxvt", "rxvt",
"termit",
"Eterm",
"aterm",
"uxterm",
"xterm",
"roxterm",
"termite",
"lxterminal",
"terminology",
"st",
"qterminal",
"lilyterm",
"tilix",
"terminix",
"konsole",
"kitty",
"guake",
"tilda",
"alacritty",
"hyper",
"wezterm",
"rio"
};

template <typename T>
bool is_tileable(T& requested_specification)
Expand Down Expand Up @@ -53,11 +84,15 @@ bool MiracleWindowManagementPolicy::handle_keyboard_event(MirKeyboardEvent const
auto const scan_code = miral::toolkit::mir_keyboard_event_scan_code(event);
auto const modifiers = miral::toolkit::mir_keyboard_event_modifiers(event) & MODIFIER_MASK;

if (action == MirKeyboardAction::mir_keyboard_action_down && (modifiers & mir_input_event_modifier_alt))
if (action == MirKeyboardAction::mir_keyboard_action_down && (modifiers & mir_input_event_modifier_meta))
{
if (scan_code == KEY_ENTER)
{
external_client_launcher.launch({TERMINAL});
for (auto terminal : POSSIBLE_TERMINALS)
{
if (external_client_launcher.launch({terminal}) > 0)
break;
}
return true;
}
else if (scan_code == KEY_V)
Expand Down

0 comments on commit 31474a4

Please sign in to comment.