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

Discussion and Testing #11

Open
maniacx opened this issue Mar 26, 2023 · 57 comments
Open

Discussion and Testing #11

maniacx opened this issue Mar 26, 2023 · 57 comments
Assignees
Labels
enhancement New feature or request

Comments

@maniacx
Copy link
Owner

maniacx commented Mar 26, 2023

Creating this issue for discussion about this extension and testing newer version before uploading on gnome extension website.
So that tester, can share your result and your opinion here.

Feel free to provide any suggestion, or any discussion related here.

The zip will contain two scripts

  1. reset.sh this will disable and remove all your schema settings related to Battery Health Charging extension.
    This will also set device-type to 0 so that the extension re-checks the sysfs path your device uses.
    This will remove/reset-to-default all preferences so you will lose all your settings and custom threshold after running reset.sh
  2. install.sh to manually install extension.

Recommended to run ./reset.sh before ./install.sh to test the extension and renable extension from extensions/extension manager.
But if you dont want to reset and lose your settings and only install and test the version, thats fine too

@maniacx
Copy link
Owner Author

maniacx commented Mar 26, 2023

test_version10.zip

Added more device.
Added option to change position of system indicator icon

@anzigo
Copy link

anzigo commented Mar 27, 2023

The test version is working for me. I ran the reset and install scripts. Successfully enabled and disabled Maximum Lifespan Mode and Full Capacity Mode without issue. (Fedora 37, Acer Swift X SFX14-51G)

@monethass
Copy link

Confirm working on Dell

@mascherm
Copy link

test_version10 works fine.

@maniacx
Copy link
Owner Author

maniacx commented Mar 28, 2023

Thank you for testing. @anzigo @monethass @mascherm
Just waiting for a thinkpad user to confirm extension works.

@maniacx maniacx added the enhancement New feature or request label Mar 29, 2023
@maniacx maniacx changed the title Test: New version test before launch Discussion and Testing Mar 29, 2023
@maniacx
Copy link
Owner Author

maniacx commented Mar 29, 2023

Just curious about the charging icon in the system tray/indicator , when charger is plugged.

Currently in my laptop, when the actual battery level reaches the end-threshold/limit, my system tray/indicator icon shows charger is unplugged and running on battery. I was just wondering if it shows unplugged/on-battery for everyone. Difficult to explain, so explaining with examples case1 and 2 below.

CASE1
If my battery level is 56% and my end-threshold/limit is set to 60%
Charger is plugged the icon displayed is charging.
This is normal, as the correct icon is displayed with charger plugged in.(see pic below)

56%

CASE2
If my battery level is 59% and my end-threshold/limit is set to 60%. Battery stops charging because of threshold limit.
Charger is plugged and powered, but the icon displayed is unplugged/on-battery.
Which seems kinda incorrect, since the charger is plugged and powered, but the icon shows it is on battery.(see pic below)

60

In case 2 does your system tray/indicator icon shows as plugged or unplugged?
If icon show as unplugged with charger plugged in for everyone, I might add an option to enable/disable correct icon.
Please let me know.

@mascherm
Copy link

mascherm commented Mar 29, 2023

i get the same results as you, in case 1 it shows charging and in case 2 it shows not charging.

i have a question, what exactly is the use case for the start charging treshold?

@maniacx
Copy link
Owner Author

maniacx commented Mar 29, 2023

start charging threshold is threshold level when the device start charging after charging was stop using end threshold..

Better with an example.
Example 1. You set Start-Threshold 50% and End-threshold to 60%.

  • Your current battery level 30%.
  • You plugin the charger.
  • The battery will now charge until around 60% since we have set the end-threshold to 60%, the charger now only powers the laptop, but no charging power is deliverd to charge the battery.
    At this point the battery will start discharging at a extremely low rate.
  • Once the battery level reaches 50% since we set the Start-Threshold to 50%, at this point charging power will be deliverred to the battery. The battery starts charging at a normal rate, reaches back to 60%, and stops charging again because end-threshold is set to 60%.
    *And so the battery level keeps cycling between 50% to 60%.

