Giter VIP home page Giter VIP logo

nautilus-scripts's Introduction

Enhanced File Manager Actions for Linux

This project offers a collection of file manager actions, also known as Nautilus Scripts, meticulously crafted to enrich the functionality of file managers. With intuitive right-click actions on files and directories, it enhances the user experience seamlessly.

Compatible with file managers:

screenshot

Installing

To install, just run the following command in the terminal:

bash install.sh

Advantages

While numerous scripts are available for file managers on the web, many suffer from poor functionality, lack of error checking, and dependency management. Some scripts only work with files that don't have special characters in their names, among other limitations. To address these shortcomings, I have developed my own set of scripts, which offer the following advantages:

  • Parallel task execution: Processes multiple files simultaneously. Very fast!
  • Progress dialog: Displays a progress dialog and allows interruption of tasks at any time.
  • Status notifications: Notifies users of dependency errors and MIME types.
  • Dependency management: Prompts users to install any missing dependencies.
  • Remote file support: Works with files stored on remote servers.
  • Non-destructive output: Never overwrites the input file; the output is distinct.
  • Log file: Produces an Errors.log file when a task ends with an error.
  • Direct usage: Direct usage without requiring input parameters.
  • Keyboard shortcuts: Provides keyboard shortcuts for the scripts.
  • File manager compatibility: Designed for major file managers like GNOME Files (Nautilus), Dolphin, Caja, Nemo and Thunar.
  • Distro compatibility: Designed to work on major GNU/Linux distributions, such as Ubuntu, Mint, Debian, Fedora, and Manjaro.
  • Easy adaptation: Scripts can be easily copied and adapted for other purposes.
  • Bash implementation: All scripts are implemented in Bash. So, the scripts work well in the shell (without a graphical interface) and file managers.
  • Shell script validation: All scripts have been checked using ShellCheck.

Keyboard Shortcuts

Key Action
F3 Code Editor
F4 Terminal
F7 Disk Usage Analyzer
<Control>E Extract Here
<Control><Alt>C Compress...
<Control><Alt>G Compress to 'tar.gz' (each)
<Control><Alt>S Compress to 'tar.zst' (each)
<Control><Alt>V Paste as hard link
<Control><Alt>X Compress to 'tar.xz' (each)
<Control><Alt>Z Compress to 'zip' (each)
<Control><Shift>C Compare items
<Control><Shift>E List empty directories
<Control><Shift>G Git clone (URLs in clipboard)
<Control><Shift>H List hidden items
<Control><Shift>O Open item location
<Control><Shift>P List permissions and owners
<Control><Shift>U List duplicate files
<Control><Shift>V Paste as symbolic link
<Control><Shift>X Download (URLs in clipboard)
<Control><Shift>Y List file information
<Control><Alt>1 List file mime
<Control><Alt>2 List text issues
<Control><Alt>3 List files with bad chars
<Control><Alt>4 List encodings
<Control><Alt>5 List line breaks
<Control><Alt>6 List lines count
<Control><Alt>7 List max line length
<Control><Alt>8 List words count
<Control><Alt>9 List largest directories
<Control><Alt>0 List largest files

Compatibility

File managers compatibility:

File manager Environment Menu integration Shortcuts
GNOME Files (Nautilus) GNOME Yes Yes
Caja MATE Yes Yes
Dolphin KDE Plasma Yes No
Nemo Cinnamon Yes Yes
PCManFM-Qt LXQt Yes No
Thunar Xfce Yes Yes

Most scripts have been tested on the following GNU/Linux distributions:

  • Ubuntu 18.04, 20.04, 22.04, 24.04
  • Debian 12 (Gnome and KDE)
  • Fedora Workstation 39, 40
  • Kubuntu 22.04, 24.04
  • Lubuntu 22.04, 24.04
  • Manjaro 23 (Gnome)
  • Mint 21 (Cinnamon and Mate)
  • openSUSE Tumbleweed 2024 (Gnome)
  • Xubuntu 23.10, 24.04
  • Zorin OS Core 17.1

Contributing

If you spot a bug or want to improve the code or even improve the content, you can do the following:

  • Open an issue describing the bug or feature idea;
  • Fork the project, make changes, and submit a pull request.

nautilus-scripts's People

Contributors

cfgnunes avatar femto-code avatar papanito avatar vlahovivan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nautilus-scripts's Issues

Document how to install scripts for all users

I am unable to find where should I place the scripts to be seen by all users of the system, I am not sure if maybe it is a nautilus limitation... or I am looking at the wrong PATHs :/

Thanks a lot

Add a script to shred and remove files

The purpose of the script would be to call shred --iterations=1 --zero --remove

This could be one way of achieving this:

ITERATIONS=1
sed '/^$/d' <<< $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | xargs -d'\n' shred --iterations=$ITERATIONS --zero --remove 2>&1

But shred is a very dangerous command, and should not be ran lightly. There should be a warning window before running the script, listing the files about to be shredded and asking for confirmation. Optionally, the same window could have a holder to choose the number of iterations to pass into shred. In my example, I hardcoded only one pass, which is generally enough.

Add ability to sort results when calculating checksums

At this time, the scripts to calculate checksums return a single string for each file through a zenity window with no columns. This prevents any possibility to sort results.

If zenity is called with the "--column" option, then the output of md5sum (or any other hash function), could be placed in the appropriate column, thus giving the possibility of sorting each field.

The following code produces the intended behavior, giving initial results sorted by checksum:

sed '/^$/d' <<< $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | xargs -d '\n' md5sum | sort | sed 's/^\([^ ]*\) \(.*\)$/\1\x0\2/' | \
zenity --width=900 --height=300 --list --title "Hashes de archivos" --text "Archivos seleccionados" --column "MD5" --column "Archivo"

