[Top][All Lists]

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

Re: [Ranger-users] Trash

From: Miodrag Milic
Subject: Re: [Ranger-users] Trash
Date: Mon, 4 Mar 2013 14:08:01 +0100

>It seems to me that you could've replaced that with a simple
>> map <DELETE> shell trash-put %s
>> alias trash shell trash-put %s
>> map <DELETE> trash

That is showing the console for short which is extremely annoying. especially if you do it multiple times in a row.
I tried with shell -f which doesn't show it, but then it doesn't update the screen. The next was 

  chain shell -f trash %s; reload_cwd

but that didn't work either so I did

 chain shell -f trash %s; eval time.sleep(0.2); reload_cwd

but I had to previously import time in commands.py (I am just learning python, perhaps there is other way).

however, that blanked the screen during sleeping.

So I just resorted to command.py. 

So... could you provide simple mapping which doesn't flicker ? 

On Mon, Mar 4, 2013 at 1:09 PM, Roman Z. <address@hidden> wrote:
It seems to me that you could've replaced that with a simple

> map <DELETE> shell trash-put %s


> alias trash shell trash-put %s
> map <DELETE> trash


On Mon, Mar 04, 2013 at 09:16:24AM +0100, Miodrag Milic wrote:
> Bellow is how I enabled trash for ranger, perhaps other users will find
> info useful
> Ludo Beckers wrote @ Jan 1
> >First thing I'm trying to do is cover myself; I can't be trusted with a
> delete key >that is permanent :-)
> >I put this
> >"map DD shell mv -t /home/myname/.config/ranger/Trash %s"
> >in  ~/config/ranger/rc.conf
> I wanted such kind of trash myself so I checked out the code posted by
> Peter Marheine here: https://bitbucket.org/tari/dotfiles/src/default/ranger
> In his commands.py there are 2 commands - imresize & trash - and while
> first works, the second one doesn't here.
> While I was trying to see what causes a problem I found out python tool:
> trash-cli
> https://github.com/andreafrancia/trash-cli
> trash-cli trashes files recording the original path, deletion date, and
> permissions. It uses the same trashcan used by KDE, GNOME, and XFCE, but
> you can invoke it from the command line (and scripts)
> *
> *
> and replaced DELETE keymaping to use it (with selection)
> map <DELETE> trash
> where trash is defined in commands.py as
> ----
> import subprocess
> class trash(Command):
>     """
>     :trash file1 file2 ...
>     Delete files using trash-cli
>     """
>     def execute(self):
>         subprocess.call( ['trash-put'] + map(str,
> self.fm.env.cwd.get_selection()) )
> ----
> restore-trash, trash-list and trash-empty are available to manage trash
> items.
> The awesome thing about this is that it works without X installed, yet if
> you use it inside X other programs will be able to see trash data.
> Since its python code it could be even made into ranger plugin.

reply via email to

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