Example 2. You set Start-Threshold 50% and End-threshold to 60%.

  • You plugin your charger and Your current battery level 80%. Your since your battery charge is set to 60. the charger now only powers the laptop, but no charging power is deliverd to charge the battery.
  • You battery will start discharging at a extremely low rate, Until is reaches 50%.
  • At 50% charging power is delivered to battery and until it reaches 60%(endthreshold) and it keeps cycling between 50%-60%.

A common assumption is that start-threshold is used to force discharge the battery 50%, but it is not.

Start-threshold is a level at which the charger connects to the battery and starts charging, just like end threshold is a level at which the charger is disconnected from the battery.

I have a asus viwobook laptop, and in my laptop there is no option to set start-threshold.
I can only set the end threshold and the start threshold is automatically set (endthreshold - 2%).
So if it set my endthreshold to 60% the start threshold is automatically set to 58%. Any my laptop keeps cycling between 60% to 58%.
Also in example 2, when my battery level was 80% and I set end_threshold to 60% it took several hours just to drop from 80% to 75% .

Most laptops manufacturer recommends or set start-threshold 2-10% below endthreshold
Sorry for long answer. :)

@mascherm
Copy link

thanks for the explaination!

@maniacx
Copy link
Owner Author

maniacx commented Apr 2, 2023

Hello @mascherm @monethass @anzigo
Download test_version_11.zip and test please.

Changes:

  1. Added an option that changes system icon behavior as explained in the post Discussion and Testing #11 (comment)

Currently when charger is powered and plugged-in, if the threshold is active and battery reaches threshold limit, the battery indicator icon switches to on-battery/charger-unplugged.
This for me, creates a problem as I do not know if the charger is powered and plugged-in or not.
Dont know if on-battery/charger-unplugged is displayed because threshold is reached or charger is unplugged or powered off.

That why i introduced this option.
With this option enabled, the battery indicator will display charging icon and never display on-battery/charger-unplugged icon with charger powered and plugged-in. Similar behaviour as in Windows OS.
This way we know that if charger is power and plugged-in or not.
Screenshot from 2023-04-01 17-18-04

  1. This is for users with custom threshold. Added addition text (currently active) showing the current mode, as shown in pic. Depending on which mode is selected this text will be displayed besides the mode indicating current mode.
    Although it is informative, in my opinion doesn't look fitting. Please test, change to different modes and let me know if it works and if I should keep or remove it.
    Screenshot from 2023-04-01 17-19-32

@monethass
Copy link

Just tried on Dell, and both feature worked as expected.

However, a feedback on the indicator icon, is that if it's enabled, it can't be distinguished between the two state of "charging" or "holding". For example, I set my threshold to 60/80. Now I see my battery is at 70%, and having the charging icon, but I do not know if it's at the cycle of charging from 60% to 80%, or it already has been charged to 80%, and currently it's discharging from 80% to 60% because my laptop is using more power than the power brick can supply.

A suggestion is that to use this extension's icon to distinguish between those two states instead of changing the original battery icon.

@maniacx
Copy link
Owner Author

maniacx commented Apr 2, 2023

Like the idea. Initially i thought of using extensions icon to display the charging status instead of the system icon. But no space on the icon (it is a very small icon) and I ran out of ideas if how to modify the icon to provide more information about charging and holding (unless I add another icon which I dont want to). One way of implementing was to change to color the icon, but it look bad and inconsistent as rest of the system icons are symbolic.
But i will give it another shot, and see if i can come up with something for the next release.

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 17, 2023

could you please add more gnome version support?

@maniacx
Copy link
Owner Author

maniacx commented Apr 17, 2023

Gnome 43 and 44 are supported. Which Gnome version are you using?

@maniacx
Copy link
Owner Author

maniacx commented Apr 17, 2023

@ViBE-HU I had a look to support gnome 42 and the changes are massive. I don't think can support any gnome versions earlier than 43.

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 21, 2023

@maniacx good to know. bad news for compatibility cause bunch of major distros still on 42x.

@maniacx
Copy link
Owner Author

maniacx commented Apr 21, 2023

Ok Not confirming, but I may give it a go when I have free time for gnome 42.

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 21, 2023

that would be cool. translation is much more easier if i can test the extension.

@maniacx
Copy link
Owner Author

