Comments (5)
I wonder if it would be doable to have some kind of "discovery" sub-command
For example the user could run something like display-switch discover
. Then they click the USB-switch button and the command displays which devices are (dis)connected. They switch monitor input manually and it describes which display has switched to which input. This would provide all the necessary values to enter into the config file
from display-switch.
For Linux the answer might be that you can get this info via "ddcutil detect", which produces output like this for each monitor:
Display 1
I2C bus: /dev/i2c-5
EDID synopsis:
Mfg id: DEL
Model: DELL U2719D
Serial number: 361PY13
Manufacture year: 2020
EDID version: 1.3
VCP version: 2.1
I'm not sure which fields of this display_switch is reading and matching on, though.
from display-switch.
@pm215 I suggest running display_switch
with empty or dummy monitor_id
, the app will log whatever monitor IDs it detected, then you could update the config to match that.
from display-switch.
The logging seems to indicate that display_switch is only finding numeric monitor IDs, eg
19:20:20 [INFO] Display '22789' is currently set to Custom(0x1111)
whereas the readme suggests that the config file monitor_id ought to be able to match against model or manufacturer names or serial numbers. Looking at the code in display_control.rs, it looks like it's only looking at the ddc_hi::DisplayInfo::id, and not the other strings. I added a bit of debug printing:
--- a/src/display_control.rs
+++ b/src/display_control.rs
@@ -49,6 +49,9 @@ pub fn log_current_source() {
}
let unique_names = are_display_names_unique(&displays);
for (index, mut display) in displays.into_iter().enumerate() {
+ info!("Display id {} manufacturer_id {:?} model_name {:?} serial_number {:?}",
+ display.info.id, display.info.manufacturer_id,
+ display.info.model_name, display.info.serial_number);
let display_name = display_name(&display, if unique_names { None } else { Some(index + 1) });
match display.handle.get_vcp_feature(INPUT_SELECT) {
Ok(raw_source) => {
which shows that the interesting stuff is in the fields we're not using:
19:25:10 [INFO] Display id 22789 manufacturer_id Some("DEL") model_name Some("DELL U2719D") serial_number Some("361PY13")
19:25:10 [INFO] Display '22789' is currently set to Custom(0x1111)
19:25:10 [INFO] Display id 22790 manufacturer_id Some("DEL") model_name Some("DELL U2719D") serial_number Some("DT86VS2")
19:25:10 [INFO] Display '22790' is currently set to Custom(0x1111)
Maybe display_name() should be concatenating these things together with the 'id' string?
The ddc_hi documentation says that id is "a unique identifier for the display, format is specific to the backend", and it looks like for Linux the i2c-dev backend just uses the (major,minor) of the device, so in this case 22789 == hex 0x5905 which is device 59,5 (/dev/i2c-5) and 22790 is 59,6 which is /dev/i2c-6. Being able to match on something specific to the monitor like its manufacturer or serial number seems like it would be more reliable than matching on something that's a detail of how the monitor DDC connection appears in the i2c subsystem.
from display-switch.
Ran into this same problem, ended up shrugging my shoulders and trying the switch globally - saw in the logs it told me exactly what names it was expecting. A discovery command would be great.
Along with that, already using the switch and having an awkward setup, a nicer command for usb id discovery might be along the lines of: lsusb > a && echo sleepstart && sleep 2 && echo sleepend && lsusb > b && diff -u a b
from display-switch.
Related Issues (20)
- Fails to detect displays on System76 Pop!_OS 22.04 HOT 2
- rusb callbacks never hit on macOS 12.4 HOT 1
- Doesn't open on Windows HOT 1
- main branch build fails with --locked because version differs between Cargo.toml and Cargo.lock HOT 1
- DDC error, even though I am not even trying to control a DDC monitor HOT 1
- Dual display setup with unconfigured monitor throwing an error HOT 2
- 100% CPU usage on Linux HOT 1
- Daisy chaining 2 displays with only 1 that supports DDC drops the second monitor when changing HOT 3
- `build.rs`'s `rerun-if-changed` directives don't expand `*.swift` HOT 1
- [Question] I'm considering user-friendly crossplatform UI. Anything already in the works? HOT 2
- [Question] Does this require installation? HOT 1
- [linux] laptop connected to dual monitors via a dock HOT 1
- Arch linux needs newer ddc-i2c HOT 1
- Switch on system (Application) boot HOT 1
- FR expand ~ in on_usb_connect_execute HOT 1
- USB Monitor Controls
- 1.3.0 on Windows doesn't detect USB changes HOT 2
- Support multiple command executions with `on_usb_<event>_execute` HOT 1
- Error when installing and no .ini or log files?
- Sceptre C35 InputSources
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from display-switch.