GithubHelp home page GithubHelp logo

Comments (13)

bassmanitram avatar bassmanitram commented on September 26, 2024

from actions-for-nautilus.

bassmanitram avatar bassmanitram commented on September 26, 2024

I have installed the extension on a fresh Ubuntu 22.10 installation and it seems to work in general. A reminder of the installation process:

  • Download and install the deb
  • Alt-F2 (or open a terminal)
  • nautilus -q

This will install the deb and restart Nautilus in order to immediately see the extension.

You should then:

  • Open the configurator - this will install the default/demo config for the user
  • After about 30 seconds, open nautilus and right click on a folder - you should see something like this
    image
    Note the three items at the bottom (before Open in Terminal and Properties) which are added by the extension.

You can then be sure that extension is installed and working (I am working on an alternative and cleaner approach to configuration update in Nautilus rather than the timer, but it's actually tougher than it seems :))

After that, the non-appearance of certain actions for certain files is almost certainly because the action hasn't been correctly configured.

However, having your configuration would allow me to confirm this in your particular use case.

from actions-for-nautilus.

bassmanitram avatar bassmanitram commented on September 26, 2024

@threed-factory-store - do you have any more help for me in addressing this?

from actions-for-nautilus.

threed-factory-store avatar threed-factory-store commented on September 26, 2024

This is so bizarre. I've responded to your emails, but my responses are not showing up here. So here goes:

It looks to me like it's not installed properly. Here's my config file and a screen shot of the right-click menu for an image file. The item I've added is to send an image to my blog. It's a bash script which works fine if I run it by itself.

RightClickMenu

Here's my config file:

{"actions": [{"type": "command", "label": "Run in python3", "command_line": "gnome-terminal -t "Running Python %b" --profile "No Close" -- python3 %b", "cwd": "%d", "max_items": 1, "mimetypes": ["text/x-python"]}, {"type": "command", "label": "Test all place holders", "command_line": "%O printf '%%s\n' '#b' %b '#B' %B '#c' %c '#d' %d '#D' %D '#f' %f '#F' %F '#h' %h '#m' %m '#M' %M '#n' %n '#o' %o '#O' %O '#p' %p '#s' %s '#u' %u '#U' %U '#w' %w '#W' %W '#x' %x '#X' %X | zenity --title "Test all place holders" --text-info", "use_shell": true}, {"type": "command", "label": "Open in gedit", "command_line": "gedit %F", "filetypes": ["!directory", "standard"]}, {"type": "menu", "label": "Folder Actions", "actions": [{"type": "command", "label": "Execute command here", "command_line": "$(zenity --entry --text "Enter command" --title "execute command in %f" --width 800)", "cwd": "%f", "use_shell": true, "max_items": 1, "filetypes": ["directory"]}, {"type": "command", "label": "Start HTTP server here", "command_line": "gnome-terminal -t "HTTP Server on %f" -- python3 -m http.server --bind 127.0.0.1", "cwd": "%f", "max_items": 1, "mimetypes": ["inode/directory"]}]}, {"type": "menu", "label": "Copy details", "actions": [{"type": "command", "label": "Copy name", "command_line": "echo -n %B | xclip -f -selection primary | xclip -selection clipboard", "use_shell": true}, {"type": "command", "label": "Copy path", "command_line": "echo -n %F | xclip -f -selection primary | xclip -selection clipboard", "use_shell": true}, {"type": "command", "label": "Copy URI", "command_line": "echo -n %U | xclip -f -selection primary | xclip -selection clipboard", "use_shell": true}]}, {"type": "command", "label": "Send To Blog", "command_line": "ImageToBlog "%F"", "use_shell": true, "min_items": 1, "max_items": 1, "permissions": "read"}]}

from actions-for-nautilus.

threed-factory-store avatar threed-factory-store commented on September 26, 2024

After it's installed, where is the app that shows the right-click menu, and how does it get run?

from actions-for-nautilus.

bassmanitram avatar bassmanitram commented on September 26, 2024

That config data is invalid JSON - it has had all the intra-string quote escapes removed. Bizarre. Download the one in the sources and place it in ${HOME}/.local/share/actions-for-nautilus and rename it to config.json.

Then stop and restart Nautilus (<ALT>F2, enter nautilus -q, then open Nautilus)

If you want to see debug messages, then follow this section of the README.

from actions-for-nautilus.

bassmanitram avatar bassmanitram commented on September 26, 2024

The main extension goes in /usr/share//nautilus-python/extensions/actions-for-nautilus, whereas the configurator goes in /usr/share/actions-for-nautilus-configurator. See the makefile for more info.

from actions-for-nautilus.

threed-factory-store avatar threed-factory-store commented on September 26, 2024

This is very odd. I did everything you asked, but it didn't help.

I thought I'd try running /usr/share/nautilus-python/extensions/actions-for-nautilus/actions_for_nautilus.py, and I got this error:

Traceback (most recent call last):

File "/usr/share/nautilus-python/extensions/actions-for-nautilus/./actions_for_nautilus.py", line 2, in

from gi.repository import Nautilus, GObject

ModuleNotFoundError: No module named 'gi'

So I looked into gi.repository (https://pygobject.readthedocs.io/en/latest/getting_started.html#ubuntu-getting-started) and found how to install it on Ubuntu:

sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-4.0

I did that and it said there was nothing to install.

Then I put their hello.py on my system and ran it and it still said
Traceback (most recent call last):
File "/home/walt/.local/share/actions-for-nautilus/./hello.py", line 3, in
import gi

ModuleNotFoundError: No module named 'gi'

I'll be out of town for the next two days, but I'll dig into this more when I get home.

from actions-for-nautilus.

threed-factory-store avatar threed-factory-store commented on September 26, 2024

Had some time before I had to leave....
pip install PyGObject
gave me some errors which led me to...
sudo apt install pkg-config
after which I tried installing PyGObject again which gave me...
....
× Building wheel for pycairo (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [15 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/cairo
copying cairo/init.py -> build/lib.linux-x86_64-cpython-310/cairo
copying cairo/init.pyi -> build/lib.linux-x86_64-cpython-310/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-cpython-310/cairo
running build_ext
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
[end of output]

I don't know what's going on.

from actions-for-nautilus.

bassmanitram avatar bassmanitram commented on September 26, 2024

Been searchin'.

gi should be here - /usr/lib/python3/dist-packages/gi - get that out of the way first

If so, then I think for some reason python3 itself isn't configured to look there for the module...

from actions-for-nautilus.

bassmanitram avatar bassmanitram commented on September 26, 2024

https://bic-berkeley.github.io/psych-214-fall-2016/sys_path.html may help debug "where does python look for modules" - at least the first part tells you how to see the default places that python is looking in. For ME the sys.path has the following elements:

/usr/lib/python310.zip
/usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/home/ME/.local/lib/python3.10/site-packages
/usr/local/lib/python3.10/dist-packages
/usr/lib/python3/dist-packages

from actions-for-nautilus.

threed-factory-store avatar threed-factory-store commented on September 26, 2024

Hey, hey, hey! That was it!

My sys.path didn't list any dist-packages folders. I added /usr/lib/python3/dist-packages and now I see the menu items. Time to add mine and make the magic happen.

Thanks for diagnosing my Python problems Martin!

from actions-for-nautilus.

bassmanitram avatar bassmanitram commented on September 26, 2024

Hey, hey, hey! That was it!

My sys.path didn't list any dist-packages folders. I added /usr/lib/python3/dist-packages and now I see the menu items. Time to add mine and make the magic happen.

Thanks for diagnosing my Python problems Martin!

No problem. Glad to help

from actions-for-nautilus.

Related Issues (20)

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.