From 49c3a6206669c6d9e5f30d5a9447cd7e67112ae7 Mon Sep 17 00:00:00 2001 From: aik2 Date: Fri, 22 Jul 2022 16:50:38 +0400 Subject: [PATCH 1/2] use relative path for calling menu.py --- mounter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mounter.py b/mounter.py index 905b5e6..6fb3fe6 100644 --- a/mounter.py +++ b/mounter.py @@ -20,8 +20,7 @@ class mount(Command): """ Show menu to mount and unmount """ (f, p) = tempfile.mkstemp() os.close(f) - self.fm.execute_console( - f"shell python3 ~/.config/ranger/ranger_udisk_menu/menu.py {p}") + self.fm.execute_console(f"shell python3 {os.getcwd()}/menu.py {p}") with open(p, 'r') as f: d = f.readline() if os.path.exists(d): From 2dfd0552599e80fef433237a9f9460909e9b603b Mon Sep 17 00:00:00 2001 From: aik2 Date: Fri, 22 Jul 2022 16:52:24 +0400 Subject: [PATCH 2/2] clone to ~/.config/ranger/plugins instead --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23818e7..07d5114 100644 --- a/README.md +++ b/README.md @@ -9,17 +9,17 @@ This script draws menu to mount and unmount partitions using udisksctl and ncurs - lsblk 2.3 or newer # How to install -Firstly you need to clone this repo to ranger config directory +Firstly you need to clone this repo to the plugins directory of ranger ```Bash -cd ~/.config/ranger +cd ~/.config/ranger/plugins git clone https://github.com/SL-RU/ranger_udisk_menu ``` Then you need to add to `~/.config/ranger/commands.py` line: ```Python3 -from ranger_udisk_menu.mounter import mount +from plugins.ranger_udisk_menu.mounter import mount ``` Thats all