Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Add roundsize function#926

Open
Bouk250 wants to merge4 commits intoelkowar:master
base:master
Choose a base branch
Loading
fromBouk250:master
Open

Conversation

Bouk250
Copy link

Description

I added a function for easily pars size value into human-readable value.

Usage

;; RAM Stats Widgets ;;(defwidget ram_stats [used_mem total_mem]      (label        :text `${round(used_mem.size,2)}${used_mem.units}/${round(total_mem.size,0)}${total_mem.units}`)    )  );; Stats Widgets ;;(defwidget stats []    (ram_stats     :total_mem {roundsize(EWW_RAM.total_mem)}    :used_mem {roundsize(EWW_RAM.used_mem)})  ))

Showcase

It's help to parse magic variable that provide size in bytes without external script

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in thedocs/content/main directory has been adjusted to reflect my changes.
  • I usedcargo fmt to automatically format all code before committing

@elkowar
Copy link
Owner

Not sure I'm a fan of having this return JSON, tbh -- wouldn't just having a "formatbytecount" function or something like that that takes a number of bytes and turns it into a string with the appropriate unit be sufficient?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Bouk250@elkowar

[8]ページ先頭

©2009-2025 Movatter.jp