Skip to content

Improve i3 support, and generalize desktop support in the process #161

@dannyedel

Description

@dannyedel

Motivation: I use it myself

What should it do

  • Query RANDR outputs via i3 ipc
    • i3-msg -t get_outputs gives JSON
    • Only check active:true and hope it's two of them
    • The one with primary will likely be the laptop screen
  • Use i3's IPC mechanism to send "Move window id to output name

This can be generalized to "Desktop environment support modules", and move the Window-Movement code away from the PDFViewerWindow class.

DE Support Modules should support the following functions:

  • Is this my environment?
    • Outputs unsigned value of how good the module is for the current DE
    • 0 this is definitly not my environment. Do not call other functions on this handler
    • 1 for the generic handler, meaning the current X11 handler
    • 10 if the OS matches (move the current WIN32 handler here)
    • 100 or for specific handlers that can detect their special environment is active (such as an i3 handler)
  • Enumerate outputs
    • Returns vector of unique_ptr to handler-specific structure
  • Get primary output
    • Can throw "Cannot figure out which is the primary"
      • If exception ignored, picks the numerically first
  • Get secondary output (parametrize to ignore errors)
    • Can throw "Only one screen"
    • If not called to ignore errors, will throw "Cannot figure out which is the secondary"
    • If not called to ignore errors, will throw "Too many screens"
    • If errors ignored, outputs second screen
  • Move window to output $handle

Make sure the interface is clean, that is near-impossible to use incorrectly. (No raw pointers etc.)

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions