Possible to use Built-In Commands for Design Mode

  • VastOne

    VastOne - 2013-11-14

    I am trying to develop some menu items for right click purposes on a file or folder. I notice in viewing the properties of File Menu / Terminal or Root Terminal or Root Window that each of these have a Built-In Command as a Type under Menu Item..

    My question is, can these same be made available for my needs? For example, I would like to build a right click menu item to open the folder I am in in Terminal or in Root Terminal instead of going to the File / Menu area to do it there. I know there are ways to do that but compared to the Built-In Commands, they are cumbersome.

    The question is, would it be possible to make Built-In Commands available as a Type for us to use when creating our own Menu Items?

    Thanks for a great product

  • VastOne

    VastOne - 2013-11-15

    As a secondary question to this, trying to create a Menu Item as a right click I am using the following as a command to open a root spacefm window

    su-to-root -X -c spacefm %d

    SpaceFM root opens fine but the %d parameter does not work as I thought it would, opening the directory that I am in.

  • IgnorantGuru

    IgnorantGuru - 2013-11-18

    Currently, the only way to activate a built-in menu item from another menu item is by activating its key shortcut with eg:

    spacefm -s emit-key 0xffbe 0   # press F1 to show Help

    It is planned to extend that functionality a bit.

    To open a terminal, you can also just use this socket command directly, which runs bash in the user's terminal:

    spacefm -s run-task cmd --terminal bash

    Or for a root terminal you use eg:

    spacefm -s run-task cmd --terminal sudo bash

    su-to-root -X -c spacefm %d
    SpaceFM root opens fine but the %d parameter does not work

    The command passed to su-to-root must be one argument. In your example the %d is being passed to su-to-root, not to spacefm. Normally you would quote the whole -c argument, but since SpaceFM automatically quotes %d, it's better to escape the space:

    su-to-root -X -c spacefm\ %d

    Note that there is an inherent security risk when adding menu items that run as root, unless they are exported and installed as plugins, as noted here under Run As User.

  • VastOne

    VastOne - 2013-11-18

    ^ Thanks IgnorantGuru... the command for root window now works perfectly and both the terminal setting and root window settings I wanted are perfect

    I appreciate it!

  • IgnorantGuru

    IgnorantGuru - 2013-11-20

    Actually, I don't know why I used a socket command. You can also just set the command line to 'bash', and on the Options tab select Run In Terminal. But either way works - this is more direct.



Cancel  Add attachments