Debian Codegraph @

etc/UPower.conf.d/README.md

raw
1 # UPower Configuration Override
2
3 The configuration in UPower.conf.d will override the primary configuration
4 in UPower.conf.
5
6 The primary method for overriding settings in the main UPower.conf file is by placing configuration snippets in the `/etc/UPower/UPower.conf.d/` directory.
7
8 ## The format of filename
9
10 For a file to be correctly processed as an override, its filename must adhere to a strict format:
11
12 - It must start with a two-digit number between `00` and `99`.
13 - It must end with the `.conf` extension.
14 - The middle section can contain `alphanumeric characters`, `dashes`, and `underscores`.
15
16 This format is captured by the regular expression `^([0-9][0-9])-([a-zA-Z0-9-_])*\.conf$`.
17
18 - The valid examples
19
20 ```text
21 01-upower-example.conf
22 02-upower-test-123.conf
23 03-upower-1a2b-3c4D__.conf
24 ```
25
26 - The invalid examples
27
28 ```text
29 0000-upower-abcd1234.conf
30 [email protected]
31 ```
32
33 ## The configuration override
34
35 UPower processes configuration files in sorted order, where settings in later files override identical settings (matching both Group and Key) from previous files, including the main UPower.conf. This hierarchy ensures that local, numerically-prefixed files in the drop-in directory (UPower.conf.d/) take precedence.
36
37 For example, consider `UPower.conf` that contains the defaults:
38
39 ```text
40 PercentageLow=20.0
41 PercentageCritical=5.0
42 PercentageAction=2.0
43 ```
44
45 and there is a file `UPower.conf.d/70-change-percentages.conf`
46 containing settings for all `Percentage*` keys:
47
48 ```text
49 [UPower]
50 PercentageLow=15.0
51 PercentageCritical=10.0
52 PercentageAction=5.0
53 ```
54
55 and another `UPower.conf.d/99-change-percentages-local.conf`
56 containing settings only for `PercentageAction`:
57
58 ```text
59 [UPower]
60 PercentageAction=7.5
61 ```
62
63 First the main `UPower.conf` will be processed, then
64 `UPower.conf.d/70-change-percentages.conf` overriding the defaults
65 of all percentages from the main config file with the given values,
66 and finally `UPower.conf.d/99-change-percentages-local.conf`
67 overriding once again only `PercentageAction`. The final, effective
68 values are:
69
70 ```text
71 PercentageLow=15.0
72 PercentageCritical=10.0
73 PercentageAction=7.5
74 ```
75
76 ## The examples of overriding the default percentage policy values
77
78 ```text
79 [UPower]
80 PercentageLow=25.0
81 PercentageCritical=10.0
82 PercentageAction=5.0
83 ```