All Projects → maximbaz → wluma

maximbaz / wluma

Licence: ISC license
Automatic brightness adjustment based on screen contents and ALS

Programming Languages

rust
11053 projects
Makefile
30231 projects

Projects that are alternatives of or similar to wluma

Turn-Off-the-Lights-Firefox-extension-WebExtensions
Firefox extension (WebExtensions)
Stars: ✭ 19 (-93.45%)
Mutual labels:  night-mode, dark-theme, dark-mode
Midnight Lizard
Сustom color schemes for all websites
Stars: ✭ 406 (+40%)
Mutual labels:  night-mode, dark-theme, brightness
dark-mode
Dark Mode - Chrome extension. Relax your eyes at night and day.
Stars: ✭ 63 (-78.28%)
Mutual labels:  night-mode, dark-theme, dark-mode
nwg-wrapper
Wrapper to display a script output or a text file content on the desktop in sway or other wlroots-based compositors
Stars: ✭ 60 (-79.31%)
Mutual labels:  sway, swaywm, wlroots
Darkreader
Dark Reader Chrome and Firefox extension
Stars: ✭ 12,052 (+4055.86%)
Mutual labels:  night-mode, dark-theme, dark-mode
Lunar
Intelligent adaptive brightness for your external monitors
Stars: ✭ 2,712 (+835.17%)
Mutual labels:  brightness, adaptive-brightness, brightness-control
Turn-Off-the-Lights-Chrome-extension
Chrome extension
Stars: ✭ 81 (-72.07%)
Mutual labels:  night-mode, dark-theme, dark-mode
cute-sway-recorder
SwayWM screen recorder; a GUI for wf-recorder
Stars: ✭ 16 (-94.48%)
Mutual labels:  sway, swaywm, wlroots
funcd
Daemon for functional keys (works without X11)
Stars: ✭ 14 (-95.17%)
Mutual labels:  brightness, backlight, brightness-control
swaystatus
A minimal executable for displaying sway status per second
Stars: ✭ 14 (-95.17%)
Mutual labels:  brightness, backlight, swaywm
Starlight
Automatic macOS Dark/Light shift based on surrounding ambient light.
Stars: ✭ 26 (-91.03%)
Mutual labels:  dark-theme, ambient-light-sensor, ambient-light
DiscordNight
An actual Dark/Nightmode Theme for Discord/BetterDiscord
Stars: ✭ 86 (-70.34%)
Mutual labels:  night-mode, dark-theme
react-mui-pro-starter
Mix of Create React App and Material UI with set of reusable components and utilities to build professional React Applications faster.
Stars: ✭ 14 (-95.17%)
Mutual labels:  night-mode, dark-mode
Jxtheme
A powerful and lightweight and customization theme/skin library for iOS 9+ in swift. 主题、换肤、暗黑模式
Stars: ✭ 220 (-24.14%)
Mutual labels:  night-mode, dark-theme
xfce4-night-mode
XFCE4 plugin: Switch between light and dark variants of a theme
Stars: ✭ 53 (-81.72%)
Mutual labels:  night-mode, dark-mode
Deluminate
An extension for Google Chrome (and Chromium) that inverts the luminance of websites.
Stars: ✭ 211 (-27.24%)
Mutual labels:  night-mode, dark-theme
Halfmoon
Front-end framework with a built-in dark mode and full customizability using CSS variables; great for building dashboards and tools.
Stars: ✭ 2,583 (+790.69%)
Mutual labels:  dark-theme, dark-mode
Slack Theme Cli
A CLI tool for changing Slack's desktop app colors
Stars: ✭ 256 (-11.72%)
Mutual labels:  night-mode, dark-theme
Whatsapp Desktop Dark
Dark mode for WhatsApp desktop official version (Windows & macOS)
Stars: ✭ 664 (+128.97%)
Mutual labels:  night-mode, dark-theme
Jekyll Theme Yat
🎨 Yet another theme for elegant writers with modern flat style and beautiful night/dark mode.
Stars: ✭ 113 (-61.03%)
Mutual labels:  night-mode, dark-theme

wluma

A tool for wlroots-based compositors that automatically adjusts screen brightness based on the screen contents and amount of ambient light around you.

Idea

The app will automatically brighten the screen when you are looking at a dark window (such as a fullscreen terminal) and darken the screen when you are looking at a bright window (such as web browser). The algorithm takes into consideration the amount of ambient light around you, so the same window can be brighter during the day than during the night.

With permission of Lumen's author (the project that inspired me to create this app), I'm reusing a demo GIF:

demo

Usage

Simply launch wluma and continue adjusting your screen brightness as you usually do - the app will learn your preferences.

Performance

The app has minimal impact on system resources and battery life even though it is able to monitor screen contents several times a second. This is achieved by using export-dmabuf Wayland protocol to get access to the screen contents and doing computations entirely on GPU using Vulkan API.

Installation

Packaging status

Use one of the available packages and methods below:

  • Alpine Linux: wluma (from Alpine Edge; it will be available in stable branches since Alpine v3.16)
  • Arch Linux: wluma or wluma-git
  • NixOS: wluma
  • Pre-compiled Github release artifact (it is linked against Vulkan ICD loader, which you must install, and the latest available glibc, which might not work on your machine if your version is too old)
  • Build the app yourself using the instructions below and install it via sudo make install

Build

CI

If you want to build the app yourself, make sure you use latest stable Rust, otherwise you might get compilation errors! Using rustup is perhaps the easiest. Ubuntu needs the following dependencies: sudo apt-get -y install v4l-utils libv4l-dev libudev-dev libvulkan-dev.

Then simply run make build.

Permissions

In order to access backlight devices, wluma must either run as root, or preferrably instead you should add your user to video group (and possibly reboot thereafter).

Configuration

The config.toml in repository represents default config values. To change them, copy the file into $XDG_CONFIG_HOME/wluma/config.toml and adjust as desired.

ALS

Choose whether to use a real IIO-based ambient light sensor ([als.iio]), a webcam-based simulation ([als.webcam]), a time-based simulation ([als.time]) or disable it altogether ([als.none]).

Each of them contains a thresholds field, which comes with good default values. It is there to convert generally exponential lux values into a linear scale to improve the prediction algorithm in wluma. Keys are the raw values from ambient light sensor (maximal value depends on the implementation), values are arbitrary "profiles". wluma will predict the best screen brightness according to the data learned within the same ALS profile.

Displays

Multiple outputs are supported, using backlight (common for internal laptop screens) and ddcutil (for external screens).

Each output is identified by compositor using model, manufacturer and serial number (e.g.eDP-1 'Sharp Corporation 0x14A8 0x00000000' (eDP-1).

The name field in the output config will be matched as a substring, so you are free to put simply eDP-1, or a serial number (if you have two identical external screens). It is your responsibility to make sure that the values you use match uniquely to one output only.

The capturer field will determine how screen contents will be captured. Currently supported values are wlroots (works only on wlroots-based Wayland compositors) and none (ignores screen contents and predicts brightness only based on ALS).

Tip: run wluma with RUST_LOG=debug to see how your outputs are being identified, so that you can choose an appropriate name configuration value.

Run

To run the app, simply launch wluma or use the provided systemd user service.

Debugging

To enable logging, set environment variable RUST_LOG to one of these values: error, warn, info, debug, trace.

For more complex selectors, see env_logger's documentation.

Known issues (help wanted!)

Help is wanted and much appreciated! If you want to implement some of these, feel free to open an issue and I'll provide more details and try to help you along the way.

  • Support for frames with custom DRM modifiers (e.g. multi-planar frames) is currently not implemented. This was recently implemented in mesa and can finally be added to wluma. Until then, a workaround is to export WLR_DRM_NO_MODIFIERS=1 before launching your wlroots-based compositor.
  • Changing screen resolution while wluma is running is not supported yet, and should crash the app. Workaround: restart wluma after changing resolution.
  • Plugging in a screen while wluma is running. Workaround: restart wluma.

Relevant projects

  • lumen: project that inspired me to create this app
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].