|
| 1 | + |
| 2 | +# Blue Light Filter Widget |
| 3 | + |
| 4 | +This widget provides a simple way to toggle a blue light filter using [Redshift](https://github.com/jonls/redshift). It offers an easy mechanism to switch between day and night modes, reducing eye strain during late-night computer use. |
| 5 | + |
| 6 | +| Day Mode | Night Mode | |
| 7 | +|----------|------------| |
| 8 | +| |  | |
| 9 | + |
| 10 | +(I couldn't capture the effect itself) |
| 11 | + |
| 12 | +I usually use every widget with my custom (kinda janky) [wrapper widget](https://github.com/VMatt013/MySetup/blob/Debian/.config/awesome/widgets/margin.lua) to make them look cleaner and more unified. |
| 13 | + |
| 14 | + |
| 15 | +**With wrapper** |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +Clone this repository then add the widget to your wibar: |
| 23 | + |
| 24 | +```lua |
| 25 | +local bluelight_widget = require("awesome-wm-widgets.bluelight-widget") |
| 26 | +local margin = require("awesome-wm-widgets.margin") -- In case you use my wrapper |
| 27 | + |
| 28 | +s.mytasklist, -- Middle widget |
| 29 | + { -- Right widgets |
| 30 | + layout = wibox.layout.fixed.horizontal, |
| 31 | + ... |
| 32 | + bluelight_widget, -- Add the widget here |
| 33 | + margin(bluelight, true), -- Add the widget with my wrapper |
| 34 | + ... |
| 35 | + } |
| 36 | +``` |
| 37 | + |
| 38 | +## Usage |
| 39 | + |
| 40 | +- Click the widget to toggle between **Day Mode** and **Night Mode**. |
| 41 | + - **Day Mode:** Disables the blue light filter. |
| 42 | + - **Night Mode:** Activates the blue light filter with a warm color temperature. |
| 43 | + |
| 44 | +## Customization |
| 45 | + |
| 46 | +You can customize the widget by modifying the following parameters in the widget's source file: |
| 47 | + |
| 48 | +| Name | Default | Description | |
| 49 | +|------------|----------------------------------------|------------------------------------------------------------| |
| 50 | +| `ICON_DIR` | ```awesome-wm-widgets/bluelight-widget/``` | Directory where the widget icons (sun.svg and moon.svg) are stored. | |
| 51 | +| `CMD` | ```redshift``` | Command to run Redshift. | |
| 52 | +| `NIGHT_CMD`| ```-O 2500 -g 0.75``` | Command options for activating Night Mode. | |
| 53 | +| `DAY_CMD` | ```-x``` | Command options for activating Day Mode. | |
| 54 | + |
| 55 | +## Dependencies |
| 56 | + |
| 57 | +- [Redshift](https://github.com/jonls/redshift): Make sure Redshift is installed on your system. |
0 commit comments