Coder Social home page Coder Social logo

hardcode-tray2's Introduction

Hardcode-Tray

CircleCI Codacy Badge Gitter Hardcode-Tray release Donate

Fixes Hardcoded tray icons in Linux

The script will automatically detect your default theme, the correct icon size, the hard-coded applications, the correct icons for each indicator and fix them. All that with the possibility to revert to the original icons.

Themes

Here's a list of themes that supports Hardcode-Tray:

Preview
Preview

Requirements

Running dependencies

  • python3
  • python3-gi
  • patched sni-qt
  • Pick up your favorite conversion tool
    • python3-cairosvg
    • librsvg
    • inkscape
    • imagemagick
    • svgexport

If the icons looks blury, you should try installing this package libappindicator3-1. See #567 for reference.

Building dependencies

  • ninja
  • meson (>= 0.40)

Install

Arch Linux (AUR)

Make sure the base-devel group is installed:

sudo pacman -S base-devel

Stable version:

yaourt -S hardcode-tray sni-qt-patched-git lib32-sni-qt-patched-git

The sni-qt patched library by Hardcode-Tray team is still on beta, we will replace the git version with a stable release once we release one. Development version:

yaourt -S hardcode-tray-git sni-qt-patched-git lib32-sni-qt-patched-git

Ubuntu 16.04+ (PPA)

sudo add-apt-repository ppa:papirus/hardcode-tray
sudo apt update
sudo apt install hardcode-tray

Debian 10

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/SmartFinn:/hardcode-tray/openSUSE_Tools_Debian_10/ /' > /etc/apt/sources.list.d/hardcode-tray.list"
wget -qO- https://download.opensuse.org/repositories/home:SmartFinn:hardcode-tray/openSUSE_Tools_Debian_10/Release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install hardcode-tray

Fedora 29+ / Fedora Rawhide

To install hardcode-tray on Fedora 30 run the following commands:

sudo dnf config-manager --add-repo https://download.opensuse.org/repositories/home:SmartFinn:hardcode-tray/openSUSE_Tools_Fedora_30/home:SmartFinn:hardcode-tray.repo
sudo dnf install hardcode-tray

You can find packages for other Fedora versions here.

OpenSUSE (Leap 42.2 / Tumbleweed)

OpenSUSE package only contains the patched version of sni-qt. In order to get Hardcode-Tray, please follow the manual installation method.

The one click-installer can be found by following this link

Or you can use unofficial build

sudo zypper ar -p 98 http://download.opensuse.org/repositories/home:/GNorth:/Arc_and_Papirus/openSUSE_Leap_42.3/home:GNorth:Arc_and_Papirus.repo
sudo zypper ref
sudo zypper in Hardcode-Tray

Where openSUSE Leap 42.3 can be changed to 42.2 or Tumbleweed

Manual installation

1- Install dependencies

On Ubuntu:

sudo apt install git build-essential meson libgirepository1.0-dev libgtk-3-dev python3 python3-gi gir1.2-rsvg-2.0 librsvg2-bin gir1.2-gtk-3.0

2- Compile

git clone https://github.com/bil-elmoussaoui/Hardcode-Tray
meson builddir --prefix=/usr
sudo ninja -C builddir install

3- Open Hardcode-Tray using this command

sudo -E hardcode-tray

4- Enjoy!

You can build the patched version of sni-qt from the source code if you are using a different distribution (like Fedora).

The sni-qt:i386 is used for 32 bits applications as Skype.

Teamviewer is also using the sni-qt package. However, it is shipping its own version. Therefore this script also overwrites the version shipped by TeamViewer with the patched one.

Options

  • --apply and --revert

Hardcode-Tray shows a welcome message by default and asks the user to choose between applying the fix or reverting it. You can hide that using

hardcode-tray --apply

or

hardcode-tray --revert
  • --change-color

Your favorite theme does not provide icons for all those hardcoded icons? Just use a different theme and change the colors using Hardcode-Tray.

hardcode-tray --change-color "#FIRSTCOLOR #REPLACE_FIRST_COLOR" "#SECONDCOLOR #REPLACE_SECOND_COLOR"...
  • --clear-cache

Let you clear the backup cache folder

hardcode-tray --clear-cache
  • --conversion-tool

Hardcode-Tray by default detects if the user has either Inkscape, CairoSVG, RSVGConvert, ImageMagick or SVGExport installed and use one of them to convert SVG icons to PNG. In order to choose the tool to use if one of them is broken in your installation is

hardcode-tray --conversion-tool {Inkscape, CairoSVG, RSVGConvert, ImageMagick, SVGExport}

For now, we support : CairoSVG (python3-cairosvg), Inkscape, rsvgconvert (librsvg), Imagemagick and svgexport(npm library)

Cairo has some issues with converting SVG files that use CSS (see #245).

  • --light-theme and --dark-theme

Some applications provide dark and light tray icons with the possibility to modify them using their UI. In order to use a dark theme for dark icons and a light one for light icons, you can use those two arguments. It only works if you use both of them at the same time.

hardcode-tray --dark-theme Numix-light --light-theme Numix
  • --only

You can use the --only argument to fix/revert only one application; don't use the argument if you want to fix all applications your icon theme supports.

hardcode-tray --only telegram, skype

In order to get the names needed to fix only specific programs, you can look at the app_name key in the JSON files for the program. There you can find the corresponding name for the program you want to fix.

  • --path

If you installed your app in a non-standard location, you can override the path where the icons are stored using the --path argument. Only works in combination with the --only argument for a single application.

hardcode-tray --only telegram --path /home/user/telegram/
  • --size

You can also use --size {24,22,16} to force the script to use a different icon size or if the script does not detect your desktop environment.

hardcode-tray --size 24 --only dropbox
  • --theme

You can fix your hardcoded icons using a different theme than the default one.

hardcode-tray --theme Numix --only dropbox
  • --version

You can print the version of Hardcode-Tray using

hardcode-tray --version

Config file

Hardcode-Tray also supports a JSON config file that can be placed under ~/.config. The file must be named hardcode-tray.json. An example of the config file can be found here. The file supports the following options for now.

  • blacklist: a list of applications that you don't want to be fixed.
  • conversion_tool: the default tool to be used every time you use the script.
  • icons : An object, that contains theme and size for the Gtk icon theme and the icon size to be used.
  • backup_ignore : A boolean, to configure either you want default icons to be saved on the backup folder or not.
  • scaling_factor : Widgets scaling factor. Auto detected on GNOME, KDE and Cinnamon.

Passing --theme --conversion-tool --size will overwrite those settings.

Node-WebKit JS applications

In order to fix those ugly tray icons on NWJS applications, you will need to download the SDK from here. Extract the zip file in your home directory (or place it wherever you want) and add a new key to the config file that points to the NwJS SDK directory.

Credits

  • Modified version of data_pack.py, by The Chromium Authors released under a BSD-style license
  • Qt applications icons name by elementaryPlus team

Hardcode-Tray wiki

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.