bilelmoussaoui / Hardcode-Tray

Fixes Hardcoded tray icons in Linux
Other
863 stars 63 forks source link

hardcode-tray is incompatibile with lastest inkscape #630

Open FadeMind opened 4 years ago

FadeMind commented 4 years ago

Specifications

Expected behavior and actual behavior

sudo hardcode-tray --theme Papirus --conversion-tool Inkscape
Welcome to Hardcode-Tray!
Hardcode-Tray replaces some icons on the binary files of some applications. 
Please close all the running applications before running Hardcode-Tray script.
Desktop Environment: Other
Scaling Factor: 1
Icon Size: 22
Icon Theme: Papirus
Conversion Tool: Inkscape
To Do: All
1 - Apply
2 - Revert
3 - Clear Backup Cache
Please choose: 1
Applying now..

Traceback (most recent call last):
  File "/usr/bin/hardcode-tray", line 121, in <module>
    App.execute()
  File "/usr/lib/python3.8/site-packages/HardcodeTray/app.py", line 120, in execute
    delta = app.do_action(action)
  File "/usr/lib/python3.8/site-packages/HardcodeTray/modules/applications/application.py", line 148, in do_action
    self.install()
  File "/usr/lib/python3.8/site-packages/HardcodeTray/decorators.py", line 58, in wrapper
    func(app)
  File "/usr/lib/python3.8/site-packages/HardcodeTray/modules/applications/application.py", line 96, in install
    self.execute(Action.APPLY)
  File "/usr/lib/python3.8/site-packages/HardcodeTray/modules/applications/helpers/binary.py", line 50, in execute
    self.install_icon(icon, icon_path)
  File "/usr/lib/python3.8/site-packages/HardcodeTray/modules/applications/electron.py", line 38, in install_icon
    png_bytes = get_pngbytes(icon)
  File "/usr/lib/python3.8/site-packages/HardcodeTray/utils.py", line 215, in get_pngbytes
    png_bytes = App.svg().to_bin(icon_for_replace,
  File "/usr/lib/python3.8/site-packages/HardcodeTray/modules/svg/svg.py", line 92, in to_bin
    with open(outfile, 'rb') as temppng:
FileNotFoundError: [Errno 2] Nie ma takiego pliku ani katalogu: '/tmp/tmpwymebquv'

Steps to reproduce the problem

  1. install lastest inkscape (1.0-x)
  2. launch hardcode-tray via sudo hardcode-tray --theme Papirus --conversion-tool Inkscape
  3. Python freak out.
acutbal commented 4 years ago

Hello, I also have the same issue with Manjaro KDE when I try to convert Insync: Screenshot_20200511_220045 Regards. :smile:

varlesh commented 4 years ago

use RSVGConvert

FadeMind commented 4 years ago

@varlesh
sudo hardcode-tray --theme Papirus --conversion-tool RSVGConvert

do the job, but if I don't set special --conversion-tool flag, then inkscape is used default if it is installed. Maybe simply change this behaviour and set RSVGConvert as default tool EVEN if other tools are available in OS?

varlesh commented 4 years ago

Sorry, i don't know Python ((

varlesh commented 4 years ago

i'm open earlier issue about that: https://github.com/bilelmoussaoui/Hardcode-Tray/issues/578

FadeMind commented 4 years ago

@funilrys could you please lookin at this issues and review code? Thank you so much.

bilelmoussaoui commented 4 years ago

do the job, but if I don't set special --conversion-tool flag, then inkscape is used default if it is installed. Maybe simply change this behaviour and set RSVGConvert as default tool EVEN if other tools are available in OS?

Use https://github.com/bilelmoussaoui/Hardcode-Tray#config-file to set a default conversion tool

bilelmoussaoui commented 4 years ago

If someone wants to fix it, you just need to update the args here https://github.com/bilelmoussaoui/Hardcode-Tray/blob/master/HardcodeTray/modules/svg/inkscape.py#L36

Of course, it should check the output of inkscape --version first.

FadeMind commented 4 years ago

@varlesh fix is available in Pull Request Stage😁