bspwm icon indicating copy to clipboard operation
bspwm copied to clipboard

Feature: i3-like marks

Open DrPyser opened this issue 5 years ago • 3 comments

Hi. I just started using bspwm about a week ago, loving it right now. Thanks to all contributors!

I'm wondering about implementing a feature like i3 marks, which allows tagging windows/nodes with arbitrary strings that can then be used for selection(instead of other window properties like title, class).

Short of adding native support for this, I guess I'd have to

  • implement storage of tags/node associations. file backend? in-memory backend?
  • command to tag/untag window(s)
  • garbage collection, could be implemented as a daemon listening on window close events using bspc subscribe, or as a check on every invocation of tagging commands.

If somebody already did something similar, or has any recommendations on how to do this well(e.g. minimizing memory footprint and complexity), I'd love to hear it.

Thanks!

DrPyser avatar Dec 30 '19 07:12 DrPyser

Hello there,

A little while ago I started a dynamic tagging script that I think does what you're talking about. It has a (bad) file backend, can tag/untag windows (and currently uses this info to toggle visibility) and garbage collection/state cleanup on invocation.

Here is the help message:

$ btags
commands: 
          -h: usage
       focus: <tag> - focus the last wid in the tag
    get-tags: <wid> - get the tags a wid is in
       names: get all the tag names
       state: print the state matching bspc subscribe format
   subscribe: analogous to bspc subscribe, but depends on `inotifywait`
      toggle: <tags> -- toggle visibility of tags
 toggle-wids: <tag> <wids> -- toggle wids being in a tag
    untagged: list untagged wids
        wids: <tags> -- get all wids in a tag or tags

NB: <tag> in the above may be an index EG ^1 or the name of the tag

And here is the location: https://github.com/neeasade/dotfiles/blob/master/bin/bin/btags (you will need joker, from https://github.com/candid82/joker)

neeasade avatar Jan 22 '20 18:01 neeasade

Cool, this looks awesome and exactly what I want! I might make my own version based on this, if you don't mind. I'll link it here if I do.

DrPyser avatar Jan 22 '20 19:01 DrPyser

@DrPyser how'd you go with this?

fubarhouse avatar Jun 16 '21 03:06 fubarhouse