You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns the current screen brightness as a percentage by default. If you're on Windows it may return a list of values if you have multiple, brightness adjustable monitors.
61
62
Raises `ScreenBrightnessError` upon failure
62
-
###### Arguments:
63
+
64
+
**Arguments:**
63
65
*`verbose_error` - a boolean value to control how much detail any error messages should contain
64
66
*`kwargs` - passed to the OS relevant brightness method
Sets the brightness to `value`. If `value` is a string and contains "+" or "-" then that value is added to/subtracted from the current brightness.
80
84
Raises `ScreenBrightnessError` upon failure
81
-
###### Arguments:
85
+
86
+
**Arguments:**
82
87
*`value` - the level to set the brightness to. Can either be an integer or a string.
83
88
*`force` (Linux only) - if set to `False` then the brightness is never set to less than 1 because on Linux this often turns the screen off. If set to `True` then it will bypass this check
84
89
*`verbose_error` - a boolean value to control how much detail any error messages should contain
85
90
*`kwargs` - passed to the OS relevant brightness method
Fades the brightness from `start` to `finish` in steps of `increment`, pausing for `interval` seconds between each step.
109
116
If it runs in the main thread it will return the final brightness upon success, `ScreenBrightnessError` upon failure. Otherwise it returns the list of thread objects that the process is running in
110
-
###### Arguments:
117
+
118
+
**Arguments:**
111
119
*`finish` - The brightness value to fade to
112
120
*`start` - The value to start from. If not specified it defaults to the current brightness
113
121
*`interval` - The time interval between each step in brightness
114
122
*`increment` - The amount to change the brightness by each step in percent.
115
123
*`blocking` - If set to `False` it fades the brightness in a new thread
To GitHub user `lcharles` for contributing to this project
148
+
To GitHub user [lcharles](https://github.com/lcharles) for contributing to this project
139
149
140
150
## License
141
151
This software is licensed under the [MIT license](https://mit-license.org/)
142
152
143
-
##FAQ
144
-
####Why is there no support for DDC/CI commands on Linux?
153
+
# FAQ
154
+
### Why is there no support for DDC/CI commands on Linux?
145
155
I'm working on it, however, I am struggling to find a way to implement it without root being required every time the program is called.
146
156
If you have any suggestions feel free to raise an [issue](https://github.com/Crozzers/screen_brightness_control/issues),
147
157
[pull request](https://github.com/Crozzers/screen_brightness_control/pulls) or to [ping me an email](mailto:[email protected])
148
158
149
-
####Why do I always get `ScreenBrightnessError` on Linux?
150
-
###### Why this happens:
159
+
### Why do I always get `ScreenBrightnessError` on Linux?
160
+
**Why this happens:**
151
161
The way brightness is adjusted on Linux is the program tries to run shell commands to adjust the brightness.
152
162
The programs it attempts to call are "light", "xrandr" and "xbacklight".
153
163
If none of these programs can be called a `ScreenBrightnessError` is raised
154
-
###### How to fix it:
164
+
**How to fix it:**
155
165
Install light (recommended), xrandr or xbacklight using your system package manager:
156
166
* Arch: `sudo pacman -S light-git` or `sudo pacman -S xorg-xrandr` or `sudo pacman -S xorg-xbacklight`
157
167
* Debian/Ubuntu: [Light install instructions](https://github.com/haikarainen/light) or `sudo apt install x11-server-utils` or `sudo apt install xbacklight`
158
168
* Fedora: `sudo dnf install light` or `sudo dnf install libXrandr` or `sudo dnf install xbacklight`
159
169
160
-
####I call `set_brightness()` and nothing happens on Linux
161
-
###### Why this happens:
170
+
### I call `set_brightness()` and nothing happens on Linux
171
+
**Why this happens:**
162
172
Light requires root access to run, which is usually provided when you manually install it using you package manager.
163
173
If you installed xbacklight or xrandr, it only supports Intel (and sometimes NVidia) graphics, not AMD.
164
-
###### How to fix it:
174
+
**How to fix it:**
165
175
Install Light by following [these steps](https://github.com/haikarainen/light#installation). Make sure to run the install as sudo
166
176
167
-
####Using the `display` kwarg does nothing/creates exceptions on Linux
168
-
###### Why this happens:
177
+
### Using the `display` kwarg does nothing/creates exceptions on Linux
178
+
**Why this happens:**
169
179
The `display` kwarg is only supported by the `Light` and `XRandr` classes, not by `XBacklight`. So if you only have `xbacklight` installed on your system this kwarg will not work
170
-
###### How to fix it:
180
+
**How to fix it:**
171
181
Install light (recommended) or xrandr using your system package manager:
####The model of my monitor/display is not what the program says it is (Windows)
177
-
###### Why this happens:
186
+
### The model of my monitor/display is not what the program says it is (Windows)
187
+
**Why this happens:**
178
188
If your display is a laptop screen and can be adjusted via a Windows brightness slider then there is no easy way to get the monitor model that I am aware of.
179
189
If your display is a desktop monitor with a Virtual Control Panel (VCP) then there is a way to get the actual model, but the function call takes
180
190
anywhere between 1 and 2 seconds to run, which is why it doesn't automatically.
@@ -188,7 +198,7 @@ print(monitor.model_name)
188
198
>'GL2450HM'
189
199
```
190
200
191
-
####When I call `get_brightness()` the returned value isn't what I set it to (Windows)
201
+
### When I call `get_brightness()` the returned value isn't what I set it to (Windows)
192
202
Not all monitors can set the brightness for every value between 0 and 100. Most of them have a number of 'levels' that they can set them to.
193
203
You can likely see this if you open your display settings and very slowly move the brightness slider.
194
204
You can find out your brightness 'levels' by running the following python code:
@@ -201,7 +211,7 @@ print(monitor.Levels)
201
211
print(monitor.Level)
202
212
```
203
213
204
-
##Things to note:
214
+
# Things to note:
205
215
* If you encounter any issues or bugs with this software please do not hesitate to [raise an issue](https://github.com/Crozzers/screen_brightness_control/issues) or to email me [[email protected]](mailto:[email protected])
206
216
* It is unlikely that this project will support MAC in the forseeable future for 3 reasons.
0 commit comments