bctl 0.0.1__tar.gz → 0.0.1.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bctl
3
- Version: 0.0.1
3
+ Version: 0.0.1.dev0
4
4
  Summary: service for simultaneously controlling brightness of laptop & external displays
5
5
  License-Expression: MIT
6
6
  Project-URL: homepage, https://github.com/laur89/bctl
@@ -30,7 +30,9 @@ for screen (dis)connections. Desktop notifications are shown on brightness chang
30
30
 
31
31
  ## Installation
32
32
 
33
- `$ pipx instal bctl`
33
+ ~~`$ pipx instal bctl`~~ not published yet
34
+
35
+ `$ pipx install git+ssh://git@github.com/laur89/bctl.git`
34
36
 
35
37
  Note this will install the client & daemon executables, but it's user
36
38
  responsibility to launch the daemon process, covered below.
@@ -116,7 +118,7 @@ Meaning it's best to choose one of the options, not both.
116
118
  As mentioned earlier, a daemon process needs to be started that keeps track of
117
119
  the displays. Easiest way to do so would be utilizing your OS's process
118
120
  manager. An example of a systemd user service file (e.g.
119
- `~/.config/systemd/user/bctld.service`) would be:
121
+ `~/.config/systemd/user/bctld.conf`) would be:
120
122
 
121
123
  ```
122
124
  [Unit]
@@ -136,12 +138,6 @@ RestartPreventExitStatus=100
136
138
  WantedBy=graphical-session.target
137
139
  ```
138
140
 
139
- Enable & start this unit by running
140
-
141
- ```sh
142
- $ systemctl --user enable --now bctld.service
143
- ```
144
-
145
141
  ### Client
146
142
 
147
143
  With demon running, the client is used to send commands to the daemon. List
@@ -182,7 +178,7 @@ part of internal comms spec.
182
178
 
183
179
  User configuration file is read from `$XDG_CONFIG_HOME/bctl/config.json`.
184
180
  For full config list see the [config.py](./bctl/config.py) file that defines the defaults,
185
- but the most important ones you might want to be aware of or change are:
181
+ but the most important ones you might want to consider changing are:
186
182
 
187
183
  | Config | Type | Default | Description |
188
184
  | --- | --- | --- | --- |
@@ -7,7 +7,9 @@ for screen (dis)connections. Desktop notifications are shown on brightness chang
7
7
 
8
8
  ## Installation
9
9
 
10
- `$ pipx instal bctl`
10
+ ~~`$ pipx instal bctl`~~ not published yet
11
+
12
+ `$ pipx install git+ssh://git@github.com/laur89/bctl.git`
11
13
 
12
14
  Note this will install the client & daemon executables, but it's user
13
15
  responsibility to launch the daemon process, covered below.
@@ -93,7 +95,7 @@ Meaning it's best to choose one of the options, not both.
93
95
  As mentioned earlier, a daemon process needs to be started that keeps track of
94
96
  the displays. Easiest way to do so would be utilizing your OS's process
95
97
  manager. An example of a systemd user service file (e.g.
96
- `~/.config/systemd/user/bctld.service`) would be:
98
+ `~/.config/systemd/user/bctld.conf`) would be:
97
99
 
98
100
  ```
99
101
  [Unit]
@@ -113,12 +115,6 @@ RestartPreventExitStatus=100
113
115
  WantedBy=graphical-session.target
114
116
  ```
115
117
 
116
- Enable & start this unit by running
117
-
118
- ```sh
119
- $ systemctl --user enable --now bctld.service
120
- ```
121
-
122
118
  ### Client
123
119
 
124
120
  With demon running, the client is used to send commands to the daemon. List
@@ -159,7 +155,7 @@ part of internal comms spec.
159
155
 
160
156
  User configuration file is read from `$XDG_CONFIG_HOME/bctl/config.json`.
161
157
  For full config list see the [config.py](./bctl/config.py) file that defines the defaults,
162
- but the most important ones you might want to be aware of or change are:
158
+ but the most important ones you might want to consider changing are:
163
159
 
164
160
  | Config | Type | Default | Description |
165
161
  | --- | --- | --- | --- |
@@ -37,12 +37,9 @@ class Client(object):
37
37
  reader, writer = await self._open_write_socket(cmd)
38
38
 
39
39
  data = await reader.read()
40
- data = json.loads(data.decode())
41
- self.logger.debug(f'received response {data} from daemon')
42
- [code, *rest] = data
43
- outf = sys.stdout if code == 0 else sys.stderr
40
+ [code, *rest] = json.loads(data.decode())
44
41
  for i in rest:
45
- print(i, file=outf)
42
+ print(i)
46
43
  await self._close_socket(writer)
47
44
  sys.exit(code)
48
45
 
@@ -60,14 +60,14 @@ class Conf(TypedDict):
60
60
 
61
61
 
