Giter VIP home page Giter VIP logo

nautilus-admin's Introduction

Nautilus Admin

GPLv3 license

Nautilus Admin is a simple Python extension for the Nautilus file manager that adds some administrative actions to the right-click menu:

  • Open as Administrator: opens a folder in a new Nautilus window running with administrator (root) privileges.
  • Edit as Administrator: opens a file in a Gedit window running with administrator (root) privileges.

Download

You can download the latest version of the extension from the Releases page.

Compiling from source

Check the INSTALL.md file for instruction on how to compile the extension from source.

Reporting bugs

You can report bugs and ask questions at the extension's issue tracker.

Contributing

Check the CONTRIBUTING.md file for info on how to contribute.

nautilus-admin's People

Contributors

akarimg avatar baltix avatar brunonova avatar david-upct avatar deadmetaler avatar e7appew avatar hosiet avatar jbicha avatar martinpl avatar nolt avatar pavreh avatar prescott66 avatar serdarsaglam avatar ste74 avatar to-ba avatar zgwerby 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nautilus-admin's Issues

open as other user

this is a very interesting extension
is it possible to have option "open as other user" and not only "open as root" ?
thanks

Nautilus 3.26 missing the context menu item

OS: Manjaro 17.0.6 Gellivara
Kernel: x86_64 Linux 4.9.60-1-MANJARO
Shell: bash
DE: GNOME
WM: GNOME Shell

Open as Administrator: opens a folder:
missing the context menu item - "Delete"
https://i.imgur.com/Kq8UoR4.png

I'm saving myself with a crutch:
.local/share/nautilus/scripts/Admin

#!/bin/bash
gksu nautilus $NAUTILUS_SCRIPT_SELECTED_URIS

Warning on startup

Since i updated nautilus to 3.21.91.1 version over Debian testing, it shows the next warning, and extension doesn't work:

sys:1: PyGIWarning: Nautilus was imported without specifying a version first. Use gi.require_version('Nautilus', '3.0') before import to ensure that the right version gets loaded.
/usr/share/nautilus-python/extensions/nautilus-admin.py:19: PyGIWarning: GConf was imported without specifying a version first. Use gi.require_version('GConf', '2.0') before import to ensure that the right version gets loaded.
  from gi.repository import Nautilus, GObject, GConf, Gtk, GLib

unknown option --no-desktop

Just after upgrade to GNOME 3.28 i get this error and n-a do not work:

org.gnome.Nautilus[524]: unknown option --no-desktop

from .py

def _nautilus_run(self, menu, file): """'Open as Administrator' menu item callback.""" uri = file.get_uri() admin_uri = uri.replace("file://", "admin://") subprocess.Popen([NAUTILUS_PATH, "--no-desktop", admin_uri])

Same on Archlinux + Antergos

Markup parsing error in German translation

The German translation contains the invalid character sequence "</ ". Therefore the warning message is not shown in the warning dialog but the following error message on the console:

(nautilus:3048): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Fehler in Zeile 1, Zeichen 110: » « ist kein gültiges Zeichen, wenn es auf die Zeichen »</« folgt; » « darf keinen Elementnamen beginnen

The attached patch fixes this issue.
nautilus-admin.txt

Markup parsing error in French translation

The French translation doesn't close a "<b>" element. Therefore the warning message is not shown in the warning dialog but the following error message on the console:

(nautilus:3245): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Erreur à la ligne 3, caractère 91 : L'élément « markup » a été fermé, mais l'élément actuellement ouvert est « b »

The attached patch fixes this issue.
fr.po.txt

Not working with Python3 in Arch

Using python-nautilus( pointing to python3 and not python2-nautilus) the menu item does not appear.

Running python nautilus-admin.py from /usr/share/nautilus-python/extensions/ I get the message

nautilus-admin.py:19: PyGIWarning: Nautilus was imported without specifying a version first. Use gi.require_version('Nautilus', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Nautilus, GObject

Adding those lines into python nautilus-admin.py adds double entry in the nautilus menu(both working)

Use gvfs admin backend instead of pkexec

gvfs 1.30 (generally included in GNOME 3.22 distros) has a new admin backend.

Instead of running an app as root or using pkexec, you can just use the admin:// prefix.

For instance, to edit your grub settiings, you can open admin:///etc/default/grub in gedit

To browse the root home directory, just navigate to admin:///root/

That takes care of Open and Edit as Administrator which I assume would be the most common features of this extension.

The admin backend is useful because GNOME on Wayland currently does not support pkexec. This issue is a follow up for #27

Markup parsing error in Italian translation

The Italian translation doesn't close a "<b>" element. Therefore the warning message is not shown in the warning dialog but the following error message on the console:

(nautilus:3016): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Errore alla riga 3 carattere 79: È stato chiuso l'elemento "markup", ma l'elemento correntemente aperto è "b"

The attached patch fixes this issue.
it.po.txt

Asks for passwd twice

As the description says, I have to enter my passwd twice when using this feature.

Dirs do not seem to work completely with 18.04

While the "Edit as Admin" works with files, the "Open as Admin" seems to miss the context menu for deleting files. It opens the dir window, the files in it look locked (although if you try to open them you are asked for the admin password). You can edit and save the files. You can move them to the trash bin icon and you are asked to delete them imediately, which works.

The previous behavior was better though. With "Open as Admin" you were actually root, so no further password required, and the trash-bin was the root trash-bin, plus the Delete context menu and keyboard shortcut were actually working as expected.

Tried with the latest release.

Error

Nautilus-Python-WARNING **: 00:27:38.384: nautilus_python_init_python failed
Traceback (most recent call last):
File "/usr/share/nautilus-python/extensions/nautilus-admin.py", line 20, in
from gi import require_version
File "/usr/lib64/python3.7/site-packages/gi/init.py", line 42, in
from . import _gi
ImportError: /usr/lib64/python3.7/site-packages/gi/_gi.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyExc_NotImplementedError

Doesn't open folders / files owned by root in CentOS 7

I'm running CentOS 7 with gvfs.x86_64 version 1.30.4, release 3.el7, however, the admin:/// does not work for me, and this extension is not working either (I'm assuming that because admin:/// does not work, this extension won't work).

I can successfully compile the extension and install it, and when I do, I do see an Open as Administrator / Edit as Administrator right-click option in Nautilus, but when I right-click on a directory owned by root, and select Open as Administrator, it opens a new blank window, and then after a period of time, that blank window just closes.

The title in the task bar at the bottom of my screen shows Loading... for that window.

If I try to edit a file, I see gedit in the bottom taskbar, however, after a short bit, I'm prompted with a message saying GEdit timed out and I can kill it or wait. If I pick wait, eventually, it'll pop open, displaying the message:

Could not open the file "admin:///home/spork/Desk...p/Root%20Terminal.desktop".
Connection timed out. Please try again.

It seems to be related to the gvfs admin backend not working as expected in CentOS 7. If I run:

rpm -ql gvfs.x86_64

I see the following files are provided by that installed package:
/usr/lib/systemd/user/gvfs-daemon.service
/usr/lib/systemd/user/gvfs-metadata.service
/usr/lib/systemd/user/gvfs-udisks2-volume-monitor.service
/usr/lib64/gvfs/libgvfsdaemon.so
/usr/libexec/gvfs-udisks2-volume-monitor
/usr/libexec/gvfsd
/usr/libexec/gvfsd-admin
/usr/libexec/gvfsd-burn
/usr/libexec/gvfsd-cdda
/usr/libexec/gvfsd-computer
/usr/libexec/gvfsd-dav
/usr/libexec/gvfsd-dnssd
/usr/libexec/gvfsd-ftp
/usr/libexec/gvfsd-http
/usr/libexec/gvfsd-localtest
/usr/libexec/gvfsd-metadata
/usr/libexec/gvfsd-network
/usr/libexec/gvfsd-recent
/usr/libexec/gvfsd-sftp
/usr/libexec/gvfsd-trash
/usr/share/GConf/gsettings/gvfs-dns-sd.convert
/usr/share/GConf/gsettings/gvfs-smb.convert
/usr/share/dbus-1/services/org.gtk.vfs.Daemon.service
/usr/share/dbus-1/services/org.gtk.vfs.Metadata.service
/usr/share/dbus-1/services/org.gtk.vfs.UDisks2VolumeMonitor.service
/usr/share/glib-2.0/schemas/org.gnome.system.dns_sd.gschema.xml
/usr/share/glib-2.0/schemas/org.gnome.system.gvfs.enums.xml
/usr/share/glib-2.0/schemas/org.gnome.system.smb.gschema.xml
/usr/share/gvfs
/usr/share/gvfs/mounts
/usr/share/gvfs/mounts/admin.mount
/usr/share/gvfs/mounts/burn.mount
/usr/share/gvfs/mounts/cdda.mount
/usr/share/gvfs/mounts/computer.mount
/usr/share/gvfs/mounts/dav+sd.mount
/usr/share/gvfs/mounts/dav.mount
/usr/share/gvfs/mounts/dns-sd.mount
/usr/share/gvfs/mounts/ftp.mount
/usr/share/gvfs/mounts/ftps.mount
/usr/share/gvfs/mounts/http.mount
/usr/share/gvfs/mounts/localtest.mount
/usr/share/gvfs/mounts/network.mount
/usr/share/gvfs/mounts/recent.mount
/usr/share/gvfs/mounts/sftp.mount
/usr/share/gvfs/mounts/trash.mount
/usr/share/gvfs/remote-volume-monitors
/usr/share/gvfs/remote-volume-monitors/udisks2.monitor
/usr/share/man/man1/gvfsd-metadata.1.gz
/usr/share/man/man1/gvfsd.1.gz
/usr/share/polkit-1/actions/org.gtk.vfs.file-operations.policy
/usr/share/polkit-1/rules.d/org.gtk.vfs.file-operations.rules

I would think /usr/libexec/gvfsd-admin would be the gvfs admin backend. Any suggestions on why this doesn't work for me or how to fix it? It's a fresh install of CentOS 7.4.1708.

Thanks!

Fedora python-nautilus refers to python2-nautilus, which breaks python nautilus extensions.

Installing nautilus-admin through the released package, following the instructions in INSTALL.md, the following error occurs when running nautilus -q to finish installation:

$ nautilus -q

(nautilus:9442): Nautilus-Python-WARNING **: 15:36:29.532: g_module_open libpython failed: /usr/lib64/libpython3.7.so.1.0: cannot open shared object file: No such file or directory
ImportError: could not import gobject (error was: ImportError('/usr/lib64/python3.7/site-packages/gi/_gi.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyExc_NotImplementedError'))

(nautilus:9442): Nautilus-Python-WARNING **: 15:36:29.579: pygobject initialization failed

(nautilus:9442): Nautilus-Python-WARNING **: 15:36:29.579: nautilus_python_init_python failed
Traceback (most recent call last):
  File "/usr/share/nautilus-python/extensions/nautilus-admin.py", line 20, in <module>
    from gi import require_version
  File "/usr/lib64/python3.7/site-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: /usr/lib64/python3.7/site-packages/gi/_gi.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyExc_NotImplementedError

I found this related discussion on the Red Hat bugzilla. Installing python-nautilus actually installs a package named python2-nautilus. The linked discussion and the missing python3 errors led me to believe I should not depend on python2 but instead on python3.

The solution is to remove python-nautilus and instead install python3-nautilus as follows.

$ sudo dnf remove python-nautilus
$ sudo dnf install python3-nautilus
$ nautilus -q

This removes the python2-nautilus package and installs the nautilus-python package (which lacks the 3 in the package name, to add to the confusion..). Now it works without issue.

Please consider updating INSTALL.md to reflect this broken dependency.

For reference, I'm using GNOME nautilus 3.30.3 on a fresh install of Fedora 29.

Untagged v1.1.7

Not really an issue with the project itself, but something about how version 1.1.7 was released is causing my non-standard Debian watch file to fail. If you have a look at https://github.com/brunonova/nautilus-admin/releases, you'll see that the files are stored under https://github.com/brunonova/nautilus-admin/releases/download/untagged-3dea55396abd97dc4150/ instead of https://github.com/brunonova/nautilus-admin/releases/download/v1.1.7/, and it doesn't say that the release is verified even though the tar archive is signed.

nautilus-admin old way

Hi, trying to use the old (and great!) nautilus admin in gnome 3.28 (and Arch) to get rid of the bug with admin backend. Compiled version 0.2.5 as you mentioned in a closed issue, however menu doesn't show up in Nautilus. Checked polkit files and python extension but cant tell what's wrong. Anything obvious I am missing? I understand 0.2.5 is an older version but any help here much appreciated.

EDIT : not to worry, I've modified the py scripts from v1.1.7 to go back to pkexec method. Can close issue. thx for v useful extension.

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.