Git Product home page Git Product logo

nautilus-fileconverter-43's Introduction

linux-file-converter-addon

NautilusConverter-1 drawing

0. ReadMe Contents

  1. Features
  2. Installation
    1. Install dependencies
    2. Optional dependencies
    3. Install the extension
  3. Configuration
    1. Automatic updates
    2. Shown menu items
    3. Other options
  4. Updating
  5. Usage
  6. Warnings and errors
  7. Any questions?
  8. Credits

1. Features

Convert between various image, audio and video formats using the context menu. The addon is written in Python and available for Nautilus and Nemo file viewers. It adds a new option to the context menu of the file viewer to create an easy way to convert between a huge amount of file types. The program offers many options to customize the appearance of its context menu. There are also a few extra formats to convert with, which can be added by installing optional dependencies. The tool has a built-in auto-update function to make sure the newest version is always provided. Note that the Nemo port is very new and not as well tasted as the Nautilus version. If you experience any bugs, pleas report them on the issue page.

    flowchart TD
    A[Supported Image Files]
    B[Supported Audio Files]
    C[Supported Video Files]
    D[image]
    E[audio]
    F[video]

    A["JPG<br/>JPEG<br/>JPE<br/>PNG<br/>BMP<br/>AI<br/>EPS<br/>PS<br/>GIF<br/>ICO<br/>PCX<br/>PPM<br/>TIFF<br/>TIF<br/>XBM<br/>FLI<br/>FPX<br/>BIN<br/>WMF<br/>XPM<br/>WEBP<br/>AVIF*¹<br/>HEIC*¹<br/>JXL*²"]
    B["MP3<br/>MPGA<br/>MPG<br/>MPEG<br/>WAV<br/>M3U<br/>M3U8<br/>M4A<br/>MKA<br/>AAC<br/>3GP<br/>3G2<br/>OGG<br/>OPUS"]
    C["MP4<br/>WebM<br/>MKV<br/>AVI<br/>MOV<br/>QT"]

    D["JPEG<br/>PNG<br/>BMP<br/>GIF<br/>WEBP<br/>JXL*²<br/>TIFF<br/>Different square sizes"]
    E["MP3<br/>WAV<br/>ACC<br/>FLAC<br/>M4A<br/>OGG<br/>OPUS"]
    F["MP4<br/>WebM<br/>MKV<br/>AVI<br/>MP3<br/>WAV"]

    A --> D
    B --> E
    C --> F

Needs pyheif.
Needs jxlpy.

2. Installation

2.1 Dependencies

pip is a pre-dependency for pillow, it can be installed with the following commands:

Debian based distros:
sudo apt install python3-pip

Fedora based distros:
sudo dnf install python3-pip

Arch based distros:
pacman -S python-pip

python-pillow is needed to convert images. It can be installed using pip:

pip install Pillow

ffmpeg is needed to convert audio and video.

Debian based distros:
sudo apt install ffmpeg

Fedora based distros:
sudo dnf install ffmpeg

Arch based distros:
sudo pacman -S ffmpeg

Nautilus specific dependencies

GNOME's file viewer Nautilus should be installed, otherwise it will be hard to install extension to it.

nautilus-python needs to be installed to install extensions:

Debian based distros:
sudo apt install python3-nautilus

Fedora based distros:
sudo dnf install nautilus-python

Arch based distros:
sudo pacman -Sy python-nautilus

Nemo specific dependencies

Nemo needs to be installed.

Debian based distros:
sudo apt install nemo

Fedora based distros:
sudo dnf install nemo

Arch based distros:
sudo pacman -S nemo

2.2 Optional dependencies

pyheif (HEIC, AVIF)

pyheif is needed if you want to convert from heif or avif format.
Install it using this command:

pip install pyheif

You may need to install some dependencies before installing pyheif. Otherwise you could get an error installing it.

yum install libffi libheif-devel libde265-devel

In addition, to convert to avif format you will need this plugin for Pillow.

pip install pillow-avif-plugin

jxlpy (JXL)

jxlpy is needed if you want to convert from jxl format.
Install it using this command:

pip install jxlpy

Note: jxlpy is in a very early state, you may have issues while installing it using pip. You may need to install it manually.

2.3 Install the extension

Installation for Nautilus

  • Download the nautilus-fileconverter.py file from the release page.
    • Git users can also get the repository with these commands:
      git clone https://github.com/Lich-Corals/linux-file-converter-addon
      
      cd ./linux-file-converter-addon
  • For a system-wide installation move the file to '/usr/share/nautilus-python/extensions/' using this command in the dictonary with the file:
    sudo mv nautilus-fileconverter.py /usr/share/nautilus-python/extensions/nautilus-fileconverter.py
    • For a user specific installation move the file to '~/.local/share/nautilus-python/extensions/' using this command in the dictonary with the file:
      mv nautilus-fileconverter.py ~/.local/share/nautilus-python/extensions/nautilus-fileconverter.py
  • Now you only have to restart Nautilus using the following commands:
    #Quit Nautilus
    nautilus -q
    
    #start it again, you can also use the normal launcher.
    nohup nautilus & disown

Installation for Nemo

  • Download the nautilus-fileconverter.py and the nautilus-fileconverter.nemo_action file from the release page.
    • Git users can also get the repository with these commands:
       git clone https://github.com/Lich-Corals/linux-file-converter-addon
    
       cd ./linux-file-converter-addon
  • Copy the files into the ~/.local/share/nemo/actions folder:
       mv nautilus-fileconverter.py ~/.local/share/nemo/actions/nautilus-fileconverter.py
       mv nautilus-fileconverter.nemo_action ~/.local/share/nemo/actions/nautilus-fileconverter.nemo_action

You may need to enable the action in Nemo's settings. To do so, you can open Nemo and go edit>Plugins (or press Alt+P) and check the checkbox labeled with "Convert to..." in the "Actions" area.

3. Configuration

The program can be configured using the NFC43-Config.json file, which will be created in the installation dictionary when the script is executed for the first time. Just modify the file, by changing the 'true' and 'false' values. If the program is installed in a root location, you need to change the configuration inside the script. Don't forget to save your changes, and restart Nautilus after modifying the configuration!

#Quit Nautilus
nautilus -q

#start it again, you can also use the normal launcher.
nohup nautilus & disown

3.1 Automatic updates

Automatic updates are only working in the home dictionary. If you've installed the script at the system-wide location, you may turn off automatic updates.

To turn off automatic updates, open the config file with a text editor and set the automaticUpdates variable to 'false'. To manually trigger a self-update, just open the .py file with a text editor and change the value of the converterVersion variable.

3.2 Shown menu items

To turn off the patch note button in the context menu, open the config file with a text editor and set the showPatchNoteButton variable to 'false'.

To turn off the Configure NFC43 button in the context menu, open the config file with a text editor and set the showConfigHint variable to 'false'. Note: This option is not available in Nemo so far.

To turn off the 'convert to square' option, open the config file with a text editor and set the convertToSquares variable to 'false'.

To turn off the 'convert to wallpaper' function, open the config file with a text editor and set the convertToWallpapers variable to 'false'.

3.3 Other options

To turn off the patch note pop-up, open the config file with a text editor and set the showPatchNotes variable to 'false'. To turn off the Double script installation Warning, open the config file with a text editor and set the checkForDoubleInstallation variable to 'false'. Note: This option may be a bit buggy in Nemo, I'll fix it in the future if it appears to be annoying to some users.

4. Updating

If the script is installed in the home folder (~/.local/share/nautilus-python/extensions/) or has permissions to write in it's dictionary, it will update automatically as long as the automatic updates aren't disabled.

If automatic updates are disabled, you can run the installation commands again to update the program.

5. Usage

Just right click on an supported file and choose the "Convert to..." option. In this sub menu you can select any file type you want to convert to.

Converting a file can take some time. There is no indicator when the process is done.

If you experience any issues with the extension, please report it on the issues page.

6. Warnings and errors

WARNING(Nautilus-file-converter)(XXX):

(000): "pyheif" not found

Causes:
This warning is caused, because the script is not able to find your pyheif installation.

Possible Effects:
Without pyheif, the converter won't be able to convert from heif file format.

How to solve?
To solve this warning, you need to install pyheif using pip. View the Optional dependencies section to get installation instructions.

(001): "jxlpy" not found

Causes:
This warning is caused, because the script is not able to find your jxlpy installation.

Possible Effects:
Without jxlpy, the converter won't be able to convert from- or to jxl file format.

How to solve?
To solve this warning, you need to install jxlpy using pip.
View the Optional dependencies section to get installation instructions.

(002): "pillow-avif-plugin" not found

Causes:
This warning is caused, because the script is not able to find your pillow-avif-plugin installation.

Possible Effects:
Without pillow-avif-plugin, the converter won't be able to convert to avif file format.

How to solve?
To solve this warning, you need to install pillow-avif-plugin using pip.
View the Optional dependencies section to get installation instructions.

(003): No permission to self-update

Causes:
The program has no permission to write it's own file.
This warning usually occurs when the script is located at "/usr/share/nautilus-python/extensions/".

Possible Effects:
The self-update function will not be available.
The script may show the releases page on multiple startups if self-update isn't disabled.

How to solve?
To remove the release popup, you may disable the corresponding setting. To do this, please follow the instructions on the configuration page.
To get self updates, the script needs the permissions to write to itself. This can be done by changing the file permissions using chmod or by running the script as a privileged user.
To be able to self-update, the user, who is executing the script (by starting Nautilus) needs permissions to edit the script itself.

(004): No permission to write configuration file

Causes:
The program has no permission to write in the dictionary where it is installed.
This warning usually occurs when the script is located at "/usr/share/nautilus-python/extensions/".

Possible Effects:
The self-update function may not be available.
The script needs to be configured by editing the script itself.
If self-updating is enabled, the script's configuration will reset when a update is performed.

How to solve?
To fix this, the script needs the permissions to write inside the folder, where it is located. This can be done by changing the folder permissions using chmod or by running the script as a privileged user.
To use the configuration file, the user, who is executing the script (by starting Nautilus) needs permissions create and edit files inside the installation dictionary.

To prevent the settings from being reset, you can add a config file to the dictionary. Note that the file will not be update if new configurations are added.

(005): Double script installation detected

Causes:
The script is installed in a home location and finds another script with the same name in the root installation folder ("/usr/share/nautilus-python/extensions/").

Possible Effects:
The context menu may appear two times.

How to solve?
To solve this issue, you have to remove one of the files (in "/usr/share/nautilus-python/extensions/" or in "~/.local/share/nautilus-python/extensions/")

(006): Attempting to update

Causes:
Automatic updates are enabled and there are updates available. This is not an error, just information to make problems easier to solve.

7. Any questions?

If anything is not clear...
If you have a problem...
If you need a specific feature...
If any of your files is not supported...
...feel free to write a GitHub issue!

8. Credits

Authors

Pull requests

nautilus-fileconverter-43's People

Contributors

d10f avatar dervedro avatar lich-corals avatar

Stargazers

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

Watchers

 avatar  avatar

nautilus-fileconverter-43's Issues

Progress bar

Thank you for this script, exactly what I wanted!

You state in the readme that the ui freezes while converting. Would it be possible to add a progress bar and a cancel button? Or is there a technical limitation?

E.g. the nautilus-image-converter extension is able to do so.

Nemo files adaption

Just wanted you guys to know I gave you guys a shout out and said good things about you guys in the Zorin OS forum.

https://forum.zorin.com/t/nemo-file-manager-wont-thumbnail-preview-avif-files