62
62
  default_conf: Conf = {
63
- 'log_lvl': 'INFO', # daemon log level, doesn't apply to the client
63
+ 'log_lvl': 'INFO',
64
64
  'ddcutil_bus_path_prefix': '/dev/i2c-', # prefix to the bus number
65
- 'ddcutil_brightness_feature': '10',
65
+ 'ddcutil_brightness_feature': '10', # str!
66
66
  'ddcutil_svcp_flags': ['--skip-ddc-checks'], # flags passed to [ddcutil setvcp] commands
67
67
  'ddcutil_gvcp_flags': [], # flags passed to [ddcutil getvcp] commands
68
68
  'monitor_udev': True, # monitor udev events for drm subsystem to detect ext. display (dis)connections
69
69
  'periodic_init_sec': 0, # periodically re-init/re-detect monitors; 0 to disable
70
- 'sync_brightness': False, # keep all displays' brightnesses at same value/synchronized
70
+ 'sync_brightness': False, # try to keep all displays' brightnesses at same value/synchronized
71
71
  'sync_strategy': 'MEAN', # if displays' brightnesses differ and are synced, what value to sync them to; only active if sync_brightness=True;
72
72
  # 'MEAN' = set to arithmetic mean, 'LOW' = set to lowest, 'HIGH' = set to highest
73
73
  'notify': {
@@ -87,18 +87,18 @@ default_conf: Conf = {
87
87
  'udev_event_debounce_sec': 3.0, # both for debouncing & delay; have experienced missed ext. display detection w/ 1.0
88
88
  'msg_consumption_window_sec': 0.1, # can be set to 0 if no delay/window is required
89
89
  'brightness_step': 5, # %
90
- 'ignored_displays': [], # either [ddcutil --brief detect] cmd "Monitor:" value, or <device> in /sys/class/backlight/<device>
91
- 'ignore_internal_display': False, # do not control internal (i.e. laptop) display if available
90
+ 'ignored_displays': [], # either ddcutil's "Monitor:" value, or <device> in /sys/class/backlight/<device>
91
+ 'ignore_internal_display': False, # do not control internal display if available
92
92
  'ignore_external_display': False, # do not control external display(s) if available
93
93
  'main_display_ctl': 'DDCUTIL', # RAW | DDCUTIL | BRIGHTNESSCTL | BRILLO
94
94
  'internal_display_ctl': 'RAW', # RAW | BRIGHTNESSCTL | BRILLO; only used if main_display_ctl=DDCUTIL and we're a laptop
95
95
  'raw_device_dir': '/sys/class/backlight', # used if main_display_ctl=RAW OR
96
- # (main_display_ctl=DDCUTIL AND internal_display_ctl=RAW AND we're a laptop)
97
- 'fatal_exit_code': 100, # exit code signifying fatal exit that should not be retried;
96
+ # (main_display_ctl=DDCUTIL and internal_display_ctl=RAW AND we're a laptop)
97
+ 'fatal_exit_code': 100, # exit code signifying fatal exit code, should not be retried;
98
98
  # you might want to use this value in systemd unit file w/ RestartPreventExitStatus config
99
99
  'socket_path': '/tmp/.bctld-ipc.sock',
100
100
  'sim': None, # simulation config, will be set by sim client
101
- 'state_f_path': '/tmp/.bctld.state', # state that should survive restarts are stored here
101
+ 'state_f_path': '/tmp/.bctld.state',
102
102
  'state': None # do not set, will be read in from state_f_path
103
103
  }
104
104
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bctl
3
- Version: 0.0.1
3
+ Version: 0.0.1.dev0
4
4
  Summary: service for simultaneously controlling brightness of laptop & external displays
5
5
  License-Expression: MIT
6
6
  Project-URL: homepage, https://github.com/laur89/bctl
@@ -30,7 +30,9 @@ for screen (dis)connections. Desktop notifications are shown on brightness chang
30
30
 
31
31
  ## Installation
32
32
 
33
- `$ pipx instal bctl`
33
+ ~~`$ pipx instal bctl`~~ not published yet
34
+
35
+ `$ pipx install git+ssh://git@github.com/laur89/bctl.git`
34
36
 
35
37
  Note this will install the client & daemon executables, but it's user
36
38
  responsibility to launch the daemon process, covered below.
@@ -116,7 +118,7 @@ Meaning it's best to choose one of the options, not both.
116
118
  As mentioned earlier, a daemon process needs to be started that keeps track of
117
119
  the displays. Easiest way to do so would be utilizing your OS's process
118
120
  manager. An example of a systemd user service file (e.g.
119
- `~/.config/systemd/user/bctld.service`) would be:
121
+ `~/.config/systemd/user/bctld.conf`) would be:
120
122
 
121
123
  ```
122
124
  [Unit]
@@ -136,12 +138,6 @@ RestartPreventExitStatus=100
136
138
  WantedBy=graphical-session.target
137
139
  ```
138
140
 
139
- Enable & start this unit by running
140
-
141
- ```sh
142
- $ systemctl --user enable --now bctld.service
143
- ```
144
-
145
141
  ### Client
146
142
 
147
143
  With demon running, the client is used to send commands to the daemon. List
@@ -182,7 +178,7 @@ part of internal comms spec.
182
178
 
183
179
  User configuration file is read from `$XDG_CONFIG_HOME/bctl/config.json`.
184
180
  For full config list see the [config.py](./bctl/config.py) file that defines the defaults,
185
- but the most important ones you might want to be aware of or change are:
181
+ but the most important ones you might want to consider changing are:
186
182
 
187
183
  | Config | Type | Default | Description |
188
184
  | --- | --- | --- | --- |
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "bctl"
3
- version = "0.0.1"
3
+ version = "0.0.1.dev0"
4
4
  description = "service for simultaneously controlling brightness of laptop & external displays"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes