V2-202509
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
Package: ktouch
|
||||
Version: 2.0
|
||||
Architecture: arm64
|
||||
Maintainer: Kushidou <kushidou@small09.top>
|
||||
Depends: xinput, python3
|
||||
Section: x11
|
||||
Priority: optional
|
||||
Description: 设置触摸屏仅需简单的点击屏幕.
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
#!/bin/sh
|
||||
|
||||
BUILDDATE="2025年 09月 25日"
|
||||
KTVERSION="2.0"
|
||||
MYDIR=/opt/ktouch
|
||||
APPDIR=$MYDIR/desktops
|
||||
# AUTODIR=/etc/xdg/autostart
|
||||
MENUDIR=/usr/share/applications
|
||||
BINDIR=/usr/bin
|
||||
log_path=${MYDIR}
|
||||
inslog_path=${MYDIR}/install.log
|
||||
|
||||
LOGINUSER=$(whoami)
|
||||
NUSER=${SUDO_USER}
|
||||
|
||||
|
||||
|
||||
set_autostart()
|
||||
{
|
||||
SUSER=$NUSER
|
||||
if [ "$NUSER" = "" ];then
|
||||
echo "注意!用户是空,应该使用sudo dpkg 来安装。"
|
||||
echo "用户名为[$SUSER], 免root操作触摸屏和开机自启动都不能正常工作。" >> $log_path
|
||||
SUSER="1000"
|
||||
fi
|
||||
|
||||
|
||||
# 生成服务文件内容
|
||||
SERVICE_CONTENT="[Unit]
|
||||
Description=Kushidou Touchscreen Remap Daemon
|
||||
After=display-manager.service
|
||||
Requires=display-manager.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=$SUSER
|
||||
Group=$SUSER
|
||||
Environment=DISPLAY=:0
|
||||
#Environment=XAUTHORITY=/home/$NUSER/.Xauthority
|
||||
ExecStart=/usr/bin/python3 /opt/ktouch/kscreen-remap-daemon
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
StartLimitInterval=0
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target"
|
||||
|
||||
# 写入服务文件
|
||||
SERVICE_FILE="/etc/systemd/system/ktouch_daemon.service"
|
||||
echo "$SERVICE_CONTENT" > "$SERVICE_FILE" || {
|
||||
echo "写入服务文件失败: $SERVICE_FILE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 重新加载systemd配置
|
||||
systemctl daemon-reload || {
|
||||
echo "重新加载systemd配置失败。"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 启用服务自启动
|
||||
systemctl enable ktouch_daemon.service || {
|
||||
echo "启用服务自启动失败。"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 开启服务
|
||||
systemctl start ktouch_daemon.service || {
|
||||
echo "启用服务失败。"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "服务已成功配置并启动。"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
echo "==========INSTALL===========" >> ${APPDIR}/install.log
|
||||
|
||||
echo "=>即将安装触摸屏设置软件ktouch v2">> ${inslog_path}
|
||||
echo "build date: $BUILDDATE" >> ${inslog_path}
|
||||
echo "ver: $KTVERSION" >> ${inslog_path}
|
||||
echo "install: $(date)" >> ${inslog_path}
|
||||
# start menu
|
||||
install -p -m 0755 -o root -g root ${APPDIR}/touchscreen-config.desktop ${MENUDIR}
|
||||
install -p -m 0755 -o root -g root ${APPDIR}/touchscreen-now.desktop ${MENUDIR}
|
||||
|
||||
install -p -m 0755 -o root -g root ${APPDIR}/touchscreen-auto.desktop /etc/xdg/autostart
|
||||
|
||||
|
||||
#ICOS
|
||||
cp ${APPDIR}/*.png /usr/share/pixmaps/
|
||||
|
||||
#USR/BIN
|
||||
if [ -f ${BINDIR}/kscreen-remap ];then
|
||||
rm -f ${BINDIR}/kscreen-remap
|
||||
fi
|
||||
if [ -f ${BINDIR}/kscreen-remap ];then
|
||||
rm -f ${BINDIR}/kscreen-kscreen-remap-daemon
|
||||
fi
|
||||
if [ -f ${BINDIR}/kscreen-remap ];then
|
||||
rm -f ${BINDIR}/kscreen-setup
|
||||
fi
|
||||
if [ -f ${BINDIR}/kscreen-remap ];then
|
||||
rm -f ${BINDIR}/kscreen-log
|
||||
fi
|
||||
|
||||
ln -s /opt/ktouch/kscreen-remap /usr/bin/kscreen-remap
|
||||
ln -s /opt/ktouch/kscreen-remap-daemon /usr/bin/kscreen-remap-daemon
|
||||
ln -s /opt/ktouch/kscreen-setup /usr/bin/kscreen-setup
|
||||
ln -s /opt/ktouch/kscreen-log /usr/bin/kscreen-log
|
||||
ln -s /opt/ktouch/kscreen-debug /usr/bin/kscreen-debug
|
||||
ln -s /opt/ktouch/kdisplay /usr/bin/kdisplay
|
||||
|
||||
chmod 0777 /opt/ktouch/* -R
|
||||
|
||||
# 将用户加入input组
|
||||
usermod -a -G input $NUSER
|
||||
usermod -a -G dialout $NUSER
|
||||
|
||||
# 设置自启动
|
||||
set_autostart
|
||||
|
||||
# 禁用UOS自动触摸屏弹窗
|
||||
if [ -f /usr/lib/deepin-daemon/dde-touchscreen-dialog ];then
|
||||
mv /usr/lib/deepin-daemon/dde-touchscreen-dialog /usr/lib/deepin-daemon/dde-touchscreen-dialog.disable
|
||||
fi
|
||||
|
||||
# 禁用麒麟V10触摸设置工具
|
||||
if [ -d /var/screen ];then
|
||||
mv /var/screen /var/screen.disable
|
||||
fi
|
||||
|
||||
echo "安装已经完成。如果是首次安装,请重启电脑,否则无法打开触摸屏设备"
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
APPDIR=/opt/ktouch/desktops
|
||||
AUTODIR=/etc/xdg/autostart
|
||||
MENUDIR=/usr/share/applications
|
||||
|
||||
inslog_path="/opt/ktouch/install.log"
|
||||
|
||||
BUILDDATE="2025年 09月 25日"
|
||||
KTVERSION="2.0"
|
||||
|
||||
|
||||
echo "==========REMOVE===========" >> ${APPDIR}/install.log
|
||||
|
||||
echo "=>即将移除ktouch v2">> ${inslog_path}
|
||||
echo "build date: $BUILDDATE" >> ${inslog_path}
|
||||
echo "ver: $KTVERSION" >> ${inslog_path}
|
||||
echo "remove_date: $(date)" >> ${inslog_path}
|
||||
|
||||
|
||||
|
||||
# desktop
|
||||
for USERNAME in $(cat /etc/passwd | awk -F: '$3>=500' | cut -d : -f 1)
|
||||
do
|
||||
[ -f /home/$USERNAME/Desktop/touchscreen-config.desktop ] && rm -f /home/$USERNAME/Desktop/touchscreen-config.desktop
|
||||
[ -f /home/$USERNAME/Desktop/touchscreen-now.desktop ] && rm -f /home/$USERNAME/Desktop/touchscreen-now.desktop
|
||||
[ -f /home/$USERNAME/桌面/touchscreen-config.desktop ] && rm -f /home/$USERNAME/桌面/touchscreen-config.desktop
|
||||
[ -f /home/$USERNAME/桌面/touchscreen-now.desktop ] && rm -f /home/$USERNAME/桌面/touchscreen-now.desktop
|
||||
|
||||
done
|
||||
|
||||
# start menu
|
||||
rm $MENUDIR/touchscreen-config.desktop >/dev/null 2>&1
|
||||
rm $MENUDIR/touchscreen-now.desktop >/dev/null 2>&1
|
||||
|
||||
|
||||
# autostart
|
||||
rm /etc/xdg/autostart/touchscreen-auto.desktop >/dev/null 2>&1
|
||||
systemctl stop ktouch_daemon
|
||||
systemctl disable ktouch_daemon
|
||||
rm /etc/systemd/system/ktouch_daemon.service -f >/dev/null 2>&1
|
||||
systemctl daemon-reload
|
||||
|
||||
#ICOS
|
||||
rm /usr/share/pixmaps/screen-config.png >/dev/null 2>&1
|
||||
rm /usr/share/pixmaps/screen-remap.png >/dev/null 2>&1
|
||||
|
||||
#USR/BIN
|
||||
rm -f /usr/bin/kscreen-remap >/dev/null 2>&1
|
||||
rm -f /usr/bin/kscreen-setup >/dev/null 2>&1
|
||||
rm -f /usr/bin/kscreen-log > dev/null 2>&1
|
||||
rm -f /usr/bin/kscreen-debug > dev/null 2>&1
|
||||
rm -f /usr/bin/kscreen-remap-daemon > dev/null 2>&1
|
||||
rm -f /usr/bin/kdisplay > dev/null 2>&1
|
||||
|
||||
# 解除禁用UOS自动触摸屏弹窗
|
||||
if [ -f /usr/lib/deepin-daemon/dde-touchscreen-dialog.disable ];then
|
||||
mv /usr/lib/deepin-daemon/dde-touchscreen-dialog.disable /usr/lib/deepin-daemon/dde-touchscreen-dialog
|
||||
fi
|
||||
|
||||
# 清空UOS的触摸屏设置信息
|
||||
if [ -f /usr/bin/gsettings ];then
|
||||
gsettings set com.deepin.dde.display map-output '' > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
# 解除禁用麒麟V10触摸设置工具
|
||||
if [ -d /var/screen.disable ];then
|
||||
mv /var/screen.disable /var/screen
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 2024.05.28 决定将kushidoutouch全部切换到ktouch,这个脚本用于切换。
|
||||
# 2025.09.09 ktouch V2基本开发完成,不再需要原来的目录
|
||||
|
||||
KTVERSION="2.0"
|
||||
MYDIR=/opt/ktouch
|
||||
APPDIR=$MYDIR/desktops
|
||||
AUTODIR=/etc/xdg/autostart
|
||||
MENUDIR=/usr/share/applications
|
||||
BINDIR=/usr/bin
|
||||
log_path="/var/log/ktouch/touchscreen.log"
|
||||
inslog_path="/var/log/ktouch/install.log"
|
||||
|
||||
|
||||
# start menu
|
||||
if [ -f ${MENUDIR}/touchscreen-config.desktop ];then
|
||||
rm -f ${MENUDIR}/touchscreen-config.desktop >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ -f ${MENUDIR}/touchscreen-now.desktop ];then
|
||||
rm -f ${MENUDIR}/touchscreen-now.desktop >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# desktop
|
||||
for USERNAME in $(cat /etc/passwd | awk -F: '$3>=500' | cut -d : -f 1)
|
||||
do
|
||||
if [ -d "/home/${USERNAME}/Desktop" ];then
|
||||
if [ -f /home/${USERNAME}/Desktop/touchscreen-config.desktop ];then
|
||||
rm -f /home/${USERNAME}/Desktop/touchscreen-config.desktop
|
||||
fi
|
||||
if [ -f /home/${USERNAME}/Desktop/touchscreen-now.desktop ];then
|
||||
rm -f /home/${USERNAME}/Desktop/touchscreen-now.desktop
|
||||
fi
|
||||
|
||||
fi
|
||||
if [ -d "/home/${USERNAME}/桌面" ];then
|
||||
if [ -f /home/${USERNAME}/桌面/touchscreen-config.desktop ];then
|
||||
rm -f /home/${USERNAME}/桌面/touchscreen-config.desktop
|
||||
fi
|
||||
if [ -f /home/${USERNAME}/桌面/touchscreen-now.desktop ];then
|
||||
rm -f /home/${USERNAME}/桌面/touchscreen-now.desktop
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# autostart
|
||||
rm $AUTODIR/touchscreen-autoremap.desktop >/dev/null 2>&1
|
||||
rm $AUTODIR/touchscreen-powerup.desktop >/dev/null 2>&1
|
||||
|
||||
#USR/BIN
|
||||
rm -f /usr/bin/kscreen-remap >/dev/null 2>&1
|
||||
rm -f /usr/bin/kscreen-setup >/dev/null 2>&1
|
||||
rm -f /usr/bin/kscreen-log > dev/null 2>&1
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
inslog_path="/var/log/ktouch/install.log"
|
||||
|
||||
systemctl stop ktouch_daemon.service
|
||||
systemctl disable ktouch_daemon.service
|
||||
Reference in New Issue
Block a user