Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dannyedel opened this issue Feb 28, 2016 · 1 comment · May be fixed by #162
Open

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

dannyedel opened this issue Feb 28, 2016 · 1 comment · May be fixed by #162

Comments

@dannyedel
Copy link
Owner

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.)

@dannyedel dannyedel self-assigned this Feb 28, 2016
@dannyedel dannyedel linked a pull request Feb 28, 2016 that will close this issue
@dannyedel dannyedel added this to the v1.16 i3 support milestone May 20, 2016
@clawoflight
Copy link

May I question why this is here? It probably makes sense for other DEs, but for i3 specifically, this is trivial to do:

I simply assign workspace 10 to always be on the output I use for presentations, and assign the dspdfviewer window to always be on that workspace. Job done, literally 2 lines, one of which I had already before using dspdfviewer.
Has the nice advantage that it doesn't break if I open dspdfviewer before connecting to the projector :)

workspace $ws10 output DP2 # VGA output
assign [title="DS PDF Viewer - Audience Window"] $ws10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants