It may turn out it’s actually people that do.
I must amend my above statement: Everything can have its use cases, and there can be good arguments for and against it.
It may turn out it’s actually people that do.
I must amend my above statement: Everything can have its use cases, and there can be good arguments for and against it.
That philosophy is from the very beginning of unix and was only meant for simple system tasks, like “list all files in a directory”, “copy a file from A to B”, etc.
That philosophy was never meant to be applied to complex apps.
We could also argue about that (I won’t, now).
Even the most complex systems (and apps) are made of “building blocks”. Which, in turn, rely on smaller building blocks, and so on.
Further investigation shows that this thing actually has a sensor that triggers when the hinges are open 190° or more. Unfortunately, all evdev and apci debugging didn’t make that come up on Linux (works on Win11).
So I came up with a manual solution: Toggling between notebook and tablet mode is now done using a kbd
script which you can put on the desktop (double-click/tap) or in the panel(single-click/tap). It will disable/enable the keyboard and touchpad and show a notification to the effect. Can also be used in Autostart (using kbd enable
), just in case you forgot to re-enable keyboard/touchpad before shutting down.
Usermust be in input
group to run this without sudo:
usermod -aG input $USER
#!/bin/bash
# kbd
# ~~~
#
# Disable or enable the keyboard for use in tablet or laptop mode.
#
# This script can either toggle or specifically enable or disable the keyboard,
# depending upon the arguments supplied.
# For example:
# kbd enable
# will enable the keyboard after it has been disabled.
#
# kbd disable
# will disable the keyboard to ensure no erroneous key strokes while the labtop
# is in tablet mode.
# Or
# kbd
# will toggle the keyboard status between enabled and disabled.
#
# This script was written by Pluto, May 2024, for the
# Lenovo Yoga 7 2 in 1 laptop
# 2025-05-18 Moonbase59 Made more pretty, adapt for Medion Akoya E2228T
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# These parameters need to be reviewed upon the installation of this script
# on a new system.
#
# Use "xinput list" to identify which device names are relevant.
# define me
me=$(basename "$0")
slavekbd="Hantick USB Keyboard"
slavetpd="Hantick USB Keyboard Touchpad"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
action=$1
n_args=$#
# determine the devise status
kbd_enabled=$(xinput list-props "$slavekbd" | grep "Device Enabled" | sed -n '${s/.*\t//; p}')
tpd_enabled=$(xinput list-props "$slavetpd" | grep "Device Enabled" | sed -n '${s/.*\t//; p}')
EnableKeyboard()
{
SUMMARY="Notebook Mode"
BODY="Keyboard and Touchpad are now enabled."
xinput --enable "$slavekbd"
xinput --enable "$slavetpd"
notify-send -t 5000 "$SUMMARY" "$BODY"
}
DisableKeyboard()
{
SUMMARY="Tablet Mode"
BODY="Keyboard and Touchpad are now disabled."
xinput --disable "$slavekbd"
xinput --disable "$slavetpd"
notify-send -t 5000 "$SUMMARY" "$BODY"
}
ToggleKeyboard()
{
# if either device is disabled, enable both, or vice-versa.
if [ $kbd_enabled == 0 ] || [ $tpd_enabled == 0 ]
then
EnableKeyboard
else
DisableKeyboard
fi
}
ReportStatus()
{
echo -n "$slavekbd "
if [ $kbd_enabled == 1 ]; then
echo "enabled"
else
echo "disabled"
fi
echo -n "$slavetpd "
if [ $tpd_enabled == 1 ]; then
echo "enabled"
else
echo "disabled"
fi
}
Usage() {
cat <<EOF
Usage: ${me} [enable|disable|status]
$me is meant for notebooks that have a tablet mode and run a X11 DE.
It can enable and disable your keyboard and touchpad, in case your
notebook cannot do that automatically.
Options:
(none) Toggle keyboard and touchpad.
enable Enable keyboard and touchpad.
disable Disable keyboard and touchpad.
status Show current status.
EOF
}
# First test for an argument, before determining which action should be performed.
if [ $n_args -gt 0 ]
then
case $action in
enable)
EnableKeyboard ;;
disable)
DisableKeyboard ;;
status)
ReportStatus ;;
*)
Usage ;;
esac
else
ToggleKeyboard
fi
Just in case someone can make use of it. One never knows…
As is, this works on Medion Akoya E2228T models (mine is a MD61900), but can easily be adapted—just change the two relevant device names.
I know this will be considered heresy by some, including OP, but Flatpaks work better than some AUR packages and I can name two right off the top of my head where the AUR app failed me (twice) and the flatpak did not.
that said I would not endorse a bunch of flatpaks nor do I ever want to see Linux go the immutable route…but there is nothing wrong with depending on 2-3 in a pinch, and I do see them as an asset in the linux architecture.
2 cents