0

My problem is that I want to have a specific wm_class spawn at a specific X and Y position on my screen every time it opens (Floating window).

I read the documentation, but couldn't figure out a way. I was trying to use the method:

set_position_floating()
Salvatore
  • 10,815
  • 4
  • 31
  • 69
Eko450
  • 1
  • Could you write what do you exactly have done? https://stackoverflow.com/help/minimal-reproducible-example – robni Aug 25 '22 at 13:27

1 Answers1

0

I managed to do this in qtile the same way I did it in dwm. I placed ncmpcpp where I wanted on the screen by doing the following. Ncmpcpp runs in the terminal and my terminal is 'st'. So, I put this key binding in my config to spawn ncmpcpp:

Key([mod], "n", lazy.spawn("st -c float-term -g 100x25+550+300 ncmpcpp")),

I believe the 'c' flag allows you to choose a name for a new wm_class. I chose 'float-term' as the class name. The 'g' flag allows you to set the geometry that you want. Then, I added the new wm_class name to the float_rules list in my config.py:

floating_layout = layout.Floating(float_rules=[
    # Run the utility of `xprop` to see the wm class and name of an X client.
    *layout.Floating.default_float_rules,
    Match(wm_class='confirmreset'),  # gitk
    Match(wm_class='makebranch'),  # gitk
    Match(wm_class='maketag'),  # gitk
    Match(wm_class='ssh-askpass'),  # ssh-askpass
    Match(title='branchdialog'),  # gitk
    Match(title='pinentry'),  # GPG key password entry
    Match(wm_class='bomi'), #bomi player
    Match(wm_class='brave-browser-beta'), #brave browser
    Match(wm_class='gsimplecal'), #gsimplecal
    Match(wm_class='float-term'), #ncmpcpp

This method allowed me to spawn st any place on the screen. I have not tried this with any program other than st running ncmpcpp yet, but I'm pretty sure it would work.

Del
  • 667
  • 7
  • 23
robabo
  • 1