Reference to home not working in Nautilus Action-Config-Tool

Screenshot of the Field

The path field (In the given Screenshot) is given the input: ~/.subseeker/subseeker.py, but it's not working, the code isn't executing when the command runs.

enter image description here

I even tried- $HOME/.subseeker/subseeker.py

With no luck,

But when I give an absolute path, It works fine and dandy!

But i really need to make it independent of the username.

Is it possible?

2

2 Answers

This is how I fixed the issue. See the image below, I configured the tool to "Display Output", in that way you can see any error message in an easier way.

When using absolute path, you get something like this:enter image description here

What you're trying is very similar to this, here you can see the error:enter image description here

And when using $HOME variable but with python command at the beginning, it works perfectly.enter image description here

My python script just prints "It works".

Hope it helps to solve your issue.

3

It is not referenced as being possible to give a non-absolute path (expect from $PATH itself).

What you can do is add a script (placed in PATH) that will run the given file (gave as a parameter) according to the home directory of the user.

Just open a terminal and type

sudo nano /usr/bin/run-in-home

then simply write this :

#!/bin/bash
`$HOME/$1`

exit the editor (Ctrl+X, then Y and then Enter) and give execution permission to this script

sudo chmod +x /usr/bin/run-in-home

Now you can set the Path : field to run-in-home and the Parameters : field to 'path/to/file param1 parm2' so that, in your case, it would be

enter image description here

EDIT

If you want to launch your file with another program (for example a .jar file, or if python cannot be run directly), you can change /usr/bin/run-in-home to this

#!/bin/bash
if [ $# -eq 2 ]; then `$1 $HOME/$2`
else `$HOME/$1`
fi

and now the Parameters : field becomes 'program program-parameter1 program-parameter2' 'path/to/file param1 parm2', for instance 'java -jar' 'Documents/Minecraft/Minecraft.jar'.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like