cfgnunes / nautilus-scripts Goto Github PK
View Code? Open in Web Editor NEWA set of actions for extending the functionality of the GNOME Files (Nautilus), Dolphin, Caja, Nemo, PCManFM-Qt and Thunar file managers.
License: MIT License
A set of actions for extending the functionality of the GNOME Files (Nautilus), Dolphin, Caja, Nemo, PCManFM-Qt and Thunar file managers.
License: MIT License
Please find attached my implementation of "Select Left" and "Compare" scripts which works across different folders and via Gnome's SMB pseudo paths. It would be great to have this working in your scripts. I had to rename the files to a .txt extension becuause GitHub is a Windows shop.
Compare.txt
SelectLeft.txt
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
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
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:
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.
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"
Great job. My contribution in case you are interested
https://github.com/maravento/vault/blob/master/scripts/bash/send2phone
dependencies: sudo apt install kdeconnect
regards
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 &
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.
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
.
Tested on Fedora 39. The bash script does not work (no output) when whiptail
is not installed on the system.
Maybe consider adding a note or a check for the command.
Thanks for the great script collection!
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!
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
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.
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
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.