[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ranger-users] Suggestion for added command

From: Michael Longval
Subject: [Ranger-users] Suggestion for added command
Date: Fri, 12 Sep 2014 12:56:51 -0400

Hi there.

Enjoying “ranger” very much. 
Integrates well with my MacOS/Homebrew/Vim/zsh/tmux stack.

I added a command to my .config/ranger/commands.py file:

from subprocess import call

class clip(Command):

    Copy the contents of file to Mac clipboard using /usr/bin/pbcopy
    def execute(self):
        theFile = self.fm.thisfile.path
        theCommand = "cat " + theFile + " | /usr/bin/pbcopy"
        call(theCommand, shell=True)

    def tab(self):
        return self._tab_directory_content()

I know that this only works on MacOS, I guess that someone could just add a version for “xclip”.

Thanks again for a great program.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]