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

Doesnt play well with Tiling Windows Manager #144

Closed
Glutenberg opened this issue Oct 9, 2024 · 12 comments
Closed

Doesnt play well with Tiling Windows Manager #144

Glutenberg opened this issue Oct 9, 2024 · 12 comments
Labels
Milestone

Comments

@Glutenberg
Copy link

Trying to use this with GlazeWM. The 2 Programs are fighting for control of the windows terminal instance. Ive tried ignoring windows terminal from GlazeWM but this means any secondary instances of windows terminal are not managed by GlazeWM and are therefor floating.

Is there a way to fix this. Or let me know what process/class I need to ignore to have this work with GlazeWM.

@flyingpie
Copy link
Owner

@Glutenberg Hey Josh, thank you for reaching out!

So if I'm understanding correctly, you may have more than 1 instance of WT open, and want 1 to be managed by WTQ, and the others by GlazeVM, correct?

If that's the case, I think that you'd need to get GlazeVM to ignore 1 of n instances. It seems that they have a process name, a class name and a window title to work with.

I'll test WT specifically when I get home, since it has some specific quirks going on with the process name. But some things that come to mind:

  • If the window title can be made constant (or have a prefix or suffix), maybe you could use that to ignore a single window in GlazeVM.

Here's some information on how WT handles window titles, which includes a config setting that allows you to override it (haven't tested this myself yet):
https://learn.microsoft.com/en-us/windows/terminal/tutorials/tab-title

  • Kinda hacky, but you could get a different process name by copying and renaming the actual binary. I'd consider this a last resort, but it should work at least :P

Let me know if either of these directions sound usable to you, I'd be happy to help out.

@Glutenberg
Copy link
Author

Glutenberg commented Oct 10, 2024

@flyingpie Marco,

If the window title can be made constant (or have a prefix or suffix), maybe you could use that to ignore a single window in GlazeVM.

I've been experimenting with AHK to do this. Its not perfect since applications sometimes change their title. I also have to create and manage a script for each program. Can this maybe be a feature added to WTQuake. Since it launches the program/process it should be able to grab the hnwd or process id and monitor it to ensure its title is always prefixed with "wtq" or "WTQuake" or whatever someone defines in the config.

GlazeWM allows you to set "window rules" but it looks like you can only match to process name, window class or window title. I think controlling the title is probably the easiest approach.

I'm not a programmer. There's probably a better way. But just some ideas. Might also want to take a quick look at komorebi to see if theres a solution that would work for both.

@flyingpie
Copy link
Owner

@Glutenberg What shells do you use within WT? Just PowerShell?

@Glutenberg
Copy link
Author

Windows Terminal. But would like use other apps like file explorer etc. Ideally id like to be able to launch secondary instances of these apps and they still tile.

@flyingpie
Copy link
Owner

Sorry, I meant the shell that runs inside of Windows Terminal, it usually shows by the icon:
image

Can be a couple things:

  • PowerShell (version 7+, the "new" one)
  • Windows PowerShell (the blue one, old-skool PowerShell that only runs on Windows)
  • Command Prompt (the really old-skool one, from the Windows 95 days)
  • (Git) Bash
  • WSL Something or other

@Glutenberg
Copy link
Author

Glutenberg commented Oct 10, 2024

Powershell 5.1

image

@flyingpie
Copy link
Owner

What apps would you want to tile? I can take a look at if it's possible to control their window titles, but it seems that the ability to do that depends on the app.

@flyingpie
Copy link
Owner

Any reason you're not on PowerShell 7?

I'll see if there's ways of controlling the window title, though it seems to be dependent on the app somewhat.

@Glutenberg
Copy link
Author

Honestly, I didn't realize the version that ships with Windows 10 was so outdated. I swapped to 7.

I'll see if there's ways of controlling the window title, though it seems to be dependent on the app somewhat.

That's kind of why it would be nice if wtq could handle it. Since it makes the call to launch the instance of the program its controlling. it could grab the window handle and watch it to ensure it always has a prefix or some kind of identifier that these Window Managers can search for.

This identifier could be defined by the user in the config file, that way users who don't want it can leave it blank.

@flyingpie
Copy link
Owner

There's some old crusty stuff that's not supported in the newer Powershell versions, which is why they don't default to it yet. Just keep that in mind if you run into any issues.

Anyway, I've made a draft release:
https://github.com/flyingpie/windows-terminal-quake/releases/tag/v2.0.12-pre1

This release adds a new setting to the "App" objects:

{
  "Apps": [
    {
      "Name": "Terminal",
      "HotKeys": [{ "Modifiers": "Control", "Key": "D1" }],
      "FileName": "wt",
      "ProcessName": "WindowsTerminal",

      // The new setting, attempts to set the window's title.
      // Note that this doesn't seem to work on all app
      "WindowTitleOverride": "WinTerm1"
    }
  ]
}

Then I've added this to the GlazeWM config:

window_rules:
  - command: "ignore"
    match_title: "WinTerm1.*"

So that any window having a title starting with "WinTerm1" is ignored.

That seems to work here, do you want to give it a spin?

@Glutenberg
Copy link
Author

Awesome. Seems to be working. Appreciate it.

@flyingpie
Copy link
Owner

Great to hear, I'll include this in the next stable version. Let me know if anything comes up!

@flyingpie flyingpie added this to the v2.0.11 milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants