General TC > Programming & Scripting - Unofficial

acpid scripts for laptop Fn+F2/3/6/7/8 functions

<< < (4/9) > >>

curaga:
If you never use HDMI sound, you could try disabling it with the "radeon.audio=0" bootcode.

nick65go:
for now my sound configuration is solved.

I can also kill (from mydata.tgz) the 3+ deamons (/sbin/udevd --daemon) which run for nothing in the background (because firmware triggers)
They were only needed for few seconds, until firmware is found and loaded, right?

Rich:
Hi nick65go

--- Quote from: nick65go on May 19, 2020, 09:58:40 AM ---Remarks about ALSA. The mydata.tgz (which contains my setings about /etc/modprobe.d/snd_hda-intel.conf) is loaded AFTER the alsa.tcz (and its alsa-module-$kernel.tcz) are loaded from onboot.lst

For me, ALSA without core remastering, can be only in on-demand; because my setting about digital sound before HDMI are useless if alsa.tcz is in onboot.lst
--- End quote ---
Or you could call:

--- Code: ---tce-load -i alsa
--- End code ---
from  bootsync.sh  which runs after  mydata.tgz  is restored.

nick65go:
Hi Rich, thank you, it is a good point! I forgot about bootsync.sh.
I  try to avoid to remaster anything. I remastered many times, and then a new TC made it obsoleted (because kernel modules version).

nick65go:
I was thinking about a solution to trigger an alarm-popup, using tinycore crond daemon, if battery is lower 2%-7%.crond can start/stop from Control-Panel /Services.


--- Code: ---tc@box:/var/spool/cron/crontabs$ sudo cat tc
# crond timer; */n  =every nth interval; specific intervals with commas (1,2,3,etc)
# M             minute (0 - 59)
#   H           hour (0 - 23)
#     D         day of the month (1 - 31)
#       m       month (1 - 12)
#         w     day of the week (0 - 6)
#           c   command to execute
# * * * * * echo "demo"
*/5 * * * * /home/tc/.acpi/battery.sh
--- End code ---


--- Code: ---tc@box:~/.acpi$ cat battery.sh
#!/bin/sh
# battery.sh alarm for 2% capacity

LOW=`cat /proc/acpi/battery/BAT0/info | grep "design capacity low:" | cut -d: -f2 | tr -d " " | tr -d "mWh"`
#echo $LOW
MAX=`cat /proc/acpi/battery/BAT0/info | grep "design capacity:" | cut -d: -f2 | tr -d " " | tr -d "mWh"`
#echo $MAX
NOW=`cat /proc/acpi/battery/BAT0/state | grep "remaining capacity:" | cut -d: -f2 | tr -d " " | tr -d "mWh"`
#echo $NOW

[[ $NOW -ge $LOW ]] && exit
[ $NOW -gt `expr $MAX / 50` ] && popup "Battery low `expr 100 \* $NOW / $MAX` %%" && exit
popup "Plug NOW the power cable, Battery is less than 2 %%"
--- End code ---
I do not know if crond (popping up every 5 minutes) will consume itself the battery.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version