maniacx commented Apr 21, 2023

that would be cool. translation is much more easier if i can test the extension.

Can you please give me the exact gnome version used on pop os? I can see that latest release of gnome42 is 42.9. Is pop-os using 42.9 or an older version of 42?

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 21, 2023

i did not mention pop os. at the moment i use ubuntu 20.04 and 22.04 machines.

22.04 has gnome 42.5

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 27, 2023

@maniacx no worries. i did not forget the project. but im a bit busy now and need a little time to test a few machines. i also want to test a dual battery machine to translate properly the related strings.

so the dell with ubuntu 22.04 is tested. you was right. i had to install smbios-utils first. then the plugin installation went well. polkit added successfully. looks like the plugin working well.

and i have a question. i explain it first cause i'm not a developer. i'm a dual boot user and i have windows too on most machines. on windows you can use Dell Power Manager to manage battery/charging. this program controls U/EFI(?) directly. but as i understand your plugin does not and it stores the configuration locally. so if i change it on linux it will won't affect permanently. am i right? if yes, is it possible to control the same way as windows does?

@maniacx
Copy link
Owner Author

maniacx commented Apr 27, 2023

When you set the threshold using this extension, the only think the extension does is executes 1 or both commands below depending upon the mode. Also on every reboot to linux it will enable the previous settings

sudo smbios-battery-ctl --set-charging-mode='mode'
sudo smbios-battery-ctl --set-custom-charge-interval=low high

Rest everything is done by libsmbiosutils (using smbios-battery-ctl) which I think interacts with the UEFI bios (I may be wrong).
So I dont know if it will effect permanently. You will have to test it.

I didnt read much into it as I do not have dell laptop, and my only goal was to set battery threshold.
@monethass helped me understand how it works on dell laptop see discussion here #7

