Comments (9)
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.
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.
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.
I tried the same. I'm also unable to see the context menu. What else should be done? @saleguas
from context_menu.
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.
/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.
Try replacing the spaces in "Example Fast Command 1" or replacing them with underscores.
from context_menu.
Thank you. It worked. I am able to see the context menu @thescribe11
from context_menu.
This afternoon I'll work on a PR to add automatic name validation.
from context_menu.
Related Issues (20)
- [v0.1.20] Script added key to HKEY_CLASSES_ROOT HOT 2
- Example not working HOT 6
- Flexibility of the target function's signature?
- Call a single function passing selected files list instead of calling one by one HOT 1
- Context Menu visibility
- [Suggestion] The ability to add custom images to the context menu HOT 4
- Issues with displaying menu on Ubuntu 20.04
- File types with Windows default programs do not show context menus HOT 3
- Cant specify filetype with ContextCommand or ContextMenu (parameter not given)
- New Windows 11 Menu
- Don't work on Windows with Python3.9
- Examples not working on Windows 11
- 'NoneType' object has no attribute 'upper' HOT 1
- Documentation does not provide a directory example
- Can't pass function arguments HOT 8
- Window's submenu size limit HOT 4
- A way to remove context menus HOT 2
- More granular control over when to show context menu HOT 4
- Display only on shift-click HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from context_menu.