Louvre  v1.2.1-2
C++ library for Wayland compositors
🕹️ Examples

Louvre provides three illustrative examples that demonstrate its capabilities and various usage scenarios:

To run any example, switch to a free TTY session using the CTRL + ALT + [F1,...,F10] key combination or execute the $ sudo chvt N command, where N represents the desired TTY number. Then, proceed to execute the compositor command.

louvre-views

The louvre-views example replicates the appearance of macOS X. It showcases the implementation of server-side decorations and demonstrates how to leverage the Louvre::LScene and Louvre::LView classes to handle tasks such as damage calculation, painting, and input event dispatching on your behalf. This compositor includes a dock for adding applications and presenting minimized windows. Furthermore, it provides the capability to turn windows into fullscreen mode within a designated workspace and navigate between them via a three-finger swipe or by using the keyboard shortcut Ctrl + Alt + [Left/Right arrow keys], closely resembling the behavior seen in macOS.

Screenshot

The dock icons featured in the screenshot were sourced from macOSicons.

Keyboard Shortcuts

  • Shift + Ctrl + Esc : Terminates the compositor.
  • Shift + Ctrl + 3 : Captures a screenshot and saves it on your desktop.
  • F1 : Launches weston-terminal.
  • Ctrl + Alt + [F1,...,F10] : Switches to another TTY.
  • Ctrl + Alt + [Left/Right arrow keys] : Navigates to the left or right workspace. If supported, you can use three or more fingers on your touchpad.
  • Alt + [mouse over maximize button] : While hovering the cursor over a server-side decorated toplevel window, press Alt to maximize the window instead of setting it to fullscreen mode.
  • Super + Shift + V : Toggles the current output VSync.
  • Super + Shift + T : Changes the current output transform.
  • Super + Shift + [Up/Down arrow keys] : Increments or decrements the current output scale factor by 0.25.

Wallpaper

To set the background wallpaper, simply place an image in the following directory: ~/.config/Louvre/wallpaper.jpg

Dock Apps

To add apps to the dock, follow these instructions:

  1. Create a file named apps.list in the ~/.config/Louvre/ directory if it doesn't already exist.
  2. Each app entry in the apps.list file should consist of three lines:
  • The application name: This name will be displayed in the popup when you hover over the app icon and in the top bar when the app is active.
  • Run command: Specify the command to launch the app. If the command requires environment variables or other parameters, consider creating a Bash script and pointing to that script file.
  • Icon Path: Provide the full path to the app's icon.

Here's an example format for apps.list:

App 1 Name
app1-run-command
/full/path/to/app1_icon.png
App 2 Name
app2-run-command
/full/path/to/app2_icon.png

Ensure that there are no empty lines between entries or at the begining/end of the file.

Note: While using .desktop files is recommended for a more standardized approach, this example simplifies the process for demonstration purposes and avoids the need for linking to additional libraries like GLib or Qt to parse .desktop information and icons.

louvre-weston-clone

The louvre-weston-clone example resembles a Weston-like compositor, showcasing the efficient use of Louvre::LPainter. It optimally repaints only the content that requires updating, taking surface damage and opaque/translucent regions into consideration.

Screenshot

Keyboard Shortcuts

  • Shift + Ctrl + Esc : Terminates the compositor.
  • Shift + Ctrl + 3 : Captures a screenshot and saves it to your desktop.
  • F1 : Launches weston-terminal.
  • Ctrl + Alt + [F1,...,F10] : Switches to another TTY.

Wallpaper

To set the background wallpaper, simply place an image in the following directory: ~/.config/Louvre/wallpaper.jpg

louvre-default

This example demonstrates Louvre's default behavior: a basic compositor with a white background for user interaction with applications. It uses Louvre::LPainter for rendering but in a non-efficient way as it clears and repaints the entire screen each frame.

Screenshot

Keyboard Shortcuts

  • Shift + Ctrl + Esc : Terminates the compositor.
  • Shift + Ctrl + 3 : Captures a screenshot and saves it to your desktop.
  • F1 : Launches weston-terminal.
  • Ctrl + Alt + [F1,..,F10] : Switches to another TTY.