From what I have read, now Dell has two ways of changing charging threshold.

  1. libsmbios https://github.com/dell/libsmbios
    opensource and available on distros package manager.
    but on some dell laptop such as XPS some features doesnt work such as charging threshold

  2. CCTK which is now Dell command configure .(https://www.dell.com/support/kbdoc/en-us/000178000/dell-command-configure)
    This is dell official version . I think you can also set various bios options such battery threshold but I don't know for sure. I dont have much information on this.

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 27, 2023

i mean i tested it already and the plugin does not interact with the UEFI(?). in Dell UEFI you can set power management. it will affects permanently until you change it again in UEFI or on OS (Windows in this case) level. on Windows Dell Power Manager is the same tool. so if you set the charging mod via UEFI or windows it will be permanent.

Linux will also read UEFI power management settings IF nothing else overwrite it. of course your plugin can overwrite locally on OS level. of course it is not bad. it just not the same. in general your plugin is clearly the best solution at the moment for average laptop users. i encourage you to enhance it if you can.

yes, you can do anything in Dell UEFI what you can do with your plugin. the only difference that Dell UEFI offers much more rules. for example you can set different threshold rules for each days.

meanwhile i tested Lenovo too. sadly you're right. it does not recognise the host natively. but is there any dependencies for Lenovo machines? cause i tried to test it with the command but nothing happened. the host OS is 20.04. and if i set conservation mode via Lenovo Vantage On Windows 10 Ubuntu will follow the rule.

@monethass
Copy link

@ViBE-HU smbios-battery-ctl does interact with UEFI. It changes the config in UEFI when you set the config with --set-charging-mode.

@maniacx
Copy link
Owner Author

maniacx commented Apr 27, 2023

meanwhile i tested Lenovo too. sadly you're right. it does not recognise the host natively. but is there any dependencies for Lenovo machines? cause i tried to test it with the command but nothing happened. the host OS is 20.04. and if i set conservation mode via Lenovo Vantage On Windows 10 Ubuntu will follow the rule.

No. there are no dependencies required for Lenovo, it is natively supported by the kernel but it should be installed and running on lenovo hardare and not on Virtual Machine/Virtual Box.

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 27, 2023

@ViBE-HU smbios-battery-ctl does interact with UEFI. It changes the config in UEFI when you set the config with --set-charging-mode.

now i see. you are right. but something still wrong. i did a more detailed test on my E5450. i tried first the mode menu and Express Mode is the only one which really interacts with my machine's UEFI. the method i used:

  1. set a mode in ubuntu
  2. then return to windows and check via Dell Power Manager

only Express Mode worked. any other mode does not have permanent effect.

then i tried to configure smbios-battery-ctl directly via terminal and only express and standard worked. these are truly permanent. any other modes are not somehow. i also checked the UEFI and looks like express and standard are legacy(?) modes cause any other modes are not listed but can be set via Dell Power Manager. in general if i set a mode with Dell Power manager Windows keep using it.

@maniacx i also noticed that if i set express or standard via Windows or Linux terminal the plugin:

@maniacx
Copy link
Owner Author

maniacx commented Apr 28, 2023

  1. Yes. On reboot extension will restore the mode/threshold to whatever was previously set on linux before reboot.

  2. When mode is set using extension, It will set using --set-charging-mode=mode and then verify if it actually set using --get-charging-cfg once

To actually monitor if user have change the mode t using command line, I will have to continuously run
Command --get-charging-cfg. Which will be use lot of resources. So cannot use that.

@maniacx
Copy link
Owner Author

maniacx commented Apr 28, 2023

@ViBE-HU Did you ever try changing threshold using cctk in Ubuntu? Are you familar with it?
Are you willing to try?
https://www.dell.com/support/kbdoc/en-us/000178000/dell-command-configure

But My extension doesnt support it. So was thinking about including it.

EDIT:
Dont try dell command configure if you never used it before.
after some searching, i read that some laptops struggle to boot.
https://aur.archlinux.org/packages/dell-command-configure
I would avoid using it.

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 28, 2023

@maniacx

  1. Yes. On reboot extension will restore the mode/threshold to whatever was previously set on linux before reboot.

    1. When mode is set using extension, It will set using --set-charging-mode=mode and then verify if it actually set using --get-charging-cfg once

To actually monitor if user have change the mode t using command line, I will have to continuously run Command --get-charging-cfg. Which will be use lot of resources. So cannot use that.

and no way to switch on/of this forcing and simply just read UEFI on boot? also i'm not familiar how system menu works but isn't it possible to check the actual config when the user open the exact submenu? gnome also checks somehow charging time when and bunch of plugins have sliders. are those different?

btw as i mentioned i'm not a developer. i'm a kinda advanced user with a light clue about programming. so i don't do random things and if you think cctk can improve the plugin and it's functionality then i can take a try. just need a clear guide what exactly should i check. of course i don't wanna kill my machine but at the moment i'm using it for testing cases and i can take a look.

@maniacx
Copy link
Owner Author

maniacx commented Apr 28, 2023

and no way to switch on/of this forcing and simply just read UEFI on boot?

To implement this feature.

  • All modes must be reported correctly by libsmbios on reboot.
  • All threshold values must be reported correctly on reboot

then i tried to configure smbios-battery-ctl directly via terminal and only express and standard worked.

But as per your test libsmbios on reports only "express" and "standard" correctly on reboot.
So it is pointless to implement this if all modes and threshold are not reported correctly by libsmbios on reboot.

it possible to check the actual config when the user open the exact submenu?

Sorry, I dont want to implement.

if you think cctk can improve the plugin and it's functionality then i can take a try. just need a clear guide what exactly should i check. of course i don't wanna kill my machine but at the moment i'm using it for testing cases and i can take a look.

Not sure, But I think in regards to batthery threshold there is no benefits. On some laptops libsmbios doesnt work, but cctk works so I thinking of adding support.
There was one comment on arch forum that cctk prevented arch linux from booting as it overwrote a file libcrypto.so during update. So better not to try.

I actually installed dell command configure (cctk) on Ubuntu 20.04 om my asus just to try. but it said something like libcrypto missing. For me it is not big deal because ubuntu 20.04 is use for testing only, and if any problem I will just format it and reinstall.
I mainly use Windows11 (laptop internal hardrive) and Fedora38 (portable usb hardrive). I have debian bookworm and ubuntu 20.04 just also on portable usb hardrive for testing only..

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 29, 2023

i would like to test the extension on my ThinkPad R61. it is from ~2008. not sure is it supported. the extension starts with unexpected error.

@maniacx
Copy link
Owner Author

maniacx commented Apr 29, 2023

Wow its way old. Not all thinkpad have this feature. it will work if kernel supports it. you can check if any of the following files exist.
ls- l /sys/class/power_supply/BAT0/charge_control_end_threshold
ls -l /sys/class/power_supply/BAT1/charge_control_end_threshold
ls -l /sys/devices/platform/smapi/BAT0/stop_charge_thresh
ls -l /sys/devices/platform/smapi/BAT1/stop_charge_thresh
If none of those files are present it is not supported

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 29, 2023

yeah it's pretty old but one of my favourite machine for home office. i thought the ThinkPad legacy rules are also support this machine.

it has only one removable battery. here's the only working output:
-rw-r--r-- 1 root root 4096 ápr 29 17:21 /sys/class/power_supply/BAT0/charge_control_end_threshold

@maniacx
Copy link
Owner Author

maniacx commented Apr 29, 2023

Seem like it has it. can you give me the output in this specific order
ls -l /sys/devices/platform/thinkpad_acpi
echo "80" | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
cat /sys/class/power_supply/BAT0/charge_control_end_threshold
echo "75" | sudo tee /sys/class/power_supply/BAT0/charge_control_start_threshold
cat /sys/class/power_supply/BAT0/charge_control_start_threshold

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 29, 2023

sadly only the firs command gives detailed output.

ls -l /sys/devices/platform/thinkpad_acpi
total 0
--w------- 1 root root 4096 ápr  29 18:08 cmos_command
lrwxrwxrwx 1 root root    0 ápr  29 16:58 driver -> ../../../bus/platform/drivers/thinkpad_acpi
-rw-r--r-- 1 root root 4096 ápr  29 18:08 driver_override
-r--r--r-- 1 root root 4096 ápr  29 18:08 hotkey_adaptive_all_mask
-r--r--r-- 1 root root 4096 ápr  29 18:08 hotkey_all_mask
-r--r--r-- 1 root root 4096 ápr  29 18:08 hotkey_bios_enabled
-r--r--r-- 1 root root 4096 ápr  29 18:08 hotkey_bios_mask
-rw-r--r-- 1 root root 4096 ápr  29 18:08 hotkey_enable
-rw-r--r-- 1 root root 4096 ápr  29 18:08 hotkey_mask
-rw-r--r-- 1 root root 4096 ápr  29 18:08 hotkey_poll_freq
-r--r--r-- 1 root root 4096 ápr  29 18:08 hotkey_radio_sw
-r--r--r-- 1 root root 4096 ápr  29 18:08 hotkey_recommended_mask
-rw-r--r-- 1 root root 4096 ápr  29 18:08 hotkey_source_mask
drwxr-xr-x 3 root root    0 ápr  29 16:58 input
drwxr-xr-x 7 root root    0 ápr  29 16:58 leds
-r--r--r-- 1 root root 4096 ápr  29 18:08 modalias
drwxr-xr-x 2 root root    0 ápr  29 18:08 power
lrwxrwxrwx 1 root root    0 ápr  29 16:58 subsystem -> ../../../bus/platform
-rw-r--r-- 1 root root 4096 ápr  29 16:58 uevent
-r--r--r-- 1 root root 4096 ápr  29 18:08 wakeup_hotunplug_complete
-r--r--r-- 1 root root 4096 ápr  29 18:08 wakeup_reason

others just reply with "no device" message or something like that however the files are present in BAT0.

@maniacx
Copy link
Owner Author

maniacx commented Apr 29, 2023

echo "80" | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
cat /sys/class/power_supply/BAT0/charge_control_end_threshold
echo "75" | sudo tee /sys/class/power_supply/BAT0/charge_control_start_threshold
cat /sys/class/power_supply/BAT0/charge_control_start_threshold

Unfortunately if these commands dont work, then too extension wont work

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 29, 2023

@maniacx i think i found something. as i mentioned i'm not a programmer but i checked the scripts maybe i can figure out what's going on and your ThinkPad legacy script contains a tp_smapi module(?). not clear which exact models use that but i guess this handles the pre-uefi machines and if i install tp_smapi i can set thresholds via terminal. i followed this instruction (first answer) and looks like it works like a charm. looks like it's permanent too but not sure yet.

maybe your script is not complete or something different? i tested this machine with Ubuntu 22.04 and i guess most oddware IBM/Lenovo ThinkPad (starting with T4x/R4x/X4x series) might work with this method.

@maniacx
Copy link
Owner Author

maniacx commented Apr 29, 2023

So how are you setting threshold now?

Can you run this again and give me the output.

ls -l /sys/class/power_supply/BAT0/charge_control_end_threshold
ls -l  /sys/class/power_supply/BAT0/charge_control_start_threshold
ls -l /sys/devices/platform/smapi/BAT0/stop_charge_thresh
ls -l /sys/devices/platform/smapi/BAT0/start_charge_thresh

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 29, 2023

the first two has output. but the last two say that no device

ls -l /sys/class/power_supply/BAT0/charge_control_end_threshold
-rw-r--r-- 1 root root 4096 ápr   29 23:36 /sys/class/power_supply/BAT0/charge_control_end_threshold
ls -l /sys/class/power_supply/BAT0/charge_control_start_threshold
-rw-r--r-- 1 root root 4096 ápr   29 23:36 /sys/class/power_supply/BAT0/charge_control_start_threshold

i did exactly what the commenter said:

sudo apt-get install tp-smapi-dkms
sudo modprobe tp_smapi

then these example values for testing:

echo 40 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 80 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh

and then restarted the laptop and voilà. it's working.

@maniacx
Copy link
Owner Author

maniacx commented Apr 30, 2023

As this extension support several device it search for files at certain path do know what type of laptop it is installed on.
For example. If these 3 files exist, it will know that is it thinkpad

/sys/devices/platform/thinkpad_acpi
/sys/class/power_supply/BAT0/charge_control_end_threshold
/sys/class/power_supply/BAT0/charge_control_start_threshold

If these 2 files exist, it will know it is legacy thinkpad tp-smp

/sys/devices/platform/smapi/BAT0/stop_charge_thresh
/sys/devices/platform/smapi/BAT0/start_charge_thresh

Strange You laptop has all 5 files.

Just out of curiosity does this files still exist in your system after installing tp-smp-dkms and restarting. or do they get removed? You can check again with

ls -l /sys/class/power_supply/BAT0/charge_control_end_threshold
ls -l  /sys/class/power_supply/BAT0/charge_control_start_threshold

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Apr 30, 2023

-rw-r--r-- 1 root root 4096 ápr   30 20:24 /sys/class/power_supply/BAT0/charge_control_end_threshold
-rw-r--r-- 1 root root 4096 ápr   30 20:24 /sys/class/power_supply/BAT0/charge_control_start_threshold

@maniacx
Copy link
Owner Author

maniacx commented May 29, 2023

@ViBE-HU , @monethass
I am having an issue reported by a user on lenovo , where the firmware updater install libsmbios automatically on their device.

Currently in the extension , it only checks if smbios-battery-ctl is present and report device as dell devices. Now since knowing that other brand laptops may also install this program, I will have to add additional checks for detecting if the laptop is a dell laptop or not.

On your dell laptop, please and comfirm if this file exist on your device. According to the kernel code, all dell device register this file/folder

ls /sys/devices/platform/dell-laptop

@monethass
Copy link

Yes the folder exists

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Jun 8, 2023

ls /sys/devices/platform/dell-laptop

just checked:

ls /sys/devices/platform/dell-laptop
driver  driver_override  leds  modalias  power  rfkill  subsystem  uevent

btw i have no time to test at the moment but looks like settings are still not permanent on dell somehow. is this a bug or it's normal?

@maniacx
Copy link
Owner Author

maniacx commented Jun 8, 2023

Not permanent?
You mean it changes after sometime?
Does the settings change on reboot?
Either way , extension should reapply threshold on reboot, so might be a bug.
When you have time please test and let me know, when does the threshold change

I will also check on my end too.

@ViBE-HU
Copy link
Contributor

ViBE-HU commented Jun 25, 2023

now finally my E5470 is back and i tested the plugin again. if i change the mode it does not permanent. i thought your recent update targeted this thing. it's working but it is only permanent if i change the mode via Windows. on Ubuntu it is temporary. is this normal?

@maniacx
Copy link
Owner Author

maniacx commented Jun 25, 2023

now finally my E5470 is back and i tested the plugin again. if i change the mode it does not permanent. i thought your recent update targeted this thing. it's working but it is only permanent if i change the mode via Windows. on Ubuntu it is temporary. is this normal?

I am not understanding what do mean by permanent. I am assuming you talking about charging threshold from windows and ubuntu. When you boot from windows to Ubuntu it should restore your charging threshold values what was ubuntu.

This is an example of behavior

  • If you are in Ubuntu and set threshold custom:55-60 for example.
    The extension will apply the mode and threshold to SMBIOS. it will also save the mode and threhsold schema gsettings /org/Gnome/shell/extensions/Battery-Health-Charging

  • Then you boot windows and set threshold custom:75:80 for example.

  • Now , if you boot again to Ubuntu again, the extension will apply threshold custom:55-60, during boot. It will restore the mode and threshold from schema gsettings that was last saved in Ubuntu.

This an example of normal behavior of the extension. Is it behaving differently for you?

@Locke
Copy link
Contributor

Locke commented Oct 29, 2023

I understand this issue to be for general discussions too, so I am posting it here instead of a new issue.

I am using this extension on my Lenovo ThinkPad L13 Yoga and are happy with it.

In addition to the charge thresholds, my device supports changes to the charge behavior:

$ cat /sys/class/power_supply/BAT0/charge_behaviour
[auto] inhibit-charge force-discharge

I am using these currently from the console, and would love to see support for that via gnome, just like the charge thresholds. I think it would be best to have it in the same extension, or do you think that should be a separate one?

My use case:
I am using the device mostly as a desktop working from home. I have the peripherals on a KVM switch, which also delivers power over the same cable.
I normally have the charge thresholds low to extend the battery life. When I anticipate to use it as a notebook/tablet, I charge it up (e.g. for an office day with meetings). When I connect it back to the KVM at home, I often have more charge left than the threshold I'd like to have at home. In this case, I need to drain the battery - either via above charge_behaviour or by not connecting the device to the KVM (I cannot simply unplug the power to the KVM as it powers the KVM and the USB devices).

Alternative use case:
Some energy providers are offering a dynamic electricity pricing; in central Europe typically low (sometimes negative) on sunny or windy hours, and high on evenings. Some users may want to manually control when their devices are charging or discharging due to that.

@maniacx
Copy link
Owner Author

maniacx commented Oct 31, 2023

I understand this issue to be for general discussions too, so I am posting it here instead of a new issue.

I am using this extension on my Lenovo ThinkPad L13 Yoga and are happy with it.

In addition to the charge thresholds, my device supports changes to the charge behavior:

$ cat /sys/class/power_supply/BAT0/charge_behaviour
[auto] inhibit-charge force-discharge

I am using these currently from the console, and would love to see support for that via gnome, just like the charge thresholds. I think it would be best to have it in the same extension, or do you think that should be a separate one?

My use case: I am using the device mostly as a desktop working from home. I have the peripherals on a KVM switch, which also delivers power over the same cable. I normally have the charge thresholds low to extend the battery life. When I anticipate to use it as a notebook/tablet, I charge it up (e.g. for an office day with meetings). When I connect it back to the KVM at home, I often have more charge left than the threshold I'd like to have at home. In this case, I need to drain the battery - either via above charge_behaviour or by not connecting the device to the KVM (I cannot simply unplug the power to the KVM as it powers the KVM and the USB devices).

Alternative use case: Some energy providers are offering a dynamic electricity pricing; in central Europe typically low (sometimes negative) on sunny or windy hours, and high on evenings. Some users may want to manually control when their devices are charging or discharging due to that.

Lets continue our discussion here #67 (comment)

@ponychicken
Copy link

Thanks for this beautiful extension ::))

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

No branches or pull requests

8 participants
@Locke @ponychicken @ViBE-HU @maniacx @anzigo @mascherm @monethass and others