Last release introduced a bug, where if you had a monitor in your config that was not active, it would error out the script and prevent screenchanges
This commit is contained in:
@@ -31,7 +31,7 @@ class WorkSpacer:
|
|||||||
self.current_output_name = None
|
self.current_output_name = None
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
self.print_if_debug('all available outputs on device')
|
self.print_if_debug('All available outputs on device')
|
||||||
self.print_if_debug(names_for_outputs)
|
self.print_if_debug(names_for_outputs)
|
||||||
try:
|
try:
|
||||||
self.i3 = Connection()
|
self.i3 = Connection()
|
||||||
@@ -55,6 +55,8 @@ class WorkSpacer:
|
|||||||
for matchNum, match in enumerate(
|
for matchNum, match in enumerate(
|
||||||
re.finditer(r'workspace (\$.*) output (\$.*)', self.config, re.MULTILINE)
|
re.finditer(r'workspace (\$.*) output (\$.*)', self.config, re.MULTILINE)
|
||||||
):
|
):
|
||||||
|
if not config_outputs.keys().__contains__(match.group(2)):
|
||||||
|
continue # Not an active display, skip it
|
||||||
if not self.workspaces_on_outputs.keys().__contains__(config_outputs[match.group(2)]):
|
if not self.workspaces_on_outputs.keys().__contains__(config_outputs[match.group(2)]):
|
||||||
self.workspaces_on_outputs[config_outputs[match.group(2)]] = []
|
self.workspaces_on_outputs[config_outputs[match.group(2)]] = []
|
||||||
self.workspaces_on_outputs[config_outputs[match.group(2)]].append(
|
self.workspaces_on_outputs[config_outputs[match.group(2)]].append(
|
||||||
@@ -90,19 +92,19 @@ class WorkSpacer:
|
|||||||
y_offset = output.__dict__["rect"].__dict__["y"]
|
y_offset = output.__dict__["rect"].__dict__["y"]
|
||||||
|
|
||||||
if x_offset == 0 and y_offset == 0:
|
if x_offset == 0 and y_offset == 0:
|
||||||
if x_offset <= self.mouse_position[0] <= x_offset + width and y_offset <=\
|
if x_offset <= self.mouse_position[0] <= x_offset + width and y_offset <= \
|
||||||
self.mouse_position[1] <= y_offset + height:
|
self.mouse_position[1] <= y_offset + height:
|
||||||
return output.__dict__["name"]
|
return output.__dict__["name"]
|
||||||
elif x_offset == 0:
|
elif x_offset == 0:
|
||||||
if x_offset <= self.mouse_position[0] <= x_offset + width and y_offset <\
|
if x_offset <= self.mouse_position[0] <= x_offset + width and y_offset < \
|
||||||
self.mouse_position[1] <= y_offset + height:
|
self.mouse_position[1] <= y_offset + height:
|
||||||
return output.__dict__["name"]
|
return output.__dict__["name"]
|
||||||
elif y_offset == 0:
|
elif y_offset == 0:
|
||||||
if x_offset < self.mouse_position[0] <= x_offset + width and y_offset <=\
|
if x_offset < self.mouse_position[0] <= x_offset + width and y_offset <= \
|
||||||
self.mouse_position[1] <= y_offset + height:
|
self.mouse_position[1] <= y_offset + height:
|
||||||
return output.__dict__["name"]
|
return output.__dict__["name"]
|
||||||
else:
|
else:
|
||||||
if x_offset < self.mouse_position[0] <= x_offset + width and y_offset <\
|
if x_offset < self.mouse_position[0] <= x_offset + width and y_offset < \
|
||||||
self.mouse_position[1] <= y_offset + height:
|
self.mouse_position[1] <= y_offset + height:
|
||||||
return output.__dict__["name"]
|
return output.__dict__["name"]
|
||||||
|
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -4,7 +4,7 @@ with open('README.rst', 'r') as fh:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='pi3-smart-workspace',
|
name='pi3-smart-workspace',
|
||||||
version='0.1.7',
|
version='0.1.8',
|
||||||
packages=['pi3'],
|
packages=['pi3'],
|
||||||
url='https://github.com/GeneralDenmark/PyOutputHandler',
|
url='https://github.com/GeneralDenmark/PyOutputHandler',
|
||||||
license='Apache-2.0 License ',
|
license='Apache-2.0 License ',
|
||||||
|
|||||||
Reference in New Issue
Block a user