Menu

#6 [QUESTION] Running on VM - Ubuntu

open
nobody
None
2021-05-11
2020-06-03
Anonymous
No

Originally created by: L3str4nge

Hello, I am trying create fast command but it seems not working. Did someone tried create context menus on VM?

My configuration:
HOST: Windows 7 64bit
GUEST: Ubuntu 20.04 64bit
Running on Virtual Box 6.1

Thank's for any help.

Discussion

  • Anonymous

    Anonymous - 2020-06-03

    Originally posted by: saleguas

    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.

     
  • Anonymous

    Anonymous - 2020-06-04

    Originally posted by: L3str4nge

    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?

     
  • Anonymous

    Anonymous - 2020-06-04

    Originally posted by: saleguas

    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).

     
  • Anonymous

    Anonymous - 2021-05-10

    Originally posted by: susarlanikhilesh

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

     
  • Anonymous

    Anonymous - 2021-05-10

    Originally posted by: susarlanikhilesh

    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.

     
  • Anonymous

    Anonymous - 2021-05-10

    Originally posted by: susarlanikhilesh

    /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 <module>
    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</module>
    )
    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

     
  • Anonymous

    Anonymous - 2021-05-10

    Originally posted by: thescribe11

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

     
  • Anonymous

    Anonymous - 2021-05-11

    Originally posted by: susarlanikhilesh

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

     
  • Anonymous

    Anonymous - 2021-05-11

    Originally posted by: thescribe11

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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.