kftray icon indicating copy to clipboard operation
kftray copied to clipboard

Fail to install kftray with brew

Open emouty opened this issue 10 months ago • 13 comments

Describe the bug When running brew install --HEAD kftray, I get

==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Fetching hcavarsan/kftray/kftray
==> Cloning https://github.com/hcavarsan/kftray.git
Updating /home/emouty/.cache/Homebrew/kftray--git
==> Checking out branch main
Already on 'main'
Your branch is up to date with 'origin/main'.
HEAD is now at fcfd966 chore: upgrade github actions dependencies (#190)
==> Installing kftray from hcavarsan/kftray
==> npm install -ddd --global --build-from-source --cache=/home/emouty/.cache/Homebrew/npm_cache --prefix=/home/linuxbrew/.linuxbrew/Cellar/kftray/HEAD-fcfd966/libexec /tmp/kftray-20240404-695060-zhmdkg/kftray-0.9.0.tgz
==> npm install pnpm
==> npm install
==> npm run tauri build -b appimage
Last 15 lines from /home/emouty/.cache/Homebrew/Logs/kftray/04.npm:
dist/assets/logo-B2zb5TmM.png   490.17 kB
dist/assets/index-Cx9_4Dlo.css    0.78 kB │ gzip:   0.40 kB
dist/assets/index-BH620F1G.js   784.31 kB │ gzip: 248.37 kB

(!) Some chunks are larger than 600 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 2.67s
error: unexpected argument 'appimage' found

Usage: cargo build [OPTIONS]

For more information, try '--help'.
       Error failed to build app: failed to build app

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/hcavarsan/homebrew-kftray/issues

Desktop (please complete the following information):

  • OS: Fedora 39

emouty avatar Apr 04 '24 14:04 emouty

hey @emouty , ill install a Fedora VM and try to debug and fix this. i'll let you know! thx for the feedback.

hcavarsan avatar Apr 04 '24 14:04 hcavarsan

@emouty i just pushed a fix in the brew formula, can you check if it's ok now?

hcavarsan avatar Apr 04 '24 17:04 hcavarsan

Hello, thanks for the quick responses, the command is fixed but it seems that they are some dependencies missing :

==> npm run tauri build -- -b appimage
Last 15 lines from /home/emouty/.cache/Homebrew/Logs/kftray/04.npm:
      - /home/linuxbrew/.linuxbrew/opt/zlib/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/sqlite/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/xz/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/libedit/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/krb5/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/libtirpc/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/libnsl/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/expat/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/libffi/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/libxcrypt/lib/pkgconfig
      - /home/linuxbrew/.linuxbrew/opt/[email protected]/lib/pkgconfig

  HINT: you may need to install a package such as javascriptcoregtk-4.0, javascriptcoregtk-4.0-dev or javascriptcoregtk-4.0-devel.

       Error failed to build app: failed to build app

full logs : 04.npm.log

emouty avatar Apr 05 '24 08:04 emouty

hey @emouty,

sorry for the delay, just a heads-up: I was able to replicate the issue in my homelab running Fedora 39, and I've managed to solve a few steps, but I'm still working on some final adjustments.

I'll let you know as soon as I have an update!

hcavarsan avatar Apr 09 '24 14:04 hcavarsan

I created a new homebrew formula named kftray-linux for Linux and updated the installation section in the readme: kftray Readme.

Note: To overcome a GTK limitation in Linux, you must activate the appindicator support GNOME extension. Here is a video demonstrating kftray working in Fedora 39:

https://github.com/hcavarsan/kftray/assets/30353685/0f8bd881-caff-4be8-8c57-5eef8919fab8

you can also download the AppImage from the releases page and install it using any AppImage installer/manager you prefer.

can you check if it's working?

hcavarsan avatar Apr 10 '24 02:04 hcavarsan

Thanks its working, now ! The only issue remaining is that the position of the window seems to be a bit random when I have multiple display connected. Sometimes its below the task bar on my main screen other times its on one of my secondary screen even though I don't have a task bar there.

( We could close the this issues and see this in another one)

image

emouty avatar Apr 11 '24 08:04 emouty

hey, thx for the headsup!

let's keep this issue open... im currently working on this code: link and will have it fixed soon!

hcavarsan avatar Apr 11 '24 16:04 hcavarsan

@emouty i've released the new version: https://github.com/hcavarsan/kftray/releases/tag/v0.9.7

now the app get and set the window position based on the mouse click event. it worked in my tests; however, I couldn't replicate it on dual monitors...

Wayland have some restrictions that X11 doesn't have, (eg to get the state from devices like mouse, keyboard etc..)

could you test it again and see if the window position is correct now?

hcavarsan avatar Apr 12 '24 00:04 hcavarsan

@emouty did you get a chance to test the latest release (v0.9.7) looking forward to your feedback.

hcavarsan avatar Apr 19 '24 13:04 hcavarsan

Sadly no I'm away until mid may, I'll test it when I get back 🙂

emouty avatar Apr 20 '24 05:04 emouty

Ok @emouty, no problem. thanks.

hcavarsan avatar Apr 22 '24 15:04 hcavarsan

I've tested it with v0.10.2 and window position is still wrong. Here is how my monitors are setup : image

We end up having krew window between all 3 monitors :sweat_smile: image

emouty avatar May 13 '24 09:05 emouty

hey @emouty, sorry, It is quite difficult to adjust the window position on Linux. I have modified the library I use to get the mouse position and tested it with a monitor setup similar to yours, and it worked here on Fedora 39. Could you please test it to see if it is okay now? The version is: https://github.com/hcavarsan/kftray/releases/tag/v0.10.3

hcavarsan avatar May 15 '24 02:05 hcavarsan

hey @emouty, I spent some time thinking about this, and I I found a way to solve it!

Check out the video below. In the new version of kftray v0.11.0, I implemented a new feature to move the window and also save the position state, so now you can choose the position that works best for you.

It's quite complicated to maintain app consistency across different platforms, especially on Linux, so I made this to be flexible and adjustable for the user until we find a better alternative :)

Can you test the new version and see if it works better?

Thank you, I hope this helps ;)

demo video:

https://github.com/hcavarsan/kftray/assets/30353685/4734c6a6-6d43-4c50-83ce-0a506ddd3d07

hcavarsan avatar May 22 '24 02:05 hcavarsan

Hello, Yes this tweak fixes the window placement issue ! Thanks for everything :)

emouty avatar May 22 '24 08:05 emouty

awesome! glad it worked out. thx for pointing out those inconsistencies, it really helps make the app better :) if u spot anything else weird, please let me know :)

hcavarsan avatar May 22 '24 15:05 hcavarsan