Hardcode-Tray icon indicating copy to clipboard operation
Hardcode-Tray copied to clipboard

hardcode-tray is incompatibile with lastest inkscape

Open FadeMind opened this issue 4 years ago • 9 comments

Specifications

  • Hardcode-Tray version : 4.3.r90.gf3e2d59-1 ``
  • Distribution : Manjaro Linux KDE x86_64 ``
  • Gtk version : gtk3 1:3.24.20-1
  • Inkscape version : 1.0-3
  • Cairo version : 1.17.2+17+g52a7c79fd-2
  • Sni-qt version: `` if installed
  • Application name : bitwarden-bin
  • Application version : 1.17.2-1

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.

FadeMind avatar May 11 '20 15:05 FadeMind

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

acutbal avatar May 11 '20 20:05 acutbal

use RSVGConvert

varlesh avatar May 12 '20 02:05 varlesh

@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?

FadeMind avatar May 12 '20 03:05 FadeMind

Sorry, i don't know Python ((

varlesh avatar May 12 '20 03:05 varlesh

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

varlesh avatar May 12 '20 03:05 varlesh

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

FadeMind avatar May 12 '20 04:05 FadeMind

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 avatar May 14 '20 08:05 bilelmoussaoui

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.

bilelmoussaoui avatar May 14 '20 08:05 bilelmoussaoui

@varlesh fix is available in Pull Request Stage😁

FadeMind avatar May 16 '20 07:05 FadeMind