mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-23 11:32:22 +00:00
Show mode frequency
This commit is contained in:
parent
afc6067d2b
commit
dce8545ed3
@ -21,7 +21,8 @@ def test_parse_modes(test_data):
|
|||||||
m = Monitor(data)
|
m = Monitor(data)
|
||||||
assert len(m.modes) == 9
|
assert len(m.modes) == 9
|
||||||
assert "0x56" in m.modes
|
assert "0x56" in m.modes
|
||||||
assert str(m.modes["0x56"]) == "1920x1080 (0x56)"
|
assert str(m.modes["0x56"]) == "1920x1080 60Hz (0x56)"
|
||||||
|
assert m.modes["0x56"].frequency == 60.01
|
||||||
assert m.enabled
|
assert m.enabled
|
||||||
assert m.primary
|
assert m.primary
|
||||||
assert m.orientation == "normal"
|
assert m.orientation == "normal"
|
||||||
|
@ -48,12 +48,13 @@ class Mode:
|
|||||||
self.refresh = parse.search("{refresh:f}Hz", data[2])["refresh"]
|
self.refresh = parse.search("{refresh:f}Hz", data[2])["refresh"]
|
||||||
self.preferred = "+preferred" in self.header
|
self.preferred = "+preferred" in self.header
|
||||||
self.current = "*current" in self.header
|
self.current = "*current" in self.header
|
||||||
|
self.frequency = parse.search("{freq:f}Hz", data[2])["freq"]
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return self.header.strip()
|
return self.header.strip()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.res_x}x{self.res_y} ({self.name})"
|
return f"{self.res_x}x{self.res_y} {int(self.frequency)}Hz ({self.name})"
|
||||||
|
|
||||||
|
|
||||||
class Monitor:
|
class Monitor:
|
||||||
|
Loading…
Reference in New Issue
Block a user