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

Added dynamic version of named scratch pads #226

Closed
wants to merge 1 commit into from

Conversation

Fresheyeball
Copy link

@Fresheyeball Fresheyeball commented Jan 29, 2018

Description

I love named scratch pads, but they don't work with chrome apps. This is because to work with chrome apps, you need to do window selection via XMonad.Hooks.DynamicProperty, since the selection, does not exist when the window is first created.

These changes add a version of named scratch pads that can be used with an event hook. IE Event -> X All instead of ManageHook. And therefore can be used with chrome apps. I am not the only one with this problem.

Examples:

Checklist

@srid
Copy link
Contributor

srid commented Feb 13, 2018

I don't know what exactly you mean by "chrome apps" - but I can run any website as a named scratched pad using the --app parameter of chrome. For example,

scratchChromeApp name url = NS name cli windowQuery defaultFloating
  where cli = "google-chrome-stable --app=https://" <> url
        windowQuery = className =? "Google-chrome" <&&> resource =? url

scratchpads = [ scratchChromeApp "wrinkle" "myorg.wrinkle.com"
              , scratchChromeApp "irccloud" "irccloud.com"
              ]

@Fresheyeball
Copy link
Author

Fresheyeball commented Feb 26, 2018

@srid so by chrome app, I mean more or less what you have there, where we pass an --app flag. In my case I pass a hash instead of a url, but it's roughly the same. Now the problem with what you have there is that clicking around on the app will change the url. Also, can you tell me more about resource I have not seen that before, and it doesn't seem to correspond to anything I see using xprop. The intention of my work here was to allow chrome apps to be in a scratchpad, which I didn't see another way to accomplish.

@geekosaur
Copy link
Contributor

resource is the first component of WM_CLASS. This is probably best explained by documentation of the Xrm library. Current preference in xmonad is to call it appName instead.

@srid
Copy link
Contributor

srid commented Feb 27, 2018

Now the problem with what you have there is that clicking around on the app will change the url.

Not sure what exactly you mean by "change the url". Clicking an URL of an external domain opens that link in the current default browser (which happens to be chrome in my case). It doesn't change the state of the app.

@slotThe
Copy link
Member

slotThe commented Jan 29, 2021

I will close this for now as, at least as far as I can tell, this comment solves this particular problem.

@Fresheyeball if you feel like that's not the case, feel free to re-open (and possibly restate the problem you're having, 2018 was quite some time ago :)

@slotThe slotThe closed this Jan 29, 2021
@Fresheyeball
Copy link
Author

@slotThe no his comment does NOT address this problem. Chrome apps have unstable window properties and supporting them in scratchpads requires this change.

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

Successfully merging this pull request may close these issues.

None yet

4 participants