File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -15,4 +15,37 @@ if [ -x $display_daemon ]; then
1515fi
1616
1717
18+ # 在满足条件下,设置tapToClick=true
19+ # 解析dbus信息输出
20+ dbus_values_get_strings (){
21+ local input=" $1 "
22+ echo " $input " | grep -oP ' string \K".*?"' | tr -d ' "'
23+ }
24+ dbus_values_get_bool (){
25+ local input=" $1 "
26+ echo " $input " | grep -oP ' boolean \Ktrue|false' | awk ' {print $1}'
27+ }
28+
29+ # 判断并设置设备属性
30+ device_handle (){
31+ local input=" $1 "
32+ local dbus_touchpad=$( dbus-send --session --print-reply --dest=org.kde.KWin $input org.freedesktop.DBus.Properties.Get string:" org.kde.KWin.InputDevice" string:" touchpad" )
33+ local touchpad=$( dbus_values_get_bool " $dbus_touchpad " )
34+
35+ if [ " $touchpad " = " true" ]; then
36+ dbus-send --session --dest=org.kde.KWin " $input " org.freedesktop.DBus.Properties.Set string:" org.kde.KWin.InputDevice" string:" tapToClick" variant:boolean:true
37+ fi
38+ }
39+
40+ # 获取设备列表
41+ dbus_devices=$( dbus-send --session --print-reply --dest=org.kde.KWin /org/kde/KWin/InputDevice org.freedesktop.DBus.Properties.Get string:" org.kde.KWin.InputDeviceManager" string:" devicesSysNames" )
42+ devices_strings=$( dbus_values_get_strings " $dbus_devices " )
43+
44+ # 遍历设备列表
45+ device_path=" /org/kde/KWin/InputDevice/"
46+ for dev in $devices_strings ; do
47+ path=" ${device_path}${dev} "
48+ device_handle " $path "
49+ done
50+
1851/usr/share/dde-session-shell/greeters.d/launch-binary
You can’t perform that action at this time.
0 commit comments