This is the resulting window after running the code above:
image

Add 'Paste while reconstructing path' script?

Hello. I have another suggested script that, I think, would be useful for you to consider implementing.

Nautilus has no graphical way, that I'm aware of, to generate multiple folders nested in a path. What I mean by that is if you were in ~ and you needed to create ./some/large/number/of/nesting/folders/potentially/a/very/large/number/of/folders you would have to do this manually in multiple clicks, or you'd have to resort to mkdir -p if you wanted to do this in any sort of efficient manner.
(KDE's Dolphin can do something similar, but to my knowledge, Nautilus cannot)

A real, practical use case I face for this is moving files between Wine prefixes, where a receiving Wine prefix expects the file in a specific folder structure. If a file is in ~/.local/share/Steam/steamapps/compatdata/1111111/pfx/drive_c/users/steamuser/AppData/Roaming/tracking/userFiles/settings/profile/settings.xml and I want to move it to the same location in another Wine prefix, such as ~/.local/share/Steam/steamapps/compatdata/222222/pfx/drive_c/ I have to reconstruct the /users/steamuser/AppData/Roaming/tracking/userFiles/settings/profile/ by hand (or via mkdir -p), which is also error-prone in case of capitals and other complexity.

The solution to this would be a script that can paste while reconstructing the origin path. The logic would be thus:

  1. User would copy source files as normal.
  2. Upon invoking the script, the logic would look at the name of the folder where it is being pasted. If the folder name is the same as one of the folders in the path of the copied content, it would create any path found after the matched folder name, and paste the file(s) in the same location as the original path.

So, to use the above example, if I copied ~/.local/share/Steam/steamapps/compatdata/1111111/pfx/drive_c/users/steamuser/AppData/Roaming/tracking/userFiles/settings/profile/settings.xml and pasted it into ~/.local/share/Steam/steamapps/compatdata/222222/pfx/drive_c/, the script would identify that drive_c is present in the source path, and would create /users/steamuser/AppData/Roaming/tracking/userFiles/settings/profile/ (perhaps using mkdir -p?) and put settings.xml into it.

Please let me know if you need any clarification. I know this is not exactly an everyday operation, but I have personally found myself needing to resort to mkdir -p often enough that having a graphical way to do this would be helpful.
Thank you for all your efforts so far.

Add recursive 'Past as hard link(s)' script?

An excellent project, thank you.

Could you please consider adding an option to recursively paste copied selection as hard links?

If the user selected a folder, it would recursively replicate the folder structure, and populate it with the hard links to files from the source and if the user selected one or more files, it would simply do a 1:1 hard link.
There should probably also be errors to prevent users trying to cross disk boundary, since that's not possible as hard links. Maybe "Would you like to paste a symlink instead?" confirmation?

Basically, a way to graphically invoke cp -al.

Add openSUSE support

Hi. Could you please consider adding openSUSE support (at least Tumbleweed)?
I'm happy to help test if needed.

After getting used to your excellent tools on Fedora, I miss them dearly on openSUSE…

If not, could you list all the dependencies in the documentation, so I can install them manually and put the scripts in the right place?

Thank you for your efforts

Overwrites scripts already in directory

The scripts are great, thank you.
The only issue is that it has it emptied and overwrote the scripts already in the directory?
Worth looking into. Thanks!

Not working, I did "bash install.sh", but still no submenus available at all.

I'm using Zorin OS and Nemo file manager. It doesnt work in Nemo file manager whatsoever, the "scripts" option doesnt even come up in the submenu. But it does work in Nautilus, but wont work in Nautilus with avif, heic or jxl image files.

Please help.
Thanks.

Also, very important, see how Lich-Corals accomplishes this in Nemo, his only does certain types of conversion:

Lich-Corals/linux-file-converter-addon#21

https://github.com/Lich-Corals/linux-file-converter-addon/tree/dev

Use diffpdf to compare PDF files

Thank you for putting together this great script collection.

I see you use meld to compare files and directories. It would be great if we could use diffpdf when detecting that the selected files are PDFs (choosing exactly 2 files, and both are PDFs)

I'm attaching a quick script I put together a couple of years ago to achieve this. It's probably not the tidiest, and might fail on certain conditions, but it generally works, and it could be used for ideas to implement this correctly.
compare.txt

Archive extract - support *.zst

Currently file-roller has not fully support zst archive, we can check if zstd installed first, then run tar --use-compress-program=unzstd -xvf $INPUT_FILES &

Installer copies itself into scripts directory

Hi! The installer copies itself (install.sh) into the file manager's scripts directory. This leads to a separate entry in the right-click menu (that is not functional).

I would suggest excluding them from the files to be copied. My PR #11 already proposes some changes with a similar direction. It could be easily extended to take care of generally excluding the following files at root from being copied:

  • install.sh
  • .gitignore
  • (README.md)

Thanks for your time!

Add 'Move and leave a symbolic link behind'

Hi.

I have (another) script idea. Often when I'm moving large files around to manage storage (for example, moving things to my secondary drive) I find myself copying the files over, having to wait for them to copy over (and potentially waiting a long time if I'm moving hundreds of gigs). When it is done, I need to go back to the original location, delete the original files, and create a symbolic link from the new location to the old location, so that any programs that expect the files in the old location don't freak out.

It'd be helpful if there was a script that performed a move of the files and when the files were done moving, it would leave a symbolic link with the same name as the moved files in the old location.

Thanks for all the effort so far, I really appreciate it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.