dotfiles

My personal dotfiles

commit fa260cc2692ea7a922e9168c584b7e06dcecdd0e
parent de034948afc7139db56ce8c17ec7a825d2e5199c
Author: Pablo Emilio Escobar Gaviria <pablo-escobar@riseup.net>
Date:   Fri,  5 Feb 2021 11:40:12 +0000

Added files that shouldn't have been removed

Diffstat:
A.config/ranger/commands.py | 28++++++++++++++++++++++++++++
M.local/share/configs.list | 1+
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/.config/ranger/commands.py b/.config/ranger/commands.py
@@ -0,0 +1,28 @@
+from ranger.api.commands import Command
+from os.path import join, expanduser
+
+class empty(Command):
+    """:empty
+
+    Empties the trash directory 
+    """
+
+    def execute(self):
+        self.fm.run("gio trash --empty")
+
+class rename(Command):
+    """:rename <destination>
+
+    Renames a file
+    """
+
+    def execute(self):
+        source = self.fm.thisfile
+        destination = join(self.fm.thisdir.path, expanduser(self.rest(1)))
+        destination = destination.strip()
+
+        if destination:
+            self.fm.run("mv '%s' '%s'" % (source, destination))
+        else:
+            self.fm.notify("Cancelled", bad=True)
+
diff --git a/.local/share/configs.list b/.local/share/configs.list
@@ -13,3 +13,4 @@
 /home/pablo/.local/bin/exports.sh
 /home/pablo/.local/share/configs.list
 /home/pablo/.local/share/texmf/tex/latex
+/home/pablo/.config/ranger/commands.py