emersion / kanshi

Dynamic display configuration (mirror)
https://wayland.emersion.fr/kanshi/
MIT License
656 stars 46 forks source link

kanshi prints matched configuration and exits #20

Closed martinsb closed 5 years ago

martinsb commented 5 years ago

I don't really understand how to use this program. Judging from the description I'd guess that kanshi monitors external screen connect and disconnect events and adjusts display configuration accordingly. I have the following config:

{
    output eDP-1 vendor SHP product 0x144A serial 0x0 scale 2
}

{
    output eDP-1 vendor SHP product 0x144A serial 0x0 scale 2 position 0,1050
    output DP-1 vendor SAM product SyncMaster serial H9XPC04698 position 0,0
}

It looks like it successfully matches configurations for both cases - a single laptop screen and a laptop screen with an external monitor. This is the kanshi output in casae of a single laptop screen:

Connected outputs:
output eDP-1 vendor SHP product 0x144A serial 0x0
Matching configuration: Some([MatchedOutput { connected: ConnectedOutput { name: "eDP-1", edid: EDID { header: Header { vendor: ['S', 'H', 'P'], product: 5194, serial: 0, week: 23, year: 25, version: 1, revision: 4 }, display: Display { video_input: 165, width: 29, height: 17, gamma: 120, features: 14 }, chromaticity: (), established_timing: (), standard_timing: (), descriptors: [DetailedTiming, DetailedTiming, UnspecifiedText("RXN49\u00b6LQ133Z1"), Unknown([2, 65, 3, 40, 0, 18, 0, 0, 11, 1, 10, 32, 32])] } }, saved: SavedOutput { name: "eDP-1", vendor: "SHP", product: "0x144A", serial: "0x0", enabled: true, width: 0, height: 0, rate: 0.0, x: 0, y: 0, primary: false, scale: 2 } }])
output eDP-1 position 0,0 scale 2

This is the kanshi output in case of a laptop screen and a monitor plugged in via USB-C port (with HDMI to USB-C adapter if that matters):

Connected outputs:
output eDP-1 vendor SHP product 0x144A serial 0x0
output DP-1 vendor SAM product SyncMaster serial H9XPC04698
Matching configuration: Some([MatchedOutput { connected: ConnectedOutput { name: "eDP-1", edid: EDID { header: Header { vendor: ['S', 'H', 'P'], product: 5194, serial: 0, week: 23, year: 25, version: 1, revision: 4 }, display: Display { video_input: 165, width: 29, height: 17, gamma: 120, features: 14 }, chromaticity: (), established_timing: (), standard_timing: (), descriptors: [DetailedTiming, DetailedTiming, UnspecifiedText("RXN49\u00b6LQ133Z1"), Unknown([2, 65, 3, 40, 0, 18, 0, 0, 11, 1, 10, 32, 32])] } }, saved: SavedOutput { name: "eDP-1", vendor: "SHP", product: "0x144A", serial: "0x0", enabled: true, width: 0, height: 0, rate: 0.0, x: 0, y: 1050, primary: false, scale: 2 } }, MatchedOutput { connected: ConnectedOutput { name: "DP-1", edid: EDID { header: Header { vendor: ['S', 'A', 'M'], product: 542, serial: 1212232240, week: 50, year: 17, version: 1, revision: 3 }, display: Display { video_input: 128, width: 43, height: 27, gamma: 120, features: 42 }, chromaticity: (), established_timing: (), standard_timing: (), descriptors: [DetailedTiming, RangeLimits, ProductName("SyncMaster"), SerialNumber("H9XPC04698")] } }, saved: SavedOutput { name: "DP-1", vendor: "SAM", product: "SyncMaster", serial: "H9XPC04698", enabled: true, width: 0, height: 0, rate: 0.0, x: 0, y: 0, primary: false, scale: 0 } }])
output eDP-1 position 0,1050 scale 2
output DP-1 position 0,0

As you see kanshi prints out commands suitable for swaymsg (I'm using sway) but nothing actually happens - the program just exits. Am I missing something here?