bilelmoussaoui / Hardcode-Tray

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

Base64 image file support #605

Closed varlesh closed 4 years ago

varlesh commented 5 years ago

Application: Slack Category: Electron Icons: Tray icons used from Base64 images packed to app.asar/dist/main.1.83d4c7c4432e81daeadc.js Need for fixing:

Example config will be added soon... We can't have module for fix that. HELP WANTED!!!

varlesh commented 5 years ago

Original JS file with Base64 tray images: dist.tar.gz Functions:

varlesh commented 5 years ago
{
    "name": "Slack",
    "app_path": [
        "/usr/share/slack/",
        "/usr/lib/slack/"
    ],
    "icons_path": [
        "/usr/share/slack/resources/",
        "/usr/lib/slack/resources/"
    ],
    "binary": "app.asar",
    "script": "js",
    "file": "dist/main.1.83d4c7c4432e81daeadc.js",
    "icons": {
        "highlight": {
            "original": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAABBRJREFUOBGNlW1IW2cUx59c82KTNW0jNE2IXaadYytjhuLcmLF2MEM/DMqcjso6QSuI4FBaSj8UJkxmy1g/DBEGymQo2wqDzRfmW0GHK8R+sG6LRV1CbGPQCpqXapKbm3v3P1dviRplB355Xu5z/vd5zjn3CWOHWxYeHweqtGVa9I1p44zddIf0BST4PngHUD8GRoAJOAH5LYOfQQTsM27fzPaE02g0vjc5Ofmu3++/3NfXdxbTl0Bpf3//Gx6P52JRUVEuxhe3l///32uDg4P3pDRraWm5W1xc/CWmRJoeGxv7FXI3DpLMtGOa01ut1lPpTiUlJRabzabGnBy+l2Do05iM5naFNZOwiEXLXV1dbkEQePIiy8qiUO8z8v8I3NzhY7T0whdvpAUOYN+Z03Z2dm663e47lZWVJo1Gw42Ojq4j7nvV1Q6Ho7Cjo6OY4zhVc3OzHj6U4G7lKB/igaOxsdFgsVh0ePDCUqmUODw8HJqYmBAqKir2CrOhoaHP4PMyOVBizWZzF7p2Gh8BrVNTU7+n5WpvN1VXV3cHwu1YJ7W3t0vl5eVPcJI/cTLJ5/Mp60WcqhV652jH8i52koFhRuN0Ot2xgYGBt7xer4h4c2uBoF5Kifbu7m7W09PDamtrmdPpfBSJyGW9omTyU1TBmba2tlyTyaTfK434hrGzD1QqVfZt+3njZWvpkZPZNk5gvPR066n4xep47H7YHw+FQj6E7mv4/6IIv4JBDURZWVmZFgIqJCERCAQYVRXP865kMnn6wZtXcwpzCnflYHsTKukb30/Pby39EcWY6vtzJRnVTU1N5pGRkebq6uoLVVVVJXj4eG5ubrO3t/f67OysvSm7QHXJXKpnUoplQFV0vED3l2FDs7gWtMJ3nMrsKDiJUnEhjpRI2Sgb9fX1ppmZGQPF9BPz23omJtlBqEWRXTn6Gl1QGnCOhLEat0wstkWtYtPT01G1Ws2CwSDTMY5Zsk5wEoQP43RMJ8BfAiIJx8FiQ0PD2NLS0kI0Gg0h+/dgcYq1VqvFmyUWFzYRAX5bWGnpRUofbTgRIeF1EFY+kH7Up85ut/+ISTJaEEM0TPn5+QwfB/s3viKc1Z2iYx5oj54HQ3hI14CXdkxG2fwedIIfwF0QAMzlcsn3xFfhhzGEAXdb5nA84zcSt1cfrsLFDzyKMPpybJ6h9QGKt4Qyk/Ly8uTidyfWhFtPxsNJMb5bHCFYSazzNd7ffGGBp5O2kq9Sx+jvswuo6/Pz8/P1uEf0CMkCPgCbM7dAfyXn9WP5ooGFtqIJdyQY/279bz9EqQi+Bb2kdJgwld5VkEPVgSt0E30DqKGcIv7oMrpiN8ACaAX/ANkOE6YFVJevAjVYBBQi+gNwgRNgGTwGHiC/Ca1s/wHOaRbqM5pQKwAAAABJRU5ErkJggg==",
            "theme": "slack-indicator-highlight"
        },
        "indicator": {
            "original": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAA8JJREFUOBGNVV9IU2EUv5tzq5nLFswmmhMKoQK3B1n+C+mlfFAjEwoiXxRkICiBDBERFCFRH5zsaZWGWi2DFAXTFxUN9KVI7EHBmc1YKjU33R+b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3v4E3nZYXnIs+8Y1woNarBC9S0fAJ3cP4M5gjl8vjkJhBJ5DNCn4Hj+C0xORIH4OrIEm2AlJLXgDTQZLFBtL/YQz+ASRsjm4BTCa4AAAAAElFTkSuQmCC",
            "theme": "slack-indicator"
        },
        "unread": {
            "original": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAABAJJREFUOBGNlX9IW1cUx+97xpc2tumaFl0kXVNt/2lXaijOjprOFWootCC1Qgv9ATpBBDtlUMb2RwOzDf2hhU7yzwyTURnrGKz+oFb7h4Jji/+4lYZNxRBFpbWlS4w2L/H96Pc880qMRnrgk3vuefece+85570wtrFk4fEHgEtZJkA3p8zXVVMdUhdQwOPgCCA9Bh4DC3AC8psFv4AFsEb4NZYVg9NsNh8dGhr6NBQKne/s7DwAcwU41tXVtT8QCJwsLi7ehfnJleXv//tVT0/PAzVFmpqaWktKSr6DSSHzwMDA7wh3NVPI9U5MNlN+fv6HqU6lpaVWm81mgE1L3xYIdJqTkG1VWtcLrGDRbHt7u1+SpAR5kWRlUarXCPmfAV8nOYuRNny3Iy1wAHvSJni93iW/33+zqqrKkp2dzff3979G3tOjGxwOR1FbW1sJz/NcY2OjCT5UYJ9+ldN44Kivr8+xWq1GPHgnsiwrfX194cHBQamysjI9MOvt7b0En93kQIXNy8trh2qn+WbgHh4efpRSq3RVrqmpuYnAHqxTPR6PWl5ePo2b/IGbqcFgUF+v4FZuxDtMJ9ZOkSwGpusKbzQat3V3dx+anJxUkG9+ev6lSVJVu8/nYx0dHay6upo5nc6/Fxa0tn6uV/ICumBvc3PzLovFYkoPjfxGcLITjOM2GZtumeXz5zZLubk8k2R10+y0svXWtZjy5xMxHA4Hkbrb8P9ND7wHk8sIysrKygQOgiLEZ2ZmGHVVIpFwJZaXP+If+ncoHx9aVYPkIVTj3TuL8e+/jWJO/X0laWf1DQ0Nd0RRfKMnq6WlxYu+daNwi0VFRbLw5Y0FNiGqmeD+W1QLTpyiVz8EDlKbbQW5aBUX8kiF1IQ2qK2ttYyOjuZQTpUz50xMxqMMqOhcseIifaCywWEKvAxYLBZ7Q6MuIyMjUYPBwObm5pgiGJm008ozRUVgoI+kpzCft1uCP4xMocAimKirqxuYmpoaj0ajYVT/AUSkXAuCwDgJe4vxldPSe0mnpjENORKhwK9BRH9ButCfRrvd/jOMJLQghmxYCgsLGV4OJgQnpMS+A3TNjMI9HQ3juPQZmKQTk1A1fwRe8BNoBTOAuVwu7Tux5YfrMZxUzZRj9uplXPF5XsAlBAJ6YOhabuYxBgHlW0WbqQUFBVrzC0//krjWbyJcYhnBV+eWzT9PsKsXgmxRS4WbfPU+hr5GPkdffzY2NlaL74gJKRnHC2Db+ckxU9bpi9uWbHuZGInEpX/8IvvVG0JQaoJ74D5F2igwtd4XYAd1Bz6hS9BzwGWqKfIPVSvf/xjHgRs8A5psFJgWUF/uAwYwAShF9AfgAtvBLPgXBIC2E0ZN3gI4J+wlnIU7ngAAAABJRU5ErkJggg==",
            "theme": "slack-indicator-unread"
        }
    }
}
BlueManCZ commented 4 years ago

Got this working as a module.

Snímek z 2020-07-30 20-31-38

Snímek z 2020-07-30 20-30-01

Look at this sweet Slack icon!

I will clean up the code and create pull request, so you can test it.