Low Battery Alarm <solved>

Questions about hardware, drivers and peripherals
Forum rules
Before you post please read how to get help
Post Reply
User avatar
lsemmens
Level 11
Level 11
Posts: 3686
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Low Battery Alarm <solved>

Post by lsemmens »

I'm looking for an audible alarm for when my laptop battery gets low.
This thread from 2019 is the most recent that I can find that is relevant. Is this still relevant today or has Mint moved on from there?

Code: Select all

System:
  Kernel: 5.4.0-126-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 
  Desktop: Cinnamon 5.2.7 wm: muffin dm: LightDM Distro: Linux Mint 20.3 Una 
  base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop System: TOSHIBA product: Satellite P70-A v: PSPLPA-01C002 
  serial: <filter> 
  Mobo: Type2 - Board Vendor Name1 model: Type2 - Board Product Name1 
  v: Type2 - Board Version serial: <filter> UEFI: Insyde v: 1.00 
  date: 05/02/2013 
Battery:
  ID-1: BAT1 charge: 46.0 Wh condition: 46.0/56.2 Wh (82%) volts: 12.4/10.8 
  model: SANYO PA5024U-1BRS serial: <filter> status: Full 
CPU:
  Topology: Quad Core model: Intel Core i7-4700MQ bits: 64 type: MT MCP 
  arch: Haswell rev: 3 L2 cache: 6144 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 38312 
  Speed: 798 MHz min/max: 800/3400 MHz Core speeds (MHz): 1: 798 2: 799 
  3: 798 4: 799 5: 798 6: 802 7: 798 8: 801 
Graphics:
  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Toshiba 
  driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:0416 
  Device-2: NVIDIA GK107M [GeForce GT 745M] vendor: Toshiba driver: nvidia 
  v: 470.141.03 bus ID: 01:00.0 chip ID: 10de:0fe3 
  Display: x11 server: X.Org 1.20.13 driver: modesetting,nvidia 
  unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 4600 (HSW GT2) 
  v: 4.5 Mesa 21.2.6 compat-v: 3.0 direct render: Yes 
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio 
  vendor: Toshiba driver: snd_hda_intel v: kernel bus ID: 00:03.0 
  chip ID: 8086:0c0c 
  Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Toshiba 
  driver: snd_hda_intel v: kernel bus ID: 00:1b.0 chip ID: 8086:8c20 
  Sound Server: ALSA v: k5.4.0-126-generic 
Network:
  Device-1: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter 
  vendor: Lite-On driver: ath9k v: kernel port: 5000 bus ID: 07:00.0 
  chip ID: 168c:0036 
  IF: wlp7s0 state: up mac: <filter> 
  Device-2: Qualcomm Atheros AR8161 Gigabit Ethernet vendor: Toshiba 
  driver: alx v: kernel port: 3000 bus ID: 0d:00.0 chip ID: 1969:1091 
  IF: enp13s0 state: down mac: <filter> 
Drives:
  Local Storage: total: 599.84 GiB used: 414.38 GiB (69.1%) 
  ID-1: /dev/mmcblk0 model: SU16G size: 14.84 GiB serial: <filter> 
  ID-2: /dev/sda vendor: HGST (Hitachi) model: HTS725050A7E630 
  size: 465.76 GiB speed: 3.0 Gb/s serial: <filter> 
  ID-3: /dev/sdb vendor: OCZ model: VERTEX4 size: 119.24 GiB speed: 6.0 Gb/s 
  serial: <filter> 
Partition:
  ID-1: / size: 44.84 GiB used: 24.83 GiB (55.4%) fs: ext4 dev: /dev/sdb5 
Sensors:
  System Temperatures: cpu: 51.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 264 Uptime: 27m Memory: 15.39 GiB used: 1.39 GiB (9.0%) 
  Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.4.0 alt: 9 Shell: bash 
  v: 5.0.17 running in: gnome-terminal inxi: 3.0.38 
Last edited by lsemmens on Tue Oct 18, 2022 2:07 am, edited 2 times in total.
Fully mint Household
Out of my mind - please leave a message
User avatar
antikythera
Level 15
Level 15
Posts: 5724
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: Low Battery Alarm

Post by antikythera »

I reckon that method will still work, udev is still available to use anyway.
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
User avatar
lsemmens
Level 11
Level 11
Posts: 3686
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Low Battery Alarm

Post by lsemmens »

Thanks, will test.
Fully mint Household
Out of my mind - please leave a message
User avatar
lsemmens
Level 11
Level 11
Posts: 3686
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Low Battery Alarm

Post by lsemmens »

I can't get it to work

99-lowbat.rules listing

SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-10]", run+="/usr/bin/aplay /home/leigh/batterywarn.wav"

does not give an alarm when set to [0-95], [0-85] or any other value

Yes, I have batterywarn.wav in the correct place.

I even tried restarting the computer. Theoretically it should work,
Fully mint Household
Out of my mind - please leave a message
Cosmo.
Level 24
Level 24
Posts: 22055
Joined: Sat Dec 06, 2014 7:34 am

Re: Low Battery Alarm

Post by Cosmo. »

Gotcha!
User avatar
lsemmens
Level 11
Level 11
Posts: 3686
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Low Battery Alarm

Post by lsemmens »

Thanks Cosmo, still no audible alarm but it, at least gives a good visual indicator,
Fully mint Household
Out of my mind - please leave a message
Cosmo.
Level 24
Level 24
Posts: 22055
Joined: Sat Dec 06, 2014 7:34 am

Re: Low Battery Alarm <solved - sort of>

Post by Cosmo. »

There is an option for an audible alarm in the applet and it works for me (LM 20.3 as you).
Gotcha!
User avatar
lsemmens
Level 11
Level 11
Posts: 3686
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Low Battery Alarm <solved - sort of>

Post by lsemmens »

I Thanks Cosmo, I am aware of the Audible alarm feature in that Applet, which, for some reason, does not appear to work on this lappy. Anyway, I've put it into the "not worth a lot of effort" basket for now. I've got some laptop upgrades coming in the the near future which will involve a system re-load (for no other reason than changing my drive) The speakers in this lappy are stuft (I'm guessing torn suspension around the diaphragm), so, whilst they produce sound, it ain't very good. Once I put the machine back together again, I may re-visit this. SO, Thanks again.
Fully mint Household
Out of my mind - please leave a message
User avatar
lsemmens
Level 11
Level 11
Posts: 3686
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Low Battery Alarm <solved>

Post by lsemmens »

Having now upgraded said lappy, including a full system re-load, it now works as it should. Thank You
Fully mint Household
Out of my mind - please leave a message
Post Reply

Return to “Hardware Support”