Tiny Core Linux
General TC => Programming & Scripting - Unofficial => Topic started by: nick65go on May 18, 2020, 05:15:47 PM
-
My modest try to solve annoying problems with my laptop Fn keys.I think my HP laptop has a bug in UEFI firmware. It always was the same problem with BIOS for any PC I bought, because they came with Windows 7/10 preinstalled. And Dell /HP did not care about linux :(
The Fn keys that I need most often are F2/F3 for brightness and F6/F7/F8 for sound volume control.When the laptop starts, the fan is very noisy, because the brightness is very high (near insupportable). Plus the battery will deplete very fast (high power consumption).
So, basic things, but they can keep a user away of TinyCore/Linux if they are few but critical.
After trying in aterm a lot of basic commands for alsamixer, amixer, flit, etc, reading about acpid,here below is my acpid config. hope is usefully for some one.
home/tc/.acpi/actions.sh#!/bin/sh
case $1 in
button/mute*)
MST=`amixer controls | grep 'Master Playback Switch' | cut -d, -f1`
if [[ -z `amixer cget $MST | grep "values=on"` ]]
then
amixer cset $MST on
else
amixer cset $MST off
fi;;
button/volumedown*)
MST2=`amixer controls | grep "Master Playback Volume" | cut -d, -f1`
VOL=`amixer cget $MST2 | grep ": values=" | cut -d= -f2`
[[ $VOL -ge 4 ]] && amixer cset $MST2 `expr $VOL - 4` && exit
MST1=`amixer controls | grep "Master Playback Switch" | cut -d, -f1`
amixer cset $MST1 off;;
button/volumeup*)
MST2=`amixer controls | grep "Master Playback Volume" | cut -d, -f1`
VOL=`amixer cget $MST2 | grep ": values=" | cut -d= -f2`
[[ $VOL -le 83 ]] && amixer cset $MST2 `expr $VOL + 4`
MST1=`amixer controls | grep "Master Playback Switch" | cut -d, -f1`
[[ -z `amixer cget $MST1 | grep "values=on"` ]] && amixer cset $MST1 on;;
video/brightnessdown*)
BG=`cat /sys/class/backlight/radeon_bl0/actual_brightness`
[[ $BG -ge 9 ]] && echo -n `expr $BG - 8` > /sys/class/backlight/radeon_bl0/brightness;;
video/brightnessup*)
BG=`cat /sys/class/backlight/radeon_bl0/actual_brightness`
[[ $BG -le 247 ]] && echo -n `expr $BG + 8` > /sys/class/backlight/radeon_bl0/brightness;;
# *)
# popup $1;;
esac
I tested by running as root:root@box:/home/tc# /usr/local/sbin/acpid -d
my acpid event-config is just a small file /etc/acpi/event/all,
tc@box:/etc/acpi/events$ cat all
event=.*
action=/home/tc/.acpi/actions.sh "%e"
-
and the fight against Goliath (laptop!) continue...When the lid is closed, the Diplay is OFF, but other parts are NOT in standby (I hear the fan, the small-left led is still continuum lighting, not flashing as in standby.So basically the LID switch is just for display, not for stand by. When laptop cover is lifted up, the display turn on.
Looking into /var/log/Xorg.0.log I see at least:Power Button (/dev/input/event0)
Lid Switch (/dev/input/event1)
And now the improved/continued list of events for acpid button/power*)
exitcheck.sh shutdown;; #<-- thanks tiny core
button/lid*)
echo -n "mem" > /sys/power/state;;
*)
popup $1 &
sleep 1
kill `pidof popup` &;;
esac
tamimg the beast. TBC...
-
now there are people who do not give a shit about Fn-F# keys. Right. We can use aterm very easy, if we per-define some aliases:
tc@box:~$ cat .ashrc
alias suspend='echo mem | sudo tee /sys/power/state'
alias low50='echo 50 | sudo tee /sys/class/backlight/radeon_bl0/brightness'
Ok you need a little flexibility for brightness?tc@box:~/.local/bin$ cat brightness.sh
#!/bin/sh
BG=`cat /sys/class/backlight/radeon_bl0/brightness`
echo "Curent brightnness is" $BG
echo "
1. Minim ~0% (Are you crazy?)
8. Hurry Battery is Low!
16. Economic
32. GOOD BOY
64. Medium
128. Very Bright
192. Extremely Bright
255. Max 100% (Are you crazy?)
Type Brightness Number: [1-255]"
read -s answer
echo $answer | sudo tee /sys/class/backlight/radeon_bl0/brightness
echo "Done! bye"
read junk; exit
Now another bad habit of the laptop is that the battery runs silent until remain 1%. WTF? then I have maxim 20 seconds to plug the adapter, or bye-bye unsaved work.Time for a cron job? [never tried one] to test every 10-20 minutes the battery capacity? or when is near (lets say) 5% to popup a messge like: "My Lord, plug the F**king power cord, battery is x%"
-
About suspend by command, IIRC in some laptops the enter key press comes so late it causes a wakeup. On those I added a sleep in front,
alias suspend='sleep 1 && echo mem | sudo tee /sys/power/state'
Battery alarm like that is a hw/bios function, and you indeed need a software poll setup for other thresholds and notifications.
-
Thanks curaga for support. I am still thinking about a simple script for crond job, stubborn in using FLTK only as much as possible.
Now the battle with sound and video continue. I hope I won.
ALSA has a bad habit to see HDMI first then Digital sound card. And radeon driver should adjust the clock to low speed to stay quiet for longer.
(I have an AMD A6-6310 APU with AMD Radeon R4 Graphics integrated).tc@box:~$ ls -lR /etc/modprobe.d
/etc/modprobe.d:
total 12
-rw-r--r-- 1 tc staff 18 May 19 2019 blacklist.conf
-rw-r--r-- 1 tc staff 50 May 19 2019 radeon.conf
-rw-r--r-- 1 tc staff 33 May 21 2019 snd_hda_intel.conf
tc@box:~$ cat /etc/modprobe.d/blacklist.conf
blacklist pcspkr
tc@box:~$ cat /etc/modprobe.d/radeon.conf
options radeon aspm=1 vce=1 uvd=1 dynclks=Enable dpm=1
tc@box:~$ cat /etc/modprobe.d/snd_hda_intel.conf
options snd_hda_intel index=1,0
the misleading thing was that i need options snd_hda_intel (not snd-hda-intel) even if modprobe has letters with "minus", not "underscore"
tc@box:~$ modinfo snd_hda_intel
filename: /lib/modules/5.4.3-tinycore64/kernel.tclocal/sound/pci/hda/snd-hda-intel.ko.gz
And finally, for sound testing, aplay is not working by default. because missing few dummy files in /usr/local/etc/alsa/cards (shame-less taken from alsaconfig.tcz)tc@box:~$ ls -lR /usr/local/etc/alsa
/usr/local/etc/alsa:
total 8
lrwxrwxrwx 1 root root 45 May 19 09:32 alsa.conf -> /tmp/tcloop/alsa/usr/local/etc/alsa/alsa.conf
-rw-r--r-- 1 tc staff 6554 May 19 2019 asound.state
drwxr-xr-x 2 root root 80 May 19 09:32 cards/
/usr/local/etc/alsa/cards:
total 8
-rw-r--r-- 1 root root 71 May 14 00:41 aliases.conf
-rw-r--r-- 1 root root 762 Jan 10 14:46 default.conf
-
Two more small victories. Like the song says "another one bits the dust".
It was about input devices. My UK keyboard does not let me type € (euros sign) for Alt-gr + 4.
And the touch-pad is clever in Win10 but stupid in linux. It seams the modern "all-inclusive" libinput (in preparation for Wayland?) is good replacement for evdev, but libinput has not all options as old/trusted synaptics.#/etc/X11/xorg.conf.d/20-keyboard.conf
Section "InputClass"
Identifier "My Keyboard"
Driver "libinput"
MatchIsKeyboard "yes"
Option "XkbLayout" "gb" #not uk!
Option "XkbVariant" "extd" #not intl
Option "XkbOptions" "euro sign:4,terminate:ctrl_alt_bksp"
EndSection
An inspection on /var/log/Xog.0.log shows that only synaptic driver takes my options=.., ignored by libinput "master of inputs"
#/etc/X11/xorg.conf.d/70-synaptics.conf
Section "InputClass"
Identifier "My Pad"
Driver "synaptics"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "TapButton3" "3"
Option "ClickFinger1" "1"
Option "ClickFinger2" "2"
Option "ClickFinger3" "3"
Option "RTCornerButton" "2"
Option "RBCornerButton" "3"
Option "LTCornerButton" "1"
Option "LBCornerButton" "1"
Option "VertEdgeScroll" "1"
Option "HorizEdgeScroll" "1"
Option "VertTwoFingerScroll" "1"
Option "HorizTwoFingerScroll" "1"
Option "CornerCoasting" "1"
Option "CircularScrolling" "1"
Option "CoastingSpeed" "2"
Option "CoastingFriction" "5"
Option "SoftButtonAreas" "60% 0 82% 0 40% 59% 82% 0"
EndSection
FYI: all these little things (keyboard, audio, sound) keep users on Win10 (bloat/spy).
-
What happens without xf86-input-evdev and xf86-input-synaptics loaded?
-
in preparation for Wayland?
wayland has been available for some time now in CorePure64 - have you tried the weston compositor?
-
Hi Juanito, as I said, by default I do no load xf86-input-evdev, neither xf86-input-synaptic. xf86-input-libinput just works.but it ignores my options from
#/etc/X11/xorg.conf.d/70-synaptics.conf
Section "InputClass"
Identifier "My Pad"
Driver "libinput"
So I need to load xf86-input-synaptic also.#/etc/X11/xorg.conf.d/70-synaptics.conf
Section "InputClass"
Identifier "My Pad"
Driver "synaptics"
About wayland, i have no clue, just reading articles about why evdev is replaced, and libinput promoted (maybe for touch screens, etc)
FYI: I am still at base things, like Xorg + FLTK. partial GK1/2/3 as imposed by others like firefox.
-
just to confirm, again, that libinput ignores my syntax for "options=" from 70-synaptics.conf
I delete /var/log/Xorg.0.log, I modified the (only one on my laptop) 70-synaptics.conf, to have #/etc/X11/xorg.conf.d/70-synaptics.conf
Section "InputClass"
Identifier "My Pad"
Driver "libinput"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
shut-down X server, then startx. inspecting the fresh /var/log/Xorg.0.log i see it missed all my synaptic options (needed for horizontal/vertical edge scrolls, etc)[ 1186.556] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event8)
[ 1186.556] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "libinput touchpad catchall"
[ 1186.556] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "My Pad"
[ 1186.556] (II) Using input driver 'libinput' for 'SynPS/2 Synaptics TouchPad'
[ 1186.556] (**) SynPS/2 Synaptics TouchPad: always reports core events
[ 1186.556] (**) Option "Device" "/dev/input/event8"
[ 1186.556] (**) Option "_source" "server/udev"
[ 1186.558] (II) event8 - SynPS/2 Synaptics TouchPad: is tagged by udev as: Touchpad
[ 1186.561] (II) event8 - SynPS/2 Synaptics TouchPad: device is a touchpad
[ 1186.561] (II) event8 - SynPS/2 Synaptics TouchPad: device removed
[ 1186.604] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio1/input/input5/event8"
[ 1186.608] (**) Option "AccelerationScheme" "none"
[ 1186.608] (**) SynPS/2 Synaptics TouchPad: (accel) selected scheme none/0
[ 1186.608] (**) SynPS/2 Synaptics TouchPad: (accel) acceleration factor: 2.000
[ 1186.608] (**) SynPS/2 Synaptics TouchPad: (accel) acceleration threshold: 4
[ 1186.610] (II) event8 - SynPS/2 Synaptics TouchPad: is tagged by udev as: Touchpad
[ 1186.613] (II) event8 - SynPS/2 Synaptics TouchPad: device is a touchpad
[ 1186.614] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/mouse0)
[ 1186.614] (II) No input driver specified, ignoring this device.
[ 1186.614] (II) This device may have been added with another device file.
[ 1186.615] (II) config/udev: Adding input device PC Speaker (/dev/input/event4)
[ 1186.615] (II) No input driver specified, ignoring this device.
PS: in dmesg (from Control Panel) I see also (but i belive it is not critical)psmouse serio1: synaptics: queried max coordinates: x [..5656], y [..4712]
psmouse serio1: synaptics: queried min coordinates: x [1326..], y [1200..]
psmouse serio1: synaptics: Your touchpad (PNP: SYN3202 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.
random: fast init done
full Xorg.0.log is attached as prove.
-
Out of interest, have you tried accessing the settings directly:
$ xinput list
...
AlpsPS/2 ALPS GlidePoint id=16 [slave pointer (2)]
...
..so the touchpad is device id=16
$ xinput list-props 16
Device 'AlpsPS/2 ALPS GlidePoint':
Device Enabled (161): 1
Coordinate Transformation Matrix (163): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Tapping Enabled (314): 0
libinput Tapping Enabled Default (315): 0
libinput Tapping Drag Enabled (316): 1
libinput Tapping Drag Enabled Default (317): 1
libinput Tapping Drag Lock Enabled (318): 0
libinput Tapping Drag Lock Enabled Default (319): 0
libinput Tapping Button Mapping Enabled (320): 1, 0
libinput Tapping Button Mapping Default (321): 1, 0
libinput Natural Scrolling Enabled (296): 0
libinput Natural Scrolling Enabled Default (297): 0
libinput Disable While Typing Enabled (322): 1
libinput Disable While Typing Enabled Default (323): 1
libinput Scroll Methods Available (298): 1, 1, 0
libinput Scroll Method Enabled (299): 1, 0, 0
libinput Scroll Method Enabled Default (300): 1, 0, 0
libinput Middle Emulation Enabled (303): 1
libinput Middle Emulation Enabled Default (304): 1
libinput Accel Speed (305): 0.000000
libinput Accel Speed Default (306): 0.000000
libinput Left Handed Enabled (310): 0
libinput Left Handed Enabled Default (311): 0
libinput Send Events Modes Available (281): 1, 1
libinput Send Events Mode Enabled (282): 0, 0
libinput Send Events Mode Enabled Default (283): 0, 0
Device Node (284): "/dev/input/event7"
Device Product ID (285): 2, 8
libinput Drag Lock Buttons (312): <no items>
libinput Horizontal Scroll Enabled (313): 1
..so device enable is property id=161
$ xinput set-prop 16 161 0
..disables the touchpad (for example)
-
Yes, xinput works. This I tried first (reading from Gentoo, Archilinux, Xorg(5) manual), to understand the equvalences xinput <-> synaptics.
$ synclient -l
Parameter settings:
#Synaptics Edge Scrolling (287): 0, 0, 0
VertEdgeScroll = 0
HorizEdgeScroll = 0
CornerCoasting = 0
#Synaptics Two-Finger Scrolling (288): 1, 1
VertTwoFingerScroll = 1
HorizTwoFingerScroll = 0
tc@box:~$ xinput
â â³ PS/2+USB Mouse id=9 [slave pointer
â â³ SynPS/2 Synaptics TouchPad id=11 [slave pointer
tc@box:~$ xinput list-props 11
Device 'SynPS/2 Synaptics TouchPad':
Device Enabled (143): 1
Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Synaptics Edge Scrolling (309): 1, 1, 1
Synaptics Two-Finger Scrolling (310): 1, 1
What I try to achieve is an automatic Xorg configuration. This can be done by loading a small driver (xf86-input-synaptics) and its configuration, OR in /home/tc/X.d using a script about xinput + a list of parameters like above.
-
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
-
Remarks about firmware*.tcz: Even if I have listed first firmware*.tcz in onboot.lst, dmesg still shows warning messages about them. Because they are found a little later.
r8169 0000:02:00.0: Direct firmware load for rtl_nic/rtl8106e-1.fw failed with error -2
rtl8723be 0000:01:00.0: Direct firmware load for rtlwifi/rtl8723befw_36.bin failed with error -2
platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
rtl8723be 0000:01:00.0: Direct firmware load for rtlwifi/rtl8723befw_36.bin failed with error -2
Only remastering the core could suppress them.
Moreover, 3+ processes are running in the background, because firmware triggers like/sbin/udevd --daemon
are not stopped later.
-
That’s not for certain, the kernel first looks in the driver for the firmware and then checks elsewhere.
iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-7260-17.ucode failed with error -2
iwlwifi 0000:02:00.0: loaded firmware version 17.459231.0 op_mode iwlmvm
-
If you never use HDMI sound, you could try disabling it with the "radeon.audio=0" bootcode.
-
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?
-
Hi nick65go
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
Or you could call:
tce-load -i alsa
from bootsync.sh which runs after mydata.tgz is restored.
-
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).
-
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.
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
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 %%"
I do not know if crond (popping up every 5 minutes) will consume itself the battery.
-
It would be nice if flit.tcz has a nice battery alarm option, like I tried to simulate with crond daemon.Anyway, it works for me now. I had 3 times popup messages about battery 2% - 5%, so it seams that 5 minutes interval has good granularity for not missing the 2%-7% threshold.
Summary (until now) about automation of basic tasks accomplished:tc@box:~/.X.d$ ls -al
-rwxrwxr-- 1 tc staff 136 May 20 14:06 flit+alsa
-rwxrwxr-- 1 tc staff 512 May 20 14:54 myacpi
tc@box:~/.X.d$ cat flit\+alsa
[ -e /usr/local/tce.installed/alsa ] || tce-load -i -l alsa.tcz
[ -e /usr/local/tce.installed/flit ] || tce-load -i -l flit.tcz
flit &
tc@box:~/.X.d$ cat myacpi
# lower brightness, from default 255 to 32
echo 32 | sudo tee /sys/class/backlight/radeon_bl0/brightness &
#start acpid daemon for F2/3(brightness), F6/7/8(sound), and LID
sudo kill `pidof acpid`
sudo /usr/local/sbin/acpid &
#start crond daemon for battery low 2%
sudo kill `pidof crond`
sudo /usr/local/sbin/crond &
#stop orfans daemons (/sbin/udevd --daemon) for firmware
sudo kill `pidof udevd`
#stop wire-network if we use wifi
[ -e /var/run/udhcpc.eth0.pid ] && sudo kill `cat /var/run/udhcpc.eth0.pid`
So no more multiple/useless acpid, crond, udevd.
Next challenge is to tame the UEFI to boot automatically grub2, instead of the tedious F9 + select UEFI partition + the scrolling for a folder/grub.efi. (for 5-10 seconds faster boot?). Because default is win10 "hard-coded", so maybe to change some efi variables.
-
That is a risky operation on some machines. Changing those EFI vars, on a badly written UEFI BIOS, may cause the machine to become unbootable, and removing the bios battery won't fix it. Do search if your machine has such.
-
Hi nick65go
... 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 %%"
I do not know if crond (popping up every 5 minutes) will consume itself the battery.
Or you could just launch a script in the background that sleeps 99.9999% of the time and occasionally reads the remaining
battery capacity directly:
#!/bin/sh
# Short script to monitor remaining percent of battery power.
# Check /sys/class/power_supply to find how your battery is named.
#
# Usage:
# BatteryMonitor.sh BatteryName &
#
# Example:
# BatteryMonitor.sh BAT0 &
[ -z "$1" ] && exit
# The percentage that triggers a warning.
WarningLevel=5
# Number of minutes to sleep before checking capacity again.
SleepMinutes=5
PowerPath="/sys/class/power_supply"
BatteryName="$1"
Capacity="$PowerPath/$BatteryName/capacity"
SleepTime=$((60 * $SleepMinutes))
while true
do
sleep "$SleepTime"
RemainingCapacity="`cat $Capacity`"
[ "$RemainingCapacity" -gt "$WarningLevel" ] && continue
popup "Remaining battery capacity is $RemainingCapacity%%"
done
[EDIT]: The syntax for SleepTime= was corrected in the attachment and this post. See reply #35 and #36. Rich
-
@Rich: yes, work appreciated! I will try it. I will search for tricks, like /proc/acpi/ vs. /sys/class/power_supply.It was fun to learn for first time how cron works.
@curaga: you are right. It is a big risk, versus the gain, I am still reading about it. Maybe I will get for the fast and dirty solution, to repalce the Win10 bootloader (/EFI/Microsoft/Boot/bootmgrfw.efi, 1.46 MB) with my customized /EFI/1grub.64-gpt.efi (118.5 KB). Made a copy of the former MS bootloader, just to put it back in emergency.
But I suspect that in the background, when I will start Win10, it will silently replace back its bloated boot loader. MS had this bad habit in the past. OR just refuse to boot from grub chain loading.
PS: I do not know if I have a bug in the FLTK environment, it happened in the past also, with TinyCore other versions: During my writing, in editor, but mostly in firefox, my cursor JUMP from current position to random row/position. So if I do not pay attention, I just overwrite previous words. And then I see I wrote crazy phrases/words.
Also, strange things happen with my mouse. I copy an area in aterm with the mouse, by selecting. Sometimes also by right-click mouse after I already selected.
I do not know how to paste it with keyboard, so I just go to destination and just push the mouse middle button for paste.And here the paste is double of my clipboard content, second buffer in the middle of the first buffer.ex: abcde fff hhh -> ababcde fff hhhcde fff hhh
-
During my writing, in editor, but mostly in firefox, my cursor JUMP from current position to random row/position.
Hi, nick65go!
Probably it is the wrong supposition, but looks like accidential touches to the touchpad during typing. Is it possible? Usually, a person, who's typing text, is rather concentrated on the meaning of the process and only the other person can mark those accidential touches.
Some options for {Copy,Paste} for various environments are {Shift-Del,Shift-Ins} {Ctrl-Shift-C,Ctrl-Shift-V}
-
maybe possible accidental touch of pad, but i am 90% it is not. Maybe my mouse is a little warned/broken, because it happened with few tinycore versions also in the past; myabe i am wrong but i suspected background script for tinycore forum. Or is a memory leak in fltk -> most of the time it happens copy/paste between aterm and aterm.
Feed-back: testing between "aterm" and "editor"1. in editor selected a word "maria" , and copy it with ctrl+C. paste it in aterm with sfht+ins. OK. (ins=Fn+Prt_sc, crazy keyboard layout)2. in aterm select with the mouse a word "john", it means copy. It another aterm past it with sfht+ins. OK. But in editor, with Crtl+C, or sfht +ins -> will paste "maria". wow. not the same clipboard buffer.buffer
-
Feed-back: testing between "aterm" and "editor"
1. in editor selected a word "maria" with touchpad, and copy it with ctrl+C. paste it in aterm with sfht+ins. OK. (ins=Fn+Prt_sc, crazy keyboard layout)
2. in aterm select with the touchpad a word "john", it means copy. It another aterm past it with sfht+ins. OK. But in editor, with Crtl+V, or sfht +ins -> will paste "maria". wow. not the same clipboard buffer.
3. copy "versions" word from firefox with touchpad, paste it OK in aterm (with sfht+ins) and in editor (with both ctrl+V, or shf+ins). But touchpad selecting is OK only between terminals aterm and aterm. Touchpad select "john" from aterm will paste into both editor and firefox the "version"!!
-
maybe possible accidental touch of pad, but i am 90% it is not. Maybe my mouse is a little warned/broken
So You use both touchpad and mouse? I can propose the hack - disconnect touchpad ) i did so and have no jumping cursors anymore. But this is until You need to use laptop somewhere else. Maybe You can advice me how to block the touchpad using software? Of course it would be much more appropriate.
-
2. in aterm select with the touchpad a word "john", it means copy. It another aterm past it with sfht+ins. OK. But in editor, with Crtl+V, or sfht +ins -> will paste "maria". wow. not
Sorry, no. In aterm select with the touchpad AND Shift-Del means Copy.
-
Sorry, nick65go, I was wrong. This doesn't work between terminal and X editor. Only between terminals. This are different clipboards, and I don't know how to combine them together.
This works for fifth browser.
-
My touch-pad is very good (i think). but i do no know how to PASTE with only my synaptic, so I add an external mouse (2 buttons + 1 wheel).
What I discovered now is that clipboard buffer of aterm is NOT shared with others like fltk editor.In aterm shft+del is useless: just selecting with the touch-pad is enough (it auto copy the section).the shft+ins = PASTE in aterm.
Using the external mouse: double click will select (AND copy the selection), Wheel click (middle button) will paste it ANYWHERE (aterm, editor, firefox). This is why is need a mouse.
Disconnecting touch-pad could be with Xinput, like Juanito said previously. I do not think Xorg should be stop & start. I did not tried because I prefer to use/keep the touchpad.
-
Yes You're right again, Shift-Del is useless, both in aterm and in rxvt. Releasing mouse button is copying selected text.
Even more questions with fifth.
1. We can copy in terminal and paste into fifth.
2. We can copy in fifth and paste into terminal.
3. We can copy in Editor and paste into fifth
4. We CAN NOT copy in fifth and paste into Editor.
My guess, Curaga knows something intereting about this clipboards.
-
Thank You for advice about Xinput, but I am not able to use it under Xfbdev.
So seems that Shift-Ins works everywhere as Paste, and can replace middle mouse click.
-
@jazzbiker: Sorry to dissapoint you.
I love software on 32 bits. Smaller means less surface for attack versus bloat, so more secure etc.
But my laptop has UEFI_64 (not my choose, it came with win10) and 8 GB RAM, so I am tempted by software on 64 bits.
(yes, I get older and stupid, aka more lazy). Yes, I know, the gain in speed is minor (if ever) for my home work.
So no more (for the time beeing) Xvesa, Xfvdev, only in virtual machines. But I am tempted by firejail also.
All is about pristine/virgin trusted environment. No bloat/spy/useless-features. No unsolicited-updates.
I think I could live with just Firefox, vlc, libre-office, 7zip, in an emergency.
-
X has this weirdness that it has two clipboards, unlike Win and Mac. One for mouse selection and one for app's ctrl-c/other use. But apps use them however they wish.
-
Or you could just launch a script in the background that sleeps 99.9999% of the time and occasionally reads the remaining
battery capacity directly:
#!/bin/sh
# Short script to monitor remaining percent of battery power.
# Check /sys/class/power_supply to find how your battery is named.
#
# Usage:
# BatteryMonitor.sh BatteryName &
#
# Example:
# BatteryMonitor.sh BAT0 &
[ -z "$1" ] && exit
# The percentage that triggers a warning.
WarningLevel=5
# Number of minutes to sleep before checking capacity again.
SleepMinutes=5
PowerPath="/sys/class/power_supply"
BatteryName="$1"
Capacity="$PowerPath/$BatteryName/capacity"
SleepTime="60 * $SleepMinutes"
while true
do
sleep "$SleepTime"
RemainingCapacity="`cat $Capacity`"
[ "$RemainingCapacity" -gt "$WarningLevel" ] && continue
popup "Remaining battery capacity is $RemainingCapacity%%"
done
I think SleepTime="60 * $SleepMinutes" is not working, because " ", and multiplication not allowed, only sum/diffsleep: invalid number '60 * 5'
tc@box:~$ echo `expr 60 + 5`
65
tc@box:~$ echo `expr 60 * 5`
expr: syntax error
tc@box:~$ calc 60 + 5
65
tc@box:~$ calc 60 * 5
awk: cmd. line:1: Unexpected token
tc@box:~$ calc 60*5
300
so, it should beSleepTime=`calc 60*$SleepMinutes`
-
Hi nick65go
You caught me. I didn't test that part of the script. I set SleepTime directly equal to 5 because I wasn't going to wait 5 minutes.
However, you can do multiplication without using calc. I know, because I've seen roberts use it in the tc-config script. I just
checked his script and the correct syntax is:
SleepTime=$((60 * $SleepMinutes))
This shows up in the waitusb section of tc-config. He also uses the same syntax for division.
-
Thank you. Good catch. I tested , it works :)
-
Hi nick65go
The text and the attachment in reply #22 have been corrected. Thank you for bringing this issue to my attention. :)
-
This is just a remainder to myself. It is a good practice to first kill a daemon then start it again, if the daemon is in /home/tc/.X.d/*. Otherwise if I get out of Xorg (with Ctrl+Alt+Backspace), and then start it again (with starrtx), few pairs of zombie daemons processes can be seen with top.The BatteryMonitor.sh should be sent in the background (with &) otherwise nothing will run after it (it is a infinite loop).
my /home/tc/.X.d/myacpi.sh#!/bin/sh
# lower brightness, from default 255 to 32
echo 32 | sudo tee /sys/class/backlight/radeon_bl0/brightness &
#start acpid daemon for F2/3(brightness), F6/7/8(sound), and LID
sudo kill `pidof acpid`
echo 1
sudo /usr/local/sbin/acpid
echo 2
echo powersupersave | sudo tee /sys/module/pcie_aspm/parameters/policy
echo 3
#stop wire-network if we use wifi
[ -e /var/run/udhcpc.eth0.pid ] && sudo kill `cat /var/run/udhcpc.eth0.pid`
echo 4
#stop orfans daemons (/sbin/udevd --daemon) for firmware
sudo kill `pidof udevd`
echo 5
#start crond daemon for battery low 2%
#sudo kill `pidof crond`
#sudo /usr/local/sbin/crond &
sudo kill `pidof BatteryMonitor.sh` `pidof sleep`
/home/tc/.acpi/BatteryMonitor.sh BAT0 &
echo 6
-
Hi nick65go
Attached is a modified version of the script. It now also shows percent of charge remaining in a little display in the lower right
corner of the screen. The display gets updated every 5 minutes. The text is normally white. When remaining charge drops
to 20%, it turns yellow. When it drops to 10%, it turns red. When it drops to 5%, you get a popup just like before. There are
variables for setting the percentages at which the colors change. You can also change the XY coordinates of the display as
well as the font.
-
Hi Rich, Thank you!
Remarks regarding my acpid daemon, the default path for configuration events are:
in TC11_x64, /etc/acpi/events,
but in TC11_x86 they are in /usr/local/etc/acpi/events:
tc@box:~$ uname -a
Linux box 5.4.3-tinycore #2020 SMP Tue Dec 17 17:00:50 UTC 2019 i686 GNU/Linux
tc@box:~$ sudo acpid -d
Deprecated /proc/acpi/event was not found. Trying netlink and the input layer...input layer /dev/input/event0 opened successfully
input layer /dev/input/event1 opened successfully
input layer /dev/input/event2 opened successfully
input layer /dev/input/event3 opened successfully
input layer /dev/input/event6 opened successfully
input layer /dev/input/event7 opened successfully
inotify fd: 9
inotify wd: 1
netlink opened successfully
acpid: starting up with netlink and the input layer
parsing conf file /usr/local/etc/acpi/events/all
acpid: 1 rule loaded
acpid: waiting for events: event logging is off
^Cacpid: exiting
tc@box:~$
so, the command should be sudo acpid -c your/path/to/acpi/events/folder
-
@Rich: BatteryMonitorDisplay.sh works nice.
But using "top" is see 4 processes: aterm -geometry..; sh -..; cat /dev/..; slepp ..; and {BatteryMonitorD}..;
I propose to add few instructions to "sudo kill" two of them, so it will remain only sleep and aterm -geometry. Is it OK?
tc@box:~$ BatteryMonitorDisplay.sh BAT0 &
tc@box:~$
tc@box:~$ top
.. 7927 7926 tc S 3716 0.1 2 0.0 aterm -geometry 4x1+1860+1060 -fn 10x20 -bl -si -sb -sk -sl 0 -fade 100 -e sh -c MyTTY=`tty`; while true; do cat
7533 7532 tc S 3320 0.1 2 0.0 sh
7884 7883 tc S 3320 0.1 1 0.0 sh
2958 1 tc S 3316 0.1 3 0.0 -sh
1 0 root S 3248 0.1 0 0.0 /sbin/init
7926 7884 tc S 3248 0.1 0 0.0 {BatteryMonitorD} /bin/sh /home/tc/.local/bin/BatteryMonitorDisplay.sh BAT0
7934 7927 tc S 3248 0.1 1 0.0 sh -c MyTTY=`tty`; while true; do cat $MyTTY; done
7936 7934 tc S 3112 0.1 0 0.0 cat /dev/pts/2
7953 7926 tc S 3112 0.1 2 0.0 sleep 300
7705 1 root S 1792 0.0 2 0.0 /usr/local/sbin/acpid
6849 2 root SW< 0 0.0 1 0.0 [loop108]
-
Hi nick65go
... I propose to add few instructions to "sudo kill" two of them, so it will remain only sleep and aterm -geometry. Is it OK? ...
I'm not sure what you want to kill, but I think you'll break it if you try.
Take a look at what's really happening and see if you still think you can kill something.
When you open a terminal, here is what you get:
tc@ASUS:~$ pstree -p 12953
aterm(12953)---sh(12954)
tc@ASUS:~$
A terminal and a shell.
Now I launch BatteryMonitorDisplay.sh from that terminal into the background:
tc@ASUS:~$ BatteryMonitorDisplay.sh BATC &
tc@ASUS:~$ pstree -p 12953
aterm(12953)---sh(12954)---BatteryMonitorD(12973)-+-aterm(12974)---sh(12981)---cat(12983)
`-sleep(13015)
tc@ASUS:~$
BatteryMonitorDisplay.sh launches a terminal in the background that runs cat on its tty.
BatteryMonitorDisplay.sh sends the value of $RemainingCapacity to the terminals tty.
BatteryMonitorDisplay.sh executes a 5 minute sleep command. The script will do nothing for 5 minutes.
As long as nothing is being sent to the terminals tty , it will block cat from executing. The cat command sleeps until data is available.
When sleep times out and exits, BatteryMonitorDisplay.sh is allowed to run.
BatteryMonitorDisplay.sh sends the value of $RemainingCapacity to the terminals tty.
Then sleep 5 minutes, send $RemainingCapacity, sleep 5 minutes, send $RemainingCapacity ........
Now I close the original terminal that I started with and we are left with this:
tc@ASUS:~$ pstree -p 12973
BatteryMonitorD(12973)-+-aterm(12974)---sh(12981)---cat(12983)
`-sleep(13015)
tc@ASUS:~$
With the original terminal gone, BatteryMonitorDisplay.sh now belongs to init , also known as PID #1.