LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where do nautilus scripts go ?
#1
Hello,

it says to add nautilus scripts here -

Code:
~/.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).



Reply
#2
Thunar works slightly different to Nautilus. This might help :

Code:
https://docs.xfce.org/xfce/thunar/custom-actions
Owner and DJ at WKDfm Radio ( www.wkdfm.co.uk )
Reply
#3
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.
Reply
#4
No probs, what you can do is check .profile in your home folder has the following lines:

Code:
# 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:
mkdir ~/bin

put all your bash scripts in bin and make them executable

Code:
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:
scriptname.sh

Make life easier by creating launchers for you bash scripts Smile
Have fun Smile
Owner and DJ at WKDfm Radio ( www.wkdfm.co.uk )
Reply
#5
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.
[Image: 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  Smile .
On Fedora I use a different book Linux Bible to learn different things.
Reply
#6
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.
Owner and DJ at WKDfm Radio ( www.wkdfm.co.uk )
Reply
#7
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.
Reply
#8
I forgot to write, the scripts in my bin folder, to run them I dont use -
Code:
scriptname.sh
I just type the

Code:
scriptname
on 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.
Reply
#9
[member=8425]nateliv[/member] thanks for the update Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)