Thanks again for creating this tool! its a life saver in linux based OS's!

@derVedro , @Lich-Corals

One last think I'll say is that i like Nemo better than nautilus, because you can double click a file or folder and rename it, which is quickest, and which you cant do in nautilus. And it would be cool to be able to use your tool in Nemo. Its more time consuming having to switch to Nautilus. But I'm still glad I can do it in Nautilus! And I use your tool all the time.

Blocking conversion

The way audio+video conversion is done is by calling some over tool like ffmpeg. It may take some time especially when processing video.The bad thing about is that python waits until the shell call is done, so nautilus is blocked in that time. My propose to solve it is in #7 , simple run ffmpeg in background and nohup it.

Ignore wrong typed files in selection

Unexpected behavior occurs if various file formats (like audio and image files) were sending to converter at once. At the moment the script works in such a way that convert function gets all selected files. So it can happen that the wrong file types are tried to be converted (some mp3 files into jpeg). We need to handle it. I suggest (#9) to drop such converting attempts.

Getting the conversion prop twice in the right-click menue after getting up to date

Hello, first of, thanks a lot for your work !
I've encountered a problem, i followed the installation instructions, thinking that the file nautilus-fileconverter.py would overwrite the precedent version. However, i now have the convert-to option twice in the nautilus. right click menu. The second problem is the git-hub page of this project opens up by itself when opening nautilus sometimes. After removing the file, i got back to only one option. So i assume the extension exists somewhere else on my computer.
Thanks by advance for you're answer.

An error in Line 84

Describe the bug
An error in line 84 simply not allowing the program to run in the latest version.
Reverting back to an older version works just fine.

OS
Basic information about the used OS

  • OS Name: Ubuntu 23.04
  • Package manager: apt
  • Gnome version: GNOME 44.3
  • Nautilus version (nautilus --version): GNOME Nautilus 44.2.1

Nautilus errors
File "/usr/share/nautilus-python/extensions/nautilus-fileconverter.py", line 84 def get_file_items(self, *args) -> List[Nautilus.MenuItem]: IndentationError: unexpected indent

Plugin causes opening web-page

Describe the bug
Plugin causes opening web-page of release notes since version 1.20. I'm using ubuntu 23.10. I reopen nautilus >20 per day and every reopening causes opening release notes page.

To Reproduce
Steps to reproduce the behaviour:

  1. Start process of nautilus.

Expected behaviour
Nothing.

OS

  • OS Name: Ubuntu 23.10
  • Package manager: apt, snap
  • Gnome version: GNOME 45.2
  • Nautilus version (nautilus --version): GNOME nautilus 45.rc
  • Python version (python3 --version): Python 3.11.6
  • pip version (pip --version): 23.2

Nautilus errors
WARNING(Nautilus-file-converter): "pyheif" not found, if you want to convert from heif format, install the package using "pip install pyheif". See the readme on GitHub for more information.
WARNING(Nautilus-file-converter): "jxlpy" not found, if you want to convert from- or to jxl format, install the package using "pip install jxlpy". See the readme on GitHub for more information.

Cant convert .heic image files or .avif image files.

Just want to say thanks again for making this image converter tool. I do a lot of photo editing & I always use PNG format, so I convert many of my image files in bulk to PNG. However heic & avif dont work & never have. Not sure why?
Could you please help me fix this?
(Tagging @Lich-Corals , & @derVedro )

-Thanks again!

Only two subjects left, can it be used with nemo or thunar? & generally PNG has a compression setting between 0 & 9

1.) nemo is the only file manager i know that allows the feature to double click of mouse to rename folder/file quickly. Also nemo shows "filesystem/root" shortcut in left hand column unlike Nautilus. :) Although google drive sync stream, appears to work better with nautilus than nemo.

2.) What compression setting does this awesome tool use? on the 0 to 9 scale? And does compressing a PNG using PNG algorithm at highest compression(a level 9) cause loss of quality?

-Thanks!

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.