GithubHelp home page GithubHelp logo

Comments (8)

t-wissmann avatar t-wissmann commented on May 23, 2024

Theoretically we can implement move_previous, but I don't see a need (i.e. an application) for it. So if you need it, just say so and please describe why you need it. (Just saying "use_index has its very best friend move_index, please also give such a friendship experience to use_previous" is not enought ;-))

from herbstluftwm.

gayprogrammer avatar gayprogrammer commented on May 23, 2024

Good point. I forgot to mention that I need move_previous because I often use use_previous without memorizing or knowing the tag index that I came from. I may not always have a panel to show me.

My use case for move_previous goes hand-in-hand with my use of use_previous. Which is that I sometimes must move windows between two tags, and sometimes they are not sequential (+1, -1). The use_previous option would make my workflow easier.

from herbstluftwm.

ypnos avatar ypnos commented on May 23, 2024

So if I get it correctly, you want to switch to the previous tag and bring your focused window with you.
You can do that easily with a one-liner script. For example fish:

set winid (herbstclient attr clients.focus.winid); and herbstclient use_previous; and herbstclient bring $winid

In bash it would probably look like this:

winid=$(herbstclient attr clients.focus.winid) && herbstclient use_previous && herbstclient bring $winid

Would this be a solution to your problem?

from herbstluftwm.

t-wissmann avatar t-wissmann commented on May 23, 2024

Right, if you want to go to the previous tag and take the focused window with you, then you can do that with this herbstclient command

 herbstclient substitute ID clients.focus.winid chain , use_previous , bring ID 

from herbstluftwm.

gayprogrammer avatar gayprogrammer commented on May 23, 2024

No, I don't want to switch to my previous tag. I only want my focused window to move to my previous tag.
Is there a way to get the previous tag index from herbstclient to so that I may use the use_index command? Such as:
herbstclient substitute INDEX tags.focus.previous.index move_index INDEX

from herbstluftwm.

t-wissmann avatar t-wissmann commented on May 23, 2024

Sorry, that's not possible. If you can live with the flickering for the time being, you can do

herbstclient substitute ID clients.focus.winid chain , lock , use_previous , bring ID , use_previous , unlock

from herbstluftwm.

ypnos avatar ypnos commented on May 23, 2024

You can also take the more complicated route and have a script running alongside herbstluftwm. It can either store the previous tag or the previously focused client. I would do it with the tag if I were you.

Several examples exist on how to listen for hooks (in this case tag_changed and move_previous); you can then bind a key to emit_hook more_previous and in your script do the deed.

For inspiration, here is a perl script of mine that listens to hooks and performs stuff: https://github.com/ypnos/hlwm/blob/master/redecorate.pl

from herbstluftwm.

gayprogrammer avatar gayprogrammer commented on May 23, 2024

Thank you for your help. I will use the chain command.

from herbstluftwm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.