Linux Lite Forums

General => Off Topic => Topic started by: bitsnpcs on February 01, 2019, 12:22:51 AM

Title: Where do nautilus scripts go ?
Post by: bitsnpcs on February 01, 2019, 12:22:51 AM
Hello,

it says to add nautilus scripts here -

Code: [Select]
~/.local/share/nautilus/scripts/

there is no nautilus directory in the share directory, I have tried creating the nautilus directory in share directory, and the scripts directory inside this, nautilus doesn't pick up the scripts, (it doesn't add "scripts" to its right click context menu on a file in Documents directory of Home directory, so a script can be selected from this to run on the selected file/s).



Title: Re: Where do nautilus scripts go ?
Post by: DeepThought on February 01, 2019, 12:31:24 AM
Thunar works slightly different to Nautilus. This might help :

Code: [Select]
https://docs.xfce.org/xfce/thunar/custom-actions
Title: Re: Where do nautilus scripts go ?
Post by: bitsnpcs on February 01, 2019, 01:36:03 AM
Thank You.I realise thanks to your help my error that it's Thunar :-[ .
I was looking to use shell scripts as it is what I am learning currently, it was more for  practicing/experimenting with that than needing an actual function.
Title: Re: Where do nautilus scripts go ?
Post by: DeepThought on February 01, 2019, 01:48:49 AM
No probs, what you can do is check .profile in your home folder has the following lines:

Code: [Select]
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

Then create a bin dir in your home folder.

Code: [Select]
mkdir ~/bin
put all your bash scripts in bin and make them executable

Code: [Select]
chmod +x ~/bin/*
You may need a reboot to make sure everything works.
You should now be able to start any script in bin via terminal in any folder with:

Code: [Select]
scriptname.sh
Make life easier by creating launchers for you bash scripts :)
Have fun :)
Title: Re: Where do nautilus scripts go ?
Post by: bitsnpcs on February 01, 2019, 02:29:47 AM
I have similar done, but slightly differently, the Linux Command Line book, which is what I am using, chapter 28, it was a few chapters before the shell scripting, it showed to change the path to include the folder using the terminal command, which is what I done, and I made the bin folder in Home directory etc.
(https://i.ibb.co/8XFMpzf/Screenshot-2019-02-01-06-50-26.png)

I can run the scripts from the command line, you can see the system information one on the blog link after it is run.

It was on Fedora magazine I was looking at something else, (mindmaps) and noticed an article about running apps without opening the gui, via the script run by selecting from the right context menu in Nautilus, ran FSearch on LL found nautilus files and thought Id give it a try on LL, as I learn shell scripting and command line on LL, from this book, and the help of members  :) .
On Fedora I use a different book Linux Bible to learn different things.
Title: Re: Where do nautilus scripts go ?
Post by: DeepThought on February 01, 2019, 02:37:08 AM
Custom-actions will allow you to do similar and add your scripts to the context menu, that link I gave explains how to do this.
Title: Re: Where do nautilus scripts go ?
Post by: bitsnpcs on February 01, 2019, 04:08:15 AM
Yes I have looked at the link.
With the nautilus one "the" thing that caught my eye was, it is a baby step forward from what I currently already do with scripts.
eg; make the script, drop it in a directory, and make it executable.

The nautilus example just required a different directory to drop the scripts in to.
The difference between the 2 directories is the nautilus one enables scripts to be selected and run from the context menu instead of the command line.
It would involve learning new to me code for inside the shell script, that on its own is enough learning wise for additional outside of the book at this stage.
Title: Re: Where do nautilus scripts go ?
Post by: bitsnpcs on February 01, 2019, 04:39:32 AM
I forgot to write, the scripts in my bin folder, to run them I dont use -
Code: [Select]
scriptname.shI just type the

Code: [Select]
scriptnameon the command line, hit enter and it runs.
I don't know if it matters, or which is the best way, I just followed the way from the book when first learning to how to do it.
Title: Re: Where do nautilus scripts go ?
Post by: nateliv on March 26, 2019, 07:33:17 AM
I had a look at that and I have some good news: nautilus-open-terminal will be included in Bea. This will allow to open a terminal from any folder from nautilus.. through the context menu.

I test nautilus-gksu which allows to open a folder as root but I found it buggy. It doesn't work with metaaddresses.. (computer and home for instance), and for some reason it opens two windows instead of one. Also it is hard to see which windows are open as root, and which aren't. So I decided not to include that.






Bluestacks (https://bluestacks.vip/) Kodi (https://kodi.software/) Lucky Patcher (https://luckypatcher.pro/)
Title: Re: Where do nautilus scripts go ?
Post by: bitsnpcs on April 05, 2019, 08:12:11 AM
@nateliv thanks for the update :)