Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: traffic on network provider, util provider #58

Merged
merged 22 commits into from
Jul 30, 2024

Conversation

CtByte
Copy link
Contributor

@CtByte CtByte commented Apr 26, 2024

Added traffic variable (received and transmitted bytes) to the network provider.
Added util provider to convert and format bytes.
Added documentation to the README.md.
Expanded on the CONTRIBUTING.md

@CtByte CtByte changed the title Traffic on Network provider, Data provider feat: traffic on network provider and data provider Jul 24, 2024
@CtByte
Copy link
Contributor Author

CtByte commented Jul 24, 2024

Hi @lars-berger,

It is very nice to see progress on Zebar. I updated this PR so it's up-to-date, but I've got an issue and I was hoping I can get some help.

I run this command locally:

PS D:\Workspaces\git\CtByte\zebar\packages\desktop> pnpm build

> @zebar/[email protected] build D:\Workspaces\git\CtByte\zebar\packages\desktop
> npm run tauri build


> @zebar/[email protected] tauri
> tauri build

       Error `tauri.conf.json` error on `bundle > windows`: Additional properties are not allowed ('signCommand' was unexpected)
npm ERR! Lifecycle script `tauri` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: @zebar/[email protected]
npm ERR!   at location: D:\Workspaces\git\CtByte\zebar\packages\desktop
 ELIFECYCLE  Command failed with exit code 1.

When I remove that line from the tauri.conf.json file, it builds. However, when I run it, the bar does not use the width, height, position_x or position_y settings in the config file (I used the example) and it simply opens the bars as a square with seemingly predefined properties.

Is this something I did or missed? 😭

@CtByte CtByte changed the title feat: traffic on network provider and data provider feat: traffic on network provider, data provider Jul 24, 2024
@lars-berger
Copy link
Member

Hey @CtByte, is this after running pnpm i? The Tauri CLI is an NPM dependency, and I've had it throw similar errors if it was out of date.

I vaguely remember an issue with this PR where it would freeze up (?). Is that still a thing? Thanks for taking the time to update it 🙏

@CtByte
Copy link
Contributor Author

CtByte commented Jul 25, 2024

Thank you @lars-berger

I am pretty sure I had to update, thanks for the hint!

I seem to have a problem signing, but I have a feeling this is a "me" problem

PS D:\Workspaces\git\CtByte\zebar\packages\desktop> pnpm i; pnpm build
Scope: all 4 workspace projects
Done in 454ms

> @zebar/desktop@0.0.0 build D:\Workspaces\git\CtByte\zebar\packages\desktop
> npm run tauri build


> @zebar/desktop@0.0.0 tauri
> tauri build

[... reducted ...]

warning: `zebar` (bin "zebar") generated 4 warnings
    Finished `release` profile [optimized] target(s) in 0.39s
    Built application at: D:\Workspaces\git\CtByte\zebar\target\release\zebar.exe
    Signing D:\Workspaces\git\CtByte\zebar\target\release\zebar.exe
    Signing D:\Workspaces\git\CtByte\zebar\target\release\zebar.exe with a custom signing command
    Error failed to bundle project: `failed to run powershell`
npm ERR! Lifecycle script `tauri` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: @zebar/desktop@0.0.0
npm ERR!   at location: D:\Workspaces\git\CtByte\zebar\packages\desktop
 ELIFECYCLE  Command failed with exit code 1.

About the freeze up, that only happened when I was using the Komorebi provider to display my workspaces. It's been well over a month since I stopped using that and I only experienced the catch up bug since.

I have been using this PR with the network traffic since I submitted and I had no issues.

I will try a few more things because I want to run on the latest to test the Komorebi changes you've made.

@CtByte
Copy link
Contributor Author

CtByte commented Jul 25, 2024

@lars-berger I will try with this 😄 496f90f

Edit: The problem seems to be the signCommand itself in the tauri.conf.json file, so I tried running the command itself

PS D:\Workspaces\git\CtByte\zebar\packages\desktop> powershell ./resources/scripts/sign.ps1 -FilePath zebar.exe
./resources/scripts/sign.ps1 : File D:\Workspaces\git\CtByte\zebar\packages\desktop\resources\scripts\sign.ps1 cannot be loaded.
The file D:\Workspaces\git\CtByte\zebar\packages\desktop\resources\scripts\sign.ps1 is not digitally signed. You cannot run this
script on the current system. For more information about running scripts and setting execution policy, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ./resources/scripts/sign.ps1 -FilePath zebar.exe
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

I am not so sure if I ran it correctly. Do you perhaps have a suggestion? Sorry to have to bother you with this.

README.md Outdated Show resolved Hide resolved
@lars-berger
Copy link
Member

@lars-berger I will try with this 😄 496f90f

Edit: The problem seems to be the signCommand itself in the tauri.conf.json file, so I tried running the command itself

PS D:\Workspaces\git\CtByte\zebar\packages\desktop> powershell ./resources/scripts/sign.ps1 -FilePath zebar.exe
./resources/scripts/sign.ps1 : File D:\Workspaces\git\CtByte\zebar\packages\desktop\resources\scripts\sign.ps1 cannot be loaded.
The file D:\Workspaces\git\CtByte\zebar\packages\desktop\resources\scripts\sign.ps1 is not digitally signed. You cannot run this
script on the current system. For more information about running scripts and setting execution policy, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ./resources/scripts/sign.ps1 -FilePath zebar.exe
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

I am not so sure if I ran it correctly. Do you perhaps have a suggestion? Sorry to have to bother you with this.

Hehe thanks for trying the fix ❤️ It's probably erroring now due to this setting:
image

Could you see if it works with this signCommand?

      "signCommand": "powershell -ExecutionPolicy Bypass -File ./resources/scripts/sign.ps1 -FilePath %1",

Added a comment re the convertBytes fn. Sorry about getting around to reviewing this so late.

@CtByte
Copy link
Contributor Author

CtByte commented Jul 27, 2024

Thank you for your review and suggestions, I will look into those.

I understand the delay, since you were probably busy and also had to rewrite glazewm 😅

I am excited for the recent attention Zebar has been getting, I think it has very good potential.

@CtByte
Copy link
Contributor Author

CtByte commented Jul 29, 2024

@lars-berger The new signCommand works for me now, thank you very much!

I added a few comments to your review

@CtByte CtByte changed the title feat: traffic on network provider, data provider feat: traffic on network provider, util provider Jul 29, 2024
@lars-berger
Copy link
Member

@lars-berger The new signCommand works for me now, thank you very much!

I added a few comments to your review

Ay that's great news, glad it's working 🙌

@CtByte
Copy link
Contributor Author

CtByte commented Jul 29, 2024

@lars-berger I think that I am done with the changes for your reviews 🤞

@lars-berger lars-berger merged commit b57d36f into glzr-io:main Jul 30, 2024
5 checks passed
@lars-berger
Copy link
Member

Ay it all looks great 🙌 Hope you don't mind but reverted a couple things I don't think were meant to be checked in. Thanks for improving the docs a little too!

@CtByte
Copy link
Contributor Author

CtByte commented Jul 30, 2024

@lars-berger Yes, those were for local development, sorry about that and thank you as well for all your help! 🎉

Copy link

github-actions bot commented Aug 2, 2024

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants