Code Monkey home page Code Monkey logo

Comments (9)

saleguas avatar saleguas commented on July 23, 2024

I did all my testing in an Ubuntu 20.04 VM, so it should work. Did you restart nautilus after running the command? And please post your code. Thanks.

from context_menu.

l3str4nge avatar l3str4nge commented on July 23, 2024
from context_menu import menus
fc = menus.FastCommand('Example Fast Command 1', type='FILES', command='echo Hello')
fc.compile()

then nautilus -q then open file manager. Maybe i am missing something?

from context_menu.

saleguas avatar saleguas commented on July 23, 2024

Does the entry appear on the context menu? The way it interacts on Linux is quite weird and the shell being ran isn't the same shell that you probably have open (you won't have any output).

from context_menu.

susarlanikhilesh avatar susarlanikhilesh commented on July 23, 2024

I tried the same. I'm also unable to see the context menu. What else should be done? @saleguas

from context_menu.

susarlanikhilesh avatar susarlanikhilesh commented on July 23, 2024

As you mentioned it doesn't execute in the same shell.
I wrote bash scripts
one.sh is the filename
#!/bin/sh

echo one.sh: pid is "$$"
python3 simple_fast_command.py
. ./two.sh
echo done with "$0"

two.sh is the filename#!/bin/bash
echo two.sh: pid is "$$"
nautilus -q

the output after I run one.sh
one.sh: pid is 37341
/home/nikki/.local/share/
two.sh: pid is 37341
done with one.sh

So, typically they ran on same processes or terminal.

But still I don't see context menu.
Let me know if I missed anything else.

from context_menu.

susarlanikhilesh avatar susarlanikhilesh commented on July 23, 2024

/usr/lib/python2.7/dist-packages/gi/types.py:220: Warning: type name 'Example Fast Command 1+ExampleMenuProvider' contains invalid characters
gi.type_register(cls, namespace.get('gtype_name'))
Traceback (most recent call last):
File "/home/nikki/.local/share/nautilus-python/extensions/Example Fast Command 1.py", line 21, in
class ExampleMenuProvider(GObject.GObject, Nautilus.MenuProvider):
File "/usr/lib/python2.7/dist-packages/gi/types.py", line 229, in init
super(GObjectMeta, cls).init(name, bases, dict
)
File "/usr/lib/python2.7/dist-packages/gi/types.py", line 208, in init
cls._type_register(cls.dict)
File "/usr/lib/python2.7/dist-packages/gi/types.py", line 220, in _type_register
_gi.type_register(cls, namespace.get('gtype_name'))
RuntimeError: could not create new GType: Example Fast Command 1+ExampleMenuProvider (subclass of GObject)
Nautilus-Share-Message: 20:44:54.088: Called "net usershare info" but it failed: Failed to execute child process β€œnet” (No such file or directory)

Instead of running nautilus -q, I ran nautilus -w.
Then I got the above error

from context_menu.

thescribe11 avatar thescribe11 commented on July 23, 2024

Try replacing the spaces in "Example Fast Command 1" or replacing them with underscores.

from context_menu.

susarlanikhilesh avatar susarlanikhilesh commented on July 23, 2024

Thank you. It worked. I am able to see the context menu @thescribe11

from context_menu.

thescribe11 avatar thescribe11 commented on July 23, 2024

This afternoon I'll work on a PR to add automatic name validation.

from context_menu.

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.