Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Elektra specification file #829

Closed
Closed
Changes from 26 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5cfffbb
Add libelektra specification that corresponds to currently supported …
Jul 20, 2021
a460cf8
Remove deprecated configuration value "transition" from specification
Jul 20, 2021
8cc96b7
Revise naming and hierarchy
Jul 20, 2021
5e25918
Change to types that better match possible values
Jul 20, 2021
62897f3
Add metadata for required plugins
Jul 21, 2021
558c1e2
Add default values
Jul 21, 2021
6a9936c
Add "range" metadata
Jul 21, 2021
9dd2fcc
Replace regex for time values by check/date
Jul 21, 2021
5381b57
Add "require" metadata
Jul 21, 2021
b8cfdd1
Remove prefix "redshift/" from key names
Jul 21, 2021
b13b051
Revise TODOs
Jul 21, 2021
4963eba
Remove infos/plugins (see https://github.com/jonls/redshift/pull/829#…
Jul 22, 2021
c00dea1
Add explanation and links about specification files
Jul 22, 2021
a4ee0a9
Improve naming and hierarchy of keys
Jul 22, 2021
7f32a6b
Add missing example, default and require
Jul 22, 2021
0ad584c
Add link to documentation for adjustment method
Jul 22, 2021
d1b785d
Improve hierarchy of keys
Jul 22, 2021
5bab4e6
Merge duplicate values randr/crtc resp. drm/crtc and randr/screen res…
Jul 23, 2021
e50c21d
Improve descriptions of brightness/day and brightness/night
Jul 23, 2021
a18c2c6
Fix wrong type and check of gamma, gamma/night and gamma/day
Jul 23, 2021
3d9241c
Add note about environment variables
Jul 23, 2021
5a34613
Add CLI arguments to spec file
Jul 23, 2021
d345ea3
Add opt/arg = required
Jul 23, 2021
7bc88e1
Add newline at end of file.
Jul 29, 2021
bce2269
Remove obsolete comment, the parts of lcdprocs spec file have been re…
Jul 29, 2021
d88215c
Improve comments and configuration setting descriptions
Jul 29, 2021
918f66c
Add support for single value gamma values and improve descriptions an…
Aug 5, 2021
83f5b3a
Add default option "auto" for adjustment/method and provider/location…
Aug 5, 2021
64a188b
Fix type of enum keys
Aug 5, 2021
034b2cf
Add missing check/type for float keys
Aug 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
233 changes: 233 additions & 0 deletions src/elektra/redshift.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
; Elektra specification file for redshift@490ba2aae9cfee097a88b6e2be98aeb1ce990050 (= redshift v1.12 + some small commits)
;
; A specification file describes which configuration settings an application supports, their defaults and their associated CLI options. It also "(...) defines how the configuration settings should be validated" (source: https://www.libelektra.org/tutorials/validate-configuration)
; For details see: https://www.libelektra.org/tutorials/writing-a-specification-for-your-configuration)

qwepoizt marked this conversation as resolved.
Show resolved Hide resolved
; Redshift uses no environment variables.

[]
mountpoint = redshift.ecf

[temp/day]
type = unsigned_short
description = The color temperature the screen should have during daytime.
default = 6500
example = 6500
opt/long = temp-day
opt/arg = required

[temp/night]
type = unsigned_short
description = The color temperature the screen should have during nighttime.
default = 4500
example = 4500
opt/long = temp-night
opt/arg = required

[fade]
type = boolean
description = Whether transitions between color temperatures (e.g. from daytime to nighttime) should happen fast or slow.
default = 1
example = 0
opt = f
opt/long = fade
opt/arg = none

[brightness]
type = float
description = The screen brightness.
default = 1.0
example = 0.8
check/range = 0-1
opt = b
opt/long = brightness
opt/arg = required

[brightness/day]
type = float
description = The screen brightness during daytime. If both day and night brightness are set, these will overrule the value of brightness.
default = 1.0
example = 0.8
check/range = 0-1
opt/long = brightness-day
opt/arg = required

[brightness/night]
type = float
description = The screen brightness during nighttime. If both day and night brightness are set, these will overrule the value of brightness.
default = 1.0
example = 0.8
check/range = 0-1
opt/long = brightness-night
opt/arg = required

[gamma]
type = string
description = The screen gamma.
default = 1.0:1.0:1.0
example = 0.9:0.9:0.9
; Regex checks that value is of format "float:float:float". Adapted from https://www.regular-expressions.info/floatingpoint.html
qwepoizt marked this conversation as resolved.
Show resolved Hide resolved
check/validation = ^([0-9]*[\.,]?[0-9]+):([0-9]*[\.,]?[0-9]+):([0-9]*[\.,]?[0-9]+)$
opt = g
opt/long = gamma
opt/arg = required

[gamma/day]
type = string
description = The screen gamma during daytime.
default = 1.0:1.0:1.0
example = 0.9:0.9:0.9
; Regex checks that value is of format "float:float:float". Adapted from https://www.regular-expressions.info/floatingpoint.html
check/validation = ^([0-9]*[\.,]?[0-9]+):([0-9]*[\.,]?[0-9]+):([0-9]*[\.,]?[0-9]+)$
opt/long = gamma-day
opt/arg = required

[gamma/night]
type = string
description = The screen gamma during nighttime.
default = 1.0:1.0:1.0
example = 0.9:0.9:0.9
; Regex checks that value is of format "float:float:float". Adapted from https://www.regular-expressions.info/floatingpoint.html
check/validation = ^([0-9]*[\.,]?[0-9]+):([0-9]*[\.,]?[0-9]+):([0-9]*[\.,]?[0-9]+)$
opt/long = gamma-night
opt/arg = required

[adjustment/method]
type = string
qwepoizt marked this conversation as resolved.
Show resolved Hide resolved
check/enum = #5
check/enum/#0 = drm
check/enum/#1 = dummy
check/enum/#2 = quartz
check/enum/#3 = randr
check/enum/#4 = vidmode
check/enum/#5 = w32gdi
description = The method used to adjust screen color temperature. For details see section "Alternative Features" in file DESIGN in root directory.
require =
example = randr
; default = w32gdi - For Windows the default is the only supported method 'w32gdi'
; default = randr - For Linux the default is 'randr'
; default = quartz - For macOS the default is 'quartz'
opt = m
opt/long = method
opt/arg = required

[provider]
type = string
check/enum = #1
check/enum/#0 = time
check/enum/#1 = location
description = The provider used to decide at what times of day redshift should be enabled/disabled. Currently two options are supported: 1. location - determines the user's location and enable/disable redshift depending on the solar elevation. 2. time: Ignore user location and enable redshift if time is between dusk and dawn.
default = location
example = time
opt/long = provider
opt/arg = required

[provider/time/dawn]
type = string
check/date = ISO8601
check/date/format = timeofday
qwepoizt marked this conversation as resolved.
Show resolved Hide resolved
description = Instead of using the solar elevation at the user's location, the time intervals of dawn and dusk can be specified manually (source: https://github.com/jonls/redshift/wiki/Configuration-file#custom-dawndusk-intervals).
default = 05:00
example = 06:00
opt/long = time-dawn
opt/arg = required

[provider/time/dusk]
type = string
check/date = ISO8601
check/date/format = timeofday
description = Instead of using the solar elevation at the user's location, the time intervals of dawn and dusk can be specified manually (source: https://github.com/jonls/redshift/wiki/Configuration-file#custom-dawndusk-intervals).
default = 19:00
example = 20:00
opt/long = time-dusk
opt/arg = required

[provider/location]
type = string
check/enum = #2
check/enum/#0 = corelocation
check/enum/#1 = geoclue2
check/enum/#2 = manual
description = The location provider to be used. The provider is used to establish whether it is currently daytime or nighttime.
default = manual
qwepoizt marked this conversation as resolved.
Show resolved Hide resolved
example = geoclue2
opt/long = location-provider
opt/arg = required

[provider/location/elevation/high]
type = float
description = By default, Redshift will use the current elevation of the sun to determine whether it is daytime, night or in transition (dawn/dusk). When the sun is above the degrees specified with the elevation-high key it is considered daytime and below the elevation-low key it is considered night (source: https://github.com/jonls/redshift/wiki/Configuration-file#solar-elevation-thresholds). Affects all location providers.
default = 3.0
example = 3.5
opt/long = elevation-high
opt/arg = required

[provider/location/elevation/low]
type = float
description = By default, Redshift will use the current elevation of the sun to determine whether it is daytime, night or in transition (dawn/dusk). When the sun is above the degrees specified with the elevation-high key it is considered daytime and below the elevation-low key it is considered night (source: https://github.com/jonls/redshift/wiki/Configuration-file#solar-elevation-thresholds). Affects all location providers.
default = -6.0
example = -5.0
opt/long = elevation-low
opt/arg = required

[provider/location/manual/lat]
type = float
description = The location latitude. Only applies to location provider "manual".
check/range = -90.0-90.0
; Latitude of berlin:
example = 52.520008
; No default is provided, so that users are made aware they need to set their own location. A default would irritate users with an actual location that is not equal to the default.
require =
opt/long = lat
opt/arg = required

[provider/location/manual/lon]
type = float
description = The location longitude. Only applies to location provider "manual".
check/range = -180.0-180.0
; Longitude of berlin:
example = 13.404954
; No default is provided, so that users are made aware they need to set their own location. A default would irritate users with an actual location that is not equal to the default.
require =
opt/long = lon
opt/arg = required

; Note: other location providers have no config parameters/cli arguments

; BEGIN Settings used by randr and drm
;=======================================================
[adjustment/crtc]
type = unsigned_short
description = CRTC to apply adjustments to.
default = 0
example = 1
opt/long = crtc
opt/arg = required
;=======================================================
; END Settings used by randr and drm

; BEGIN Settings used by randr and vidmode
;=======================================================
[adjustment/screen]
type = unsigned_short
description = X screen to apply adjustments to.
default = 0
example = 1
opt/long = screen
opt/arg = required
;=======================================================
; END Settings used by randr and vidmode

; BEGIN Settings used by drm
;=======================================================
[adjustment/drm/card]
type = unsigned_short
description = Graphics card to apply adjustments to.
default = 0
example = 1
opt/long = drm-card
opt/arg = required
;=======================================================
; END Settings used by drm

; Note: adjustment methods dummy, quartz and w32gdi have no config parameters/cli arguments or none that have an effect.