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

Multiple batteries support#4892

Open
fjpavon wants to merge5 commits intoqtile:master
base:master
Choose a base branch
Loading
fromfjpavon:multiple_batteries

Conversation

fjpavon
Copy link
Contributor

The widget can manage all the batteries in the computer: BAT0, BAT1,... and calculate the global information: % charge, time...
It's available for FreeBSD and Linux
By default all the batteries are checked. I modified the battery number default value to -1 because all the batteries are numbered with values equal or grater than 0 and if you want to get all the batteries you have to use negative numbers.
I changed the test_battery because i use the battery number to get the path to the info files.

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Qtile!
If you have not heard from us in a while, please feel free to ping one of the devs or anyone who has commented on the PR, as sometimes things fall through the cracks.
You can also join the chat room for real-time discussion, see thecommunity links.
For details on what PRs might need to include before we will merge them please seethe docs.

@tych0
Copy link
Member

Hi - thanks for the patches. Can you rebase these onto current git master so all the double-counted commits go away?

@jwijenbergh
Copy link
Contributor

Hmmm is this really needed? I have two batteries and just use two battery widgets

@Sniki
Copy link

Hmmm is this really needed? I have two batteries and just use two battery widgets

I would really like this to be merged please.

This was a request of mine months ago, i have many thinkpads with two batteries, yes i have been using two widgets for that but it makes space problems on the bar and it’s a bit confusing with two to know the exact eta for time left on battery, with this, i can get a single widget that shows me the time left from both batteries and have one extra space for another widget that i could really use.

  • extra space for another widget
  • Proper eta of time left on battery
  • A more tidy bar

Thanks !

@fjpavon
Copy link
ContributorAuthor

Hi - thanks for the patches. Can you rebase these onto current git master so all the double-counted commits go away?

Hi Tych0
Sorry for the late reply. Sorry again, but it's my first time contributing into a project and i don't known to much about git. I use it only for get my configuration files and password-store saved in a "safe" place, you know...git clone, push and pull.
I'm reading a git book trying to get a deeper knowledge about and i'm not sure if i did it's right or not, so excuse me if i make mistakes.
I run these commandsgit rebase
git checkout master
git rebase
git rebase multiple_batteries
multiple_batteries is my dev branch
Sorry but i don't know if it's what you expect to be done or if i need to run any other command.

Thanks and kind regards

@tych0
Copy link
Member

Right now your branch has multiple commits that already exist on master. I don't know how you got into this state, but I think you can fix it via the following:

git checkout multiple_batteriesgit checkout -b multiple_batteries-pendinggit checkout multiple_batteriesgit reset --hard origin/mastergit cherry-pick <the sha of your git patch from multiple_batteries>

What we need to land this is a clean git history on the branch.

Can you also address@jwijenbergh's comment? In particular, can this be addressed with adding some margin tuning vs. having this for loop over batteries?

@fjpavon
Copy link
ContributorAuthor

Hi tych0
I run the git commands as you suggested and i hope that everything is fixed now.
The widget add the option to show the overall info in one place. I changed the default value because is the way that it works in others projects: kde, gnome, zsh... but If you want 2 widgets as@jwijenbergh you can get them or if you want only one as@Sniki and me you can get it too.
In this image I have two widgets, in the left side showing the overall status and the right one showing the first battery, but you can configure it as you wish.
image

widget.Battery(battery=-1),powerline('color2', 'color3'),widget.Battery(battery=0),

I loop over the batteries but i only get the info of the selected battery. In the LinuxBattery class

for bat in bats:    if int(batnum) < 0 or self.battery == bat:

In the FreeBSD class:

for bat in range(numbat):    if bat == int(self.battery) or int(self.battery) < 0:

@elParaguayo
Copy link
Member

I have some comments on this too and will post them when I get a chance.

Copy link
Member

@elParaguayoelParaguayo left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. A couple of comments here.

I can't comment on appropriateness of FreeBSD changes.

@fjpavon
Copy link
ContributorAuthor

Be patient. I have to install a linux distribution in my laptop and i have to be sure that when i come back to freebsd i have all my conf files...;)

@fjpavon
Copy link
ContributorAuthor

Hi All,
After reinstall the laptop I have changed the percentage calculation and the result is the same as in gnome. So if i'm doing wrong the gnome guys too. I'm continue running the code waiting some difference in the numbers so i'll commit the modification tomorrow. Meanwhile i'm enjoy with the debian experience.

@elParaguayo
Copy link
Member

Did you mean to close this?

@fjpavon
Copy link
ContributorAuthor

Hi,
I thought that i was resolving your comments....sorry but works with git and all this stuff is very difficult to me.

Thanks and kind regards.

@fjpavonfjpavon reopened thisOct 20, 2024
@github-actionsGitHub Actions
Copy link

This PR is stale because it has been open 90 days with no activity. Remove thestatus: stale label or comment, or this will be closed in 30 days.

@Sniki
Copy link

What is left for this PR to be ready for merge ?
As long as the accuracy of battery reporting is somewhat close, it should be fine.

CC@fjpavon

@fjpavon
Copy link
ContributorAuthor

What is left for this PR to be ready for merge ? As long as the accuracy of battery reporting is somewhat close, it should be fine.

CC@fjpavon

Sorry i was focused in other stuff and i forgot that it was not finisthed.
During the weekend i was working trying to fix an error in the test_battery and i disconvered that it's not working on FreeBSD...but it's resolved, now the problem is the rufus-format .
I think that the os check in the tests can be the next issue to resolve.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@jwijenberghjwijenberghjwijenbergh left review comments

@elParaguayoelParaguayoAwaiting requested review from elParaguayo

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@fjpavon@tych0@jwijenbergh@Sniki@elParaguayo

[8]ページ先頭

©2009-2025 Movatter.jp