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: no update w/ autohide option & add option to swap netstat icon … #591

Merged
merged 9 commits into from
Dec 24, 2024

Conversation

ilikestreet
Copy link
Contributor

Couple features down here:

  • Auto hide updates module on bar, if nums of updates is 0, else pop up
  • Netstat module add networkInLabel & networkOutLabel for customzing better look download/upload icons
  • Perfection for me, aligned the bar font with JetBrainsMono Nerd Font, otherwise the baseline of text is untidy(otherwise remove this commit on src/scss/style/bar/bar.scss)

src/options.ts Outdated Show resolved Hide resolved

const processUpdateCount = (updateCount: string): string => {
isVis.set(!autoHide.get() || (autoHide.get() && parseFloat(updateCount) > 0));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this down to the updatesIcon Variables.derive scope since this doesn't trigger on update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean here?

const updatesIcon = Variable.derive(
    [bind(icon.pending), bind(icon.updated), bind(pendingUpdates)],
    (pendingIcon, updatedIcon, pUpdates) => {
        // new add below;
        isVis.set(!autoHide.get() || (autoHide.get() && parseFloat(pUpdates) > 0));
        return parseFloat(pUpdates) === 0 ? updatedIcon : pendingIcon;
    },
);

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check below commit, I move the code from your suggestion

@Jas-SinghFSU
Copy link
Owner

Thanks for the contribution! ❤️

@Jas-SinghFSU Jas-SinghFSU merged commit e0917ff into Jas-SinghFSU:master Dec 24, 2024
1 check passed
@ilikestreet ilikestreet deleted the jz branch December 26, 2024 06:11
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