0

I'm using the Ranger file manager on a daily basis but there is one thing that I wish I could modify.

Namely, having multiple ranger windows open, this is what the window titles look like (I'm using i3wm in a stacked mode):

enter image description here

It would really improve my productivity if I was able to label each window with a specific name or at least have it display the specific directory that it's pointing to. Something like this:

Projects
--------------------------------------------------------
Images
--------------------------------------------------------
Scripts
--------------------------------------------------------
Notes
--------------------------------------------------------
Videos
--------------------------------------------------------

Is there a way I could achieve this effect either through the available configuration or with some type of script/plugin?

0

I use this to set the tmux title (put it into your ranger plugin folder):

import ranger.api
import os
import sys

old_hook_init = ranger.api.hook_init

def hook_init(fm):
    def on_cd():
        if fm.thisdir:
            title = os.path.basename(fm.thisdir.path)
            sys.stdout.write("\033k"+title+"\033\\")
            sys.stdout.flush()

    fm.signal_bind('cd', on_cd)
    return old_hook_init(fm)

ranger.api.hook_init = hook_init

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.