Giter VIP home page Giter VIP logo

ranger_udisk_menu's Introduction

Ranger udisk menu

This script draws menu to mount and unmount partitions using udisksctl and ncurses

Screenshot

Requirements

  • python3.8 or newer
  • udisks2 (for udisksctl)
  • lsblk 2.3 or newer

How to install

Firstly you need to clone this repo to the plugins directory of 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:

from plugins.ranger_udisk_menu.mounter import mount

Thats all

How to use

Enter in ranger :mount, than will be shown menu. In this menu you can press:

  • j or arrow down or Ctrl+n to move selection down
  • k or arrow up or Ctrl+p to move selection up
  • Ctrl+g or Esc or q to quit
  • g or r to refresh all partitions and drives
  • m to mount selected partition
  • u to unmount selected partition
  • e to unmount all partitions of selected partition's drive
  • p to power off selected the selected partition's drive (also called safely remove). It can be done only when all partitions of the drive are unmounted
  • ENTER to open selected mountpoint in current tab of the ranger

Troubles

If there is trouble with permissions, then you need to create group storage and add your user to it. Then you need to update your Polkit or PolicyKit permissions like it shown here: https://github.com/coldfix/udiskie/wiki/Permissions

ranger_udisk_menu's People

Contributors

aik2mlj avatar sl-ru avatar syphdias avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ranger_udisk_menu's Issues

JSON Decode Error

I ran into this issue this week, I saw that :mount command was not running on ranger so I decided to output into a file using sterr and got the following error

  1 Traceback (most recent call last):
  2   File "/home/user/.config/ranger/ranger_udisk_menu/menu.py", line 229, in <module>
  3     cp = ChoosePartition()
  4   File "/home/user/.config/ranger/ranger_udisk_menu/menu.py", line 34, in __init__
  5     self._read_partitions()
  6   File "/home/user/.config/ranger/ranger_udisk_menu/menu.py", line 38, in _read_partitions
  7     self.blkinfo = json.loads(r)
  8   File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
  9     return _default_decoder.decode(s)
 10   File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
 11     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
 12   File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
 13     obj, end = self.scan_once(s, idx)
 14 json.decoder.JSONDecodeError: Expecting ',' delimiter: line 66 column 22 (char 1579)
~

So I decided to check the dependencies listed and I have it installed all of them also I tried to run lsblk --all --json -O and get a good json format. I was wondering if this can be from json.load() function?

Not working

I read issue #2 and still don't understand what I have to do to make it work. Regardless of the font size and the terminal window, the menu does not appear.

Add support for crypted LUKS

I can't mount crypted LUKS:

Object /org/freedesktop/UDisks2/block_devices/sdb2 is not a mountable filesystem

With this features the plugin will be awesome

creating multiple folder with UUID when mounting a drive

I am glad found this. but every time when mounting a drive it creating separate folder like UUIDx , [where x = 1,2,3,...] . Anyone know how to get rid of this. And this happens after fresh reboot otherwise it mounting same folder.
image

Not working :(

Sorry for the inexpressive title. I've followed the steps to install and when I
call :mount the screen flickers and nothing else happens. How can I know if
this is a permissions problem or something else? I've tried calling the program
from command line, but that doesn't work. Thanks in advance!

Safely remove drive

In nautilus there is an option to safely remove drive.

Screenshot from 2021-06-12 17-32-14

It powers off the drive (no lights on)

Is there a similar feature in ranger_udisk_menu? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.