Frewacom / pywalfox

Dynamic theming of Firefox (and Thunderbird) using your Pywal colors
https://addons.mozilla.org/en-US/firefox/addon/pywalfox/
Mozilla Public License 2.0
583 stars 12 forks source link

Does not work when launching from sxhkd #42

Closed HackerWithoutACause closed 3 years ago

HackerWithoutACause commented 3 years ago

When launching Firefox from sxhkd or rofi that was launching from sxhkd pywalfox fails with the error

Uncaught (in promise) Error: Attempt to postMessage on disconnected port
    _ moz-extension://b333ef24-0dfb-4f5f-9967-ce7ec166b7cb/dist/pages/settings.min.js:1
settings.min.js:1:1284
    apply self-hosted:2194
    applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:614
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:889
    (Async: promise callback)
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:850
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:849
    callAsyncFunction resource://gre/modules/ExtensionCommon.jsm:1091
    callAsyncFunction resource://gre/modules/ExtensionChild.jsm:701
    callAndLog resource://gre/modules/ExtensionChild.jsm:677
    callAsyncFunction resource://gre/modules/ExtensionChild.jsm:700
    stub resource://gre/modules/Schemas.jsm:2679
    _ moz-extension://b333ef24-0dfb-4f5f-9967-ce7ec166b7cb/dist/pages/settings.min.js:1

However it works fine when launched from the command line.

Frewacom commented 3 years ago

Does the error cause any issues with the addon? Generally, that error can be ignored.

It is kind of strange that the error would not be thrown if you launch Firefox from the command line, but unless you have any issues because of this, it should be fine.

HackerWithoutACause commented 3 years ago

No it fails to set the theme and throws and error if firefox was launched in any way from sxhkd however if launched from the terminal it works and does not throw an error.

Frewacom commented 3 years ago

Do you get any other errors, e.g in the Browser console (Tools > Web developer > Browser console) and the Debugging section of the settings page for Pywalfox? What command does sxhkd use to launch Firefox?

It is really strange that you get an error based on how Firefox is launched. Not quite sure why that is.

HackerWithoutACause commented 3 years ago

The problem was that pywalfox was installed locally in ~/.local/bin which was not in sxhkd's path. Making a symlink to /usr/local/bin fixed to problem.