mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-09-11 22:02:23 +08:00
初步修复2.3.0在exagear资源的解包问题
This commit is contained in:
parent
6d7cfc87bd
commit
e6a9d1feb1
2
Makefile
2
Makefile
@ -64,7 +64,7 @@ build:
|
||||
cp -rv InstallDll.py deb/opt/apps/deepin-wine-runner
|
||||
cp -rv Model deb/opt/apps/deepin-wine-runner
|
||||
cp -rv API deb/opt/apps/deepin-wine-runner
|
||||
cp -rv key
|
||||
cp -rv key deb/opt/apps/deepin-wine-runner
|
||||
dpkg -b deb spark-deepin-wine-runner.deb
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
Package: spark-deepin-wine-runner
|
||||
Version: 2.4.0
|
||||
Version: 2.4.0~alpha1
|
||||
Maintainer: gfdgd xi <3025613752@qq.com>, 为什么您不喜欢熊出没和阿布呢
|
||||
Homepage: https://gitee.com/gfdgd-xi/deep-wine-runner, https://github.com/gfdgd-xi/deep-wine-runner, https://gitlink.org.cn/gfdgd_xi/deep-wine-runner
|
||||
Architecture: all
|
||||
|
@ -3,7 +3,7 @@
|
||||
#################################################################################################################
|
||||
# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
# 版本:2.3.0
|
||||
# 更新时间:2022年10月02日
|
||||
# 更新时间:2022年10月15日
|
||||
# 感谢:感谢 wine、deepin-wine 以及星火团队,提供了 wine、deepin-wine、spark-wine-devel 给大家使用,让我能做这个程序
|
||||
# 基于 Python3 的 PyQt5 构建
|
||||
#################################################################################################################
|
||||
@ -716,6 +716,18 @@ def SetDeepinFileDialogDeepin():
|
||||
return
|
||||
QtWidgets.QMessageBox.information(widget, "提示", "设置完成!")
|
||||
|
||||
def AddReg():
|
||||
path = QtWidgets.QFileDialog.getOpenFileName(window, "保存路径", get_home(), "reg文件(*.reg);;所有文件(*.*)")
|
||||
if path[0] == "" and not path[1]:
|
||||
return
|
||||
RunWineProgram(f"regedit' /S '{path[0]}' 'HKEY_CURRENT_USER\Software\Wine\DllOverrides")
|
||||
|
||||
def SaveDllList():
|
||||
path = QtWidgets.QFileDialog.getSaveFileName(window, "保存路径", get_home(), "reg文件(*.reg);;所有文件(*.*)")
|
||||
if path[0] == "" and not path[1]:
|
||||
return
|
||||
RunWineProgram(f"regedit' /E '{path[0]}' 'HKEY_CURRENT_USER\Software\Wine\DllOverrides")
|
||||
|
||||
def SetDeepinFileDialogDefult():
|
||||
code = os.system(f"pkexec \"{programPath}/deepin-wine-venturi-setter.py\" defult")
|
||||
if code != 0:
|
||||
@ -2170,6 +2182,13 @@ enabledHttpProxy = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "设
|
||||
disbledHttpProxy = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "禁用指定 wine 容器的代理"))
|
||||
settingHttpProxy.addAction(enabledHttpProxy)
|
||||
settingHttpProxy.addAction(disbledHttpProxy)
|
||||
dllOver = wineOption.addMenu(QtCore.QCoreApplication.translate("U", "函数顶替库列表"))
|
||||
saveDllOver = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "导出函数顶替列表"))
|
||||
addDllOver = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "导入函数顶替列表"))
|
||||
editDllOver = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "编辑函数顶替库列表"))
|
||||
dllOver.addAction(saveDllOver)
|
||||
dllOver.addAction(addDllOver)
|
||||
dllOver.addAction(editDllOver)
|
||||
w1.triggered.connect(OpenWineBotton)
|
||||
w2.triggered.connect(InstallWineFont)
|
||||
w3.triggered.connect(OpenWineFontPath)
|
||||
@ -2192,7 +2211,7 @@ wm1_5.triggered.connect(lambda: threading.Thread(target=InstallMonoGecko, args=[
|
||||
wm1_7.triggered.connect(lambda: threading.Thread(target=InstallVB).start())
|
||||
wm1_6.triggered.connect(lambda: threading.Thread(target=InstallOther).start())
|
||||
wm2_1.triggered.connect(lambda: RunWineProgram("control"))
|
||||
wm2_2.triggered.connect(lambda: RunWineProgram("iexplore' 'https://www.deepin.org"))
|
||||
wm2_2.triggered.connect(lambda: RunWineProgram("iexplore' 'https://gfdgd-xi.github.io"))
|
||||
wm2_3.triggered.connect(lambda: RunWineProgram("regedit"))
|
||||
wm2_4.triggered.connect(lambda: RunWineProgram("taskmgr"))
|
||||
wm2_5.triggered.connect(lambda: RunWineProgram("explorer"))
|
||||
@ -2210,6 +2229,9 @@ disbledWineCrashDialog.triggered.connect(lambda: RunWineProgram("reg' add 'HKEY_
|
||||
enabledWineCrashDialog.triggered.connect(lambda: RunWineProgram("reg' add 'HKEY_CURRENT_USER\Software\Wine\WineDbg' /v ShowCrashDialog /t REG_DWORD /d 00000001 '/f"))
|
||||
enabledHttpProxy.triggered.connect(SetHttpProxy)
|
||||
disbledHttpProxy.triggered.connect(DisbledHttpProxy)
|
||||
saveDllOver.triggered.connect(SaveDllList)
|
||||
addDllOver.triggered.connect(AddReg)
|
||||
editDllOver.triggered.connect(lambda: RunWineProgram("winecfg"))
|
||||
|
||||
virtualMachine = menu.addMenu(QtCore.QCoreApplication.translate("U", "虚拟机(&V)"))
|
||||
v1 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "使用 Virtualbox 虚拟机运行 Windows 应用"))
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
{
|
||||
"Version": "2.3.0",
|
||||
"Version": "2.4.0~alpha1",
|
||||
"Thank": [
|
||||
"感谢 @a2035274 @虚幻的早晨 https://bbs.deepin.org/post/238301",
|
||||
"感谢 @zhangs https://bbs.deepin.org/post/227948",
|
||||
|
76
deb/opt/apps/deepin-wine-runner/key/UI/AutoConfig.py
Executable file
76
deb/opt/apps/deepin-wine-runner/key/UI/AutoConfig.py
Executable file
@ -0,0 +1,76 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'AutoConfig.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(800, 600)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.searchTips = QtWidgets.QLabel(self.centralwidget)
|
||||
self.searchTips.setObjectName("searchTips")
|
||||
self.horizontalLayout.addWidget(self.searchTips)
|
||||
self.searchThings = QtWidgets.QLineEdit(self.centralwidget)
|
||||
self.searchThings.setObjectName("searchThings")
|
||||
self.horizontalLayout.addWidget(self.searchThings)
|
||||
self.saerchBotton = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.saerchBotton.setObjectName("saerchBotton")
|
||||
self.horizontalLayout.addWidget(self.saerchBotton)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout)
|
||||
self.searchList = QtWidgets.QListView(self.centralwidget)
|
||||
self.searchList.setObjectName("searchList")
|
||||
self.verticalLayout_3.addWidget(self.searchList)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem)
|
||||
self.runBotton = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.runBotton.setObjectName("runBotton")
|
||||
self.horizontalLayout_2.addWidget(self.runBotton)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 36))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menu = QtWidgets.QMenu(self.menubar)
|
||||
self.menu.setObjectName("menu")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.about = QtWidgets.QAction(MainWindow)
|
||||
self.about.setObjectName("about")
|
||||
self.exitProgram = QtWidgets.QAction(MainWindow)
|
||||
self.exitProgram.setObjectName("exitProgram")
|
||||
self.help = QtWidgets.QAction(MainWindow)
|
||||
self.help.setObjectName("help")
|
||||
self.openFile = QtWidgets.QAction(MainWindow)
|
||||
self.openFile.setObjectName("openFile")
|
||||
self.menu.addAction(self.openFile)
|
||||
self.menu.addSeparator()
|
||||
self.menu.addAction(self.exitProgram)
|
||||
self.menubar.addAction(self.menu.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "自动部署脚本"))
|
||||
self.searchTips.setText(_translate("MainWindow", "搜索内容(为空代表显示所有内容):"))
|
||||
self.saerchBotton.setText(_translate("MainWindow", "搜索"))
|
||||
self.runBotton.setText(_translate("MainWindow", "部署此方案"))
|
||||
self.menu.setTitle(_translate("MainWindow", "程序"))
|
||||
self.about.setText(_translate("MainWindow", "关于"))
|
||||
self.exitProgram.setText(_translate("MainWindow", "退出程序"))
|
||||
self.help.setText(_translate("MainWindow", "帮助"))
|
||||
self.openFile.setText(_translate("MainWindow", "打开本地部署脚本"))
|
||||
|
110
deb/opt/apps/deepin-wine-runner/key/UI/AutoConfig.ui
Executable file
110
deb/opt/apps/deepin-wine-runner/key/UI/AutoConfig.ui
Executable file
@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>自动部署脚本</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="searchTips">
|
||||
<property name="text">
|
||||
<string>搜索内容(为空代表显示所有内容):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="searchThings"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="saerchBotton">
|
||||
<property name="text">
|
||||
<string>搜索</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="searchList"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="runBotton">
|
||||
<property name="text">
|
||||
<string>部署此方案</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>36</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu">
|
||||
<property name="title">
|
||||
<string>程序</string>
|
||||
</property>
|
||||
<addaction name="openFile"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="exitProgram"/>
|
||||
</widget>
|
||||
<addaction name="menu"/>
|
||||
</widget>
|
||||
<action name="about">
|
||||
<property name="text">
|
||||
<string>关于</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="exitProgram">
|
||||
<property name="text">
|
||||
<string>退出程序</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="help">
|
||||
<property name="text">
|
||||
<string>帮助</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="openFile">
|
||||
<property name="text">
|
||||
<string>打开本地部署脚本</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
85
deb/opt/apps/deepin-wine-runner/key/UI/KeyAddGui.py
Executable file
85
deb/opt/apps/deepin-wine-runner/key/UI/KeyAddGui.py
Executable file
@ -0,0 +1,85 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'KeyAddGui.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(692, 314)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tips = QtWidgets.QLabel(self.centralwidget)
|
||||
self.tips.setObjectName("tips")
|
||||
self.verticalLayout.addWidget(self.tips)
|
||||
self.keyBoardList = QtWidgets.QListView(self.centralwidget)
|
||||
self.keyBoardList.setObjectName("keyBoardList")
|
||||
self.verticalLayout.addWidget(self.keyBoardList)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.addButton = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.addButton.setObjectName("addButton")
|
||||
self.horizontalLayout.addWidget(self.addButton)
|
||||
self.editButton = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.editButton.setObjectName("editButton")
|
||||
self.horizontalLayout.addWidget(self.editButton)
|
||||
self.saveButton = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.saveButton.setObjectName("saveButton")
|
||||
self.horizontalLayout.addWidget(self.saveButton)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menuBar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menuBar.setGeometry(QtCore.QRect(0, 0, 692, 33))
|
||||
self.menuBar.setObjectName("menuBar")
|
||||
self.menu = QtWidgets.QMenu(self.menuBar)
|
||||
self.menu.setObjectName("menu")
|
||||
MainWindow.setMenuBar(self.menuBar)
|
||||
self.action = QtWidgets.QAction(MainWindow)
|
||||
self.action.setObjectName("action")
|
||||
self.serverTips = QtWidgets.QAction(MainWindow)
|
||||
self.serverTips.setEnabled(False)
|
||||
self.serverTips.setObjectName("serverTips")
|
||||
self.startServer = QtWidgets.QAction(MainWindow)
|
||||
self.startServer.setObjectName("startServer")
|
||||
self.stopServer = QtWidgets.QAction(MainWindow)
|
||||
self.stopServer.setObjectName("stopServer")
|
||||
self.setAutoStart = QtWidgets.QAction(MainWindow)
|
||||
self.setAutoStart.setObjectName("setAutoStart")
|
||||
self.setUnautoStart = QtWidgets.QAction(MainWindow)
|
||||
self.setUnautoStart.setObjectName("setUnautoStart")
|
||||
self.menu.addAction(self.serverTips)
|
||||
self.menu.addSeparator()
|
||||
self.menu.addAction(self.startServer)
|
||||
self.menu.addAction(self.stopServer)
|
||||
self.menu.addSeparator()
|
||||
self.menu.addAction(self.setAutoStart)
|
||||
self.menu.addAction(self.setUnautoStart)
|
||||
self.menuBar.addAction(self.menu.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "编辑快捷键"))
|
||||
self.tips.setText(_translate("MainWindow", "<html><head/><body><p>此工具可以用于设置快捷键到 Wine 容器的映射,以便 Wine 程序可以正常的使用快捷键<br/>Deepin/UOS将会使用默认的快捷键服务,其它发行版将使用此运行器提供的快捷键服务<br>Deepin/UOS将只会提供快捷键添加功能,请在控制中心进行快捷键的修改管理</p></body></html>"))
|
||||
self.addButton.setText(_translate("MainWindow", "添加"))
|
||||
self.editButton.setText(_translate("MainWindow", "编辑"))
|
||||
self.saveButton.setText(_translate("MainWindow", "保存"))
|
||||
self.menu.setTitle(_translate("MainWindow", "设置快捷键服务"))
|
||||
self.action.setText(_translate("MainWindow", "关于"))
|
||||
self.serverTips.setText(_translate("MainWindow", "此内容只支持非Deepin/UOS发行版"))
|
||||
self.startServer.setText(_translate("MainWindow", "启动服务"))
|
||||
self.stopServer.setText(_translate("MainWindow", "停止服务"))
|
||||
self.setAutoStart.setText(_translate("MainWindow", "设置开机自启"))
|
||||
self.setUnautoStart.setText(_translate("MainWindow", "关闭开机自启动"))
|
||||
|
127
deb/opt/apps/deepin-wine-runner/key/UI/KeyAddGui.ui
Executable file
127
deb/opt/apps/deepin-wine-runner/key/UI/KeyAddGui.ui
Executable file
@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>692</width>
|
||||
<height>314</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>编辑快捷键</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="tips">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>此工具可以用于设置快捷键到 Wine 容器的映射,以便 Wine 程序可以正常的使用快捷键<br/>Deepin/UOS将会使用默认的快捷键服务,其它发行版将使用此运行器提供的快捷键服务<br>Deepin/UOS将只会提供快捷键添加功能,请在控制中心进行快捷键的修改管理</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="keyBoardList"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addButton">
|
||||
<property name="text">
|
||||
<string>添加</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="editButton">
|
||||
<property name="text">
|
||||
<string>编辑</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="saveButton">
|
||||
<property name="text">
|
||||
<string>保存</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>692</width>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu">
|
||||
<property name="title">
|
||||
<string>设置快捷键服务</string>
|
||||
</property>
|
||||
<addaction name="serverTips"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="startServer"/>
|
||||
<addaction name="stopServer"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="setAutoStart"/>
|
||||
<addaction name="setUnautoStart"/>
|
||||
</widget>
|
||||
<addaction name="menu"/>
|
||||
</widget>
|
||||
<action name="action">
|
||||
<property name="text">
|
||||
<string>关于</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="serverTips">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>此内容只支持非Deepin/UOS发行版</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="startServer">
|
||||
<property name="text">
|
||||
<string>启动服务</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="stopServer">
|
||||
<property name="text">
|
||||
<string>停止服务</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="setAutoStart">
|
||||
<property name="text">
|
||||
<string>设置开机自启</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="setUnautoStart">
|
||||
<property name="text">
|
||||
<string>关闭开机自启动</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
86
deb/opt/apps/deepin-wine-runner/key/UI/KeyAddKeyboardGui.py
Executable file
86
deb/opt/apps/deepin-wine-runner/key/UI/KeyAddKeyboardGui.py
Executable file
@ -0,0 +1,86 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'KeyAddKeyboardGui.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(800, 195)
|
||||
icon = QtGui.QIcon.fromTheme("..")
|
||||
MainWindow.setWindowIcon(icon)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.addTips = QtWidgets.QLabel(self.centralwidget)
|
||||
self.addTips.setObjectName("addTips")
|
||||
self.verticalLayout.addWidget(self.addTips)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.exeNameTips = QtWidgets.QLabel(self.centralwidget)
|
||||
self.exeNameTips.setObjectName("exeNameTips")
|
||||
self.horizontalLayout_3.addWidget(self.exeNameTips)
|
||||
self.exeName = QtWidgets.QLineEdit(self.centralwidget)
|
||||
self.exeName.setObjectName("exeName")
|
||||
self.horizontalLayout_3.addWidget(self.exeName)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_3)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.localTips = QtWidgets.QLabel(self.centralwidget)
|
||||
self.localTips.setObjectName("localTips")
|
||||
self.horizontalLayout.addWidget(self.localTips)
|
||||
self.localKeyboardChoose = QtWidgets.QComboBox(self.centralwidget)
|
||||
self.localKeyboardChoose.setObjectName("localKeyboardChoose")
|
||||
self.horizontalLayout.addWidget(self.localKeyboardChoose)
|
||||
self.addTips_2 = QtWidgets.QLabel(self.centralwidget)
|
||||
self.addTips_2.setObjectName("addTips_2")
|
||||
self.horizontalLayout.addWidget(self.addTips_2)
|
||||
self.localKey = QtWidgets.QLineEdit(self.centralwidget)
|
||||
self.localKey.setObjectName("localKey")
|
||||
self.horizontalLayout.addWidget(self.localKey)
|
||||
self.wineTips = QtWidgets.QLabel(self.centralwidget)
|
||||
self.wineTips.setObjectName("wineTips")
|
||||
self.horizontalLayout.addWidget(self.wineTips)
|
||||
self.wineKeyboardChoose = QtWidgets.QComboBox(self.centralwidget)
|
||||
self.wineKeyboardChoose.setObjectName("wineKeyboardChoose")
|
||||
self.horizontalLayout.addWidget(self.wineKeyboardChoose)
|
||||
self.addTipsWine = QtWidgets.QLabel(self.centralwidget)
|
||||
self.addTipsWine.setObjectName("addTipsWine")
|
||||
self.horizontalLayout.addWidget(self.addTipsWine)
|
||||
self.wineKey = QtWidgets.QLineEdit(self.centralwidget)
|
||||
self.wineKey.setObjectName("wineKey")
|
||||
self.horizontalLayout.addWidget(self.wineKey)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem1)
|
||||
self.addButton = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.addButton.setObjectName("addButton")
|
||||
self.horizontalLayout_2.addWidget(self.addButton)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "添加快捷键"))
|
||||
self.addTips.setText(_translate("MainWindow", "暂时只支持 Ctrl+Alt+? 和 Alt+? 的组合\n"
|
||||
"文本框内的只能输入单字母"))
|
||||
self.exeNameTips.setText(_translate("MainWindow", "可这执行文件名称:"))
|
||||
self.localTips.setText(_translate("MainWindow", "本地映射:"))
|
||||
self.addTips_2.setText(_translate("MainWindow", "+"))
|
||||
self.wineTips.setText(_translate("MainWindow", "Wine 容器映射内容:"))
|
||||
self.addTipsWine.setText(_translate("MainWindow", "+"))
|
||||
self.addButton.setText(_translate("MainWindow", "添加快捷键"))
|
||||
|
130
deb/opt/apps/deepin-wine-runner/key/UI/KeyAddKeyboardGui.ui
Executable file
130
deb/opt/apps/deepin-wine-runner/key/UI/KeyAddKeyboardGui.ui
Executable file
@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>195</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>添加快捷键</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset theme="..">
|
||||
<normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="addTips">
|
||||
<property name="text">
|
||||
<string>暂时只支持 Ctrl+Alt+? 和 Alt+? 的组合
|
||||
文本框内的只能输入单字母</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="exeNameTips">
|
||||
<property name="text">
|
||||
<string>可这执行文件名称:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="exeName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="localTips">
|
||||
<property name="text">
|
||||
<string>本地映射:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="localKeyboardChoose"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="addTips_2">
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="localKey"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="wineTips">
|
||||
<property name="text">
|
||||
<string>Wine 容器映射内容:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="wineKeyboardChoose"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="addTipsWine">
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="wineKey"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addButton">
|
||||
<property name="text">
|
||||
<string>添加快捷键</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
BIN
deb/opt/apps/deepin-wine-runner/key/UI/__pycache__/AutoConfig.cpython-310.pyc
Executable file
BIN
deb/opt/apps/deepin-wine-runner/key/UI/__pycache__/AutoConfig.cpython-310.pyc
Executable file
Binary file not shown.
BIN
deb/opt/apps/deepin-wine-runner/key/UI/__pycache__/AutoConfig.cpython-37.pyc
Executable file
BIN
deb/opt/apps/deepin-wine-runner/key/UI/__pycache__/AutoConfig.cpython-37.pyc
Executable file
Binary file not shown.
BIN
deb/opt/apps/deepin-wine-runner/key/UI/__pycache__/KeyAddGui.cpython-37.pyc
Executable file
BIN
deb/opt/apps/deepin-wine-runner/key/UI/__pycache__/KeyAddGui.cpython-37.pyc
Executable file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
X-Categories=System;Wine;
|
||||
Exec=@programPath@/key-get.py
|
||||
Icon=@programPath@/../deepin-wine-runner.svg
|
||||
Name=Wine Runner
|
||||
Name[zh]=Wine 运行器快捷键服务
|
||||
Terminal=false
|
||||
StartupNotify=true
|
||||
Keywords=exe;scr;
|
66
deb/opt/apps/deepin-wine-runner/key/key-add-gui.py
Executable file
66
deb/opt/apps/deepin-wine-runner/key/key-add-gui.py
Executable file
@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
sys.path.append(f"{programPath}/..")
|
||||
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import dbus
|
||||
import threading
|
||||
from UI.KeyAddGui import *
|
||||
import PyQt5.QtWidgets as QtWidgets
|
||||
|
||||
class Check:
|
||||
def VersionCheck():
|
||||
try:
|
||||
bus = dbus.SessionBus()
|
||||
bus.get_object("com.deepin.daemon.Keybinding", "/com/deepin/daemon/Keybinding").List()
|
||||
int("a")
|
||||
return True
|
||||
except:
|
||||
print("无法检测到 Deepin/UOS 快捷键服务")
|
||||
return False
|
||||
def CheckThreading():
|
||||
if Check.VersionCheck():
|
||||
ui.startServer.setDisabled(True)
|
||||
ui.stopServer.setDisabled(True)
|
||||
ui.setAutoStart.setDisabled(True)
|
||||
ui.setUnautoStart.setDisabled(True)
|
||||
ui.editButton.setDisabled(True)
|
||||
ui.keyBoardList.setDisabled(True)
|
||||
ui.saveButton.setDisabled(True)
|
||||
|
||||
def Clear():
|
||||
ui.keyBoardList.model().removeRows(0, ui.keyBoardList.model().rowCount())
|
||||
model = QtCore.QStringListModel(window)
|
||||
with open(f"{programPath}/list/KeyList.json", "r") as file:
|
||||
lists = []
|
||||
for i in json.loads(file.read()):
|
||||
lists.append(f"{i[0]}({'+'.join(i[1: -1])}),{i[-1]}")
|
||||
model.setStringList(lists)
|
||||
ui.keyBoardList.setModel(model)
|
||||
|
||||
|
||||
class Click:
|
||||
def AddButton():
|
||||
os.system(f"'{programPath}/keyboard-add-gui.py'")
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
window = QtWidgets.QMainWindow()
|
||||
ui = Ui_MainWindow()
|
||||
ui.setupUi(window)
|
||||
# 连接槽
|
||||
ui.addButton.clicked.connect(Click.AddButton)
|
||||
ui.startServer.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"nohup '{programPath}/key-get.py' &"]).start())
|
||||
ui.stopServer.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/stop.sh'"]).start())
|
||||
ui.setAutoStart.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/start-auto-server.sh'"]).start())
|
||||
ui.setUnautoStart.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/stop-auto-server.sh'"]).start())
|
||||
window.show()
|
||||
threading.Thread(target=Check.CheckThreading).start()
|
||||
Clear()
|
||||
sys.exit(app.exec_())
|
104
deb/opt/apps/deepin-wine-runner/key/key-get.py
Executable file
104
deb/opt/apps/deepin-wine-runner/key/key-get.py
Executable file
@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env python3
|
||||
#########################
|
||||
# 版本:1.0.0
|
||||
# Python
|
||||
#########################
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import json
|
||||
import threading
|
||||
import traceback
|
||||
import pynput.keyboard as keyboard
|
||||
keyList = []
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
keyChangeMap = [
|
||||
["ctrl", keyboard.Key.ctrl],
|
||||
["alt", keyboard.Key.alt],
|
||||
["esc", keyboard.Key.esc],
|
||||
["enter", keyboard.Key.enter]
|
||||
]
|
||||
keyMap = []
|
||||
for i in os.listdir(f"{programPath}/list"):
|
||||
print(i)
|
||||
try:
|
||||
file = open(f"{programPath}/list/{i}", "r")
|
||||
keyMapTemp = json.loads(file.read())
|
||||
except:
|
||||
print(f"{programPath}/list/{i} 读取失败!")
|
||||
continue
|
||||
for i in keyMapTemp:
|
||||
keyMap.append(i)
|
||||
for i in range(len(keyMap)):
|
||||
for k in range(len(keyMap[i])):
|
||||
for j in keyChangeMap:
|
||||
if keyMap[i][k] == j[0]:
|
||||
keyMap[i][k] = j[1]
|
||||
continue
|
||||
try:
|
||||
keyMap[i][k] = keyMap[i][k].replace("{programPath}", programPath)
|
||||
except:
|
||||
pass
|
||||
|
||||
print(keyList)
|
||||
def on_press(key):
|
||||
try:
|
||||
if key.char in keyList:
|
||||
# 重复的值就不认了,摊牌了
|
||||
return
|
||||
keyList.append(key.char)
|
||||
print(f'alphanumeric key {key.char} pressed')
|
||||
except AttributeError:
|
||||
keyList.append(key)
|
||||
print(f'special key {key} pressed')
|
||||
|
||||
def on_release(key):
|
||||
print(f'{key} released')
|
||||
try:
|
||||
del keyList[keyList.index(key.char)]
|
||||
except AttributeError:
|
||||
del keyList[keyList.index(key)]
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
||||
def ReadKey():
|
||||
next = False
|
||||
for i in keyMap:
|
||||
for k in range(0, len(i) - 1):
|
||||
k = i[k]
|
||||
if not k in keyList:
|
||||
next = True
|
||||
break
|
||||
if not next:
|
||||
# 执行命令
|
||||
os.system(i[-1])
|
||||
# 必须等待按键全部松开才行
|
||||
while len(keyList) != 0:
|
||||
time.sleep(0.01)
|
||||
|
||||
|
||||
def Read():
|
||||
while True:
|
||||
ReadKey()
|
||||
if os.path.exists("/tmp/deepin-wine-runner-keyboard-exit"):
|
||||
# 移除文件
|
||||
try:
|
||||
os.remove("/tmp/deepin-wine-runner-keyboard-exit")
|
||||
except:
|
||||
traceback.print_exc()
|
||||
listener.stop()
|
||||
break
|
||||
time.sleep(0.01)
|
||||
|
||||
# Lock 锁防止多次调用
|
||||
if os.path.exists("/tmp/deepin-wine-runner-keyboard-lock"):
|
||||
print("不可多次调用")
|
||||
print("锁 /tmp/deepin-wine-runner-keyboard-lock 已存在")
|
||||
sys.exit(1)
|
||||
os.mknod("/tmp/deepin-wine-runner-keyboard-lock")
|
||||
threading.Thread(target=Read).start()
|
||||
with keyboard.Listener(
|
||||
on_press=on_press,
|
||||
on_release=on_release) as listener:
|
||||
listener.join()
|
||||
os.remove("/tmp/deepin-wine-runner-keyboard-lock")
|
128
deb/opt/apps/deepin-wine-runner/key/keyboard-add-gui.py
Executable file
128
deb/opt/apps/deepin-wine-runner/key/keyboard-add-gui.py
Executable file
@ -0,0 +1,128 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
sys.path.append(f"{programPath}/..")
|
||||
|
||||
import os
|
||||
import sys
|
||||
import dbus
|
||||
import json
|
||||
import threading
|
||||
import traceback
|
||||
from UI.KeyAddKeyboardGui import *
|
||||
import PyQt5.QtWidgets as QtWidgets
|
||||
|
||||
keyList = ["无快捷键", "shift", "ctrl", "alt", "ctrl+alt", "ctrl+shift", "alt+shift"]
|
||||
keyListDeepinMap = ["", "<Shift>", "<Control>", "<Alt>", "<Control><Alt>", "<Control><Shift>", "<Alt><Shift>"]
|
||||
keyListDebianMap = [[], ["shift"], ["ctrl"], ["alt"], ["ctrl", "alt"], ["ctrl", "shift"], ["alt", "shift"]]
|
||||
|
||||
class Check:
|
||||
def VersionCheck():
|
||||
try:
|
||||
bus = dbus.SessionBus()
|
||||
bus.get_object("com.deepin.daemon.Keybinding", "/com/deepin/daemon/Keybinding").List()
|
||||
int("a")
|
||||
return True
|
||||
except:
|
||||
print("无法检测到 Deepin/UOS 快捷键服务")
|
||||
return False
|
||||
|
||||
class Click:
|
||||
def LocalValueChange():
|
||||
ui.wineKeyboardChoose.setCurrentIndex(ui.localKeyboardChoose.currentIndex())
|
||||
|
||||
def LocalKeyChange():
|
||||
ui.wineKey.setText(ui.localKey.text())
|
||||
|
||||
def AddButton():
|
||||
# 完整性检测
|
||||
if ui.exeName.text() == "" or ui.localKey.text() == "" or ui.wineKey.text() == "":
|
||||
QtWidgets.QMessageBox.critical(window, "错误", "您的信息暂未填写完整")
|
||||
return
|
||||
if ui.localKey.text()[0] == " " or ui.wineKey.text()[0] == " ":
|
||||
QtWidgets.QMessageBox.critical(window, "错误", "映射快捷键的第一位不能为空格")
|
||||
return
|
||||
# Deepin/UOS 的情况
|
||||
if Check.VersionCheck():
|
||||
# 接入 dbus
|
||||
try:
|
||||
bus = dbus.SessionBus()
|
||||
bus.get_object("com.deepin.daemon.Keybinding", "/com/deepin/daemon/Keybinding").Add(
|
||||
ui.exeName.text(),
|
||||
f"'{programPath}/sendkeys.sh' {ui.wineKey.text()[0]} '{ui.exeName.text()}' {ui.wineKeyboardChoose.currentIndex()}",
|
||||
f"{keyListDeepinMap[ui.localKeyboardChoose.currentIndex()]}{ui.localKey.text()[0]}"
|
||||
)
|
||||
QtWidgets.QMessageBox.information(window, "提示", "添加成功!")
|
||||
except:
|
||||
traceback.print_exc()
|
||||
QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc())
|
||||
return
|
||||
keyboardList = []
|
||||
if os.path.exists(f"{programPath}/list/KeyList.json"):
|
||||
try:
|
||||
with open(f"{programPath}/list/KeyList.json") as file:
|
||||
keyboardList = json.loads(file.read())
|
||||
except:
|
||||
traceback.print_exc()
|
||||
QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc())
|
||||
return
|
||||
print(keyboardList)
|
||||
addList = []
|
||||
addList = keyListDebianMap[ui.wineKeyboardChoose.currentIndex()][:]
|
||||
print(keyListDebianMap)
|
||||
print(addList)
|
||||
addList.append(ui.localKey.text()[0])
|
||||
print(1, addList)
|
||||
addList.append(f"'{programPath}/sendkeys.sh' {ui.wineKey.text()[0]} '{ui.exeName.text()}' {ui.wineKeyboardChoose.currentIndex()}")
|
||||
print(2, addList)
|
||||
print(addList)
|
||||
try:
|
||||
keyboardList[int(sys.argv[1])] = addList
|
||||
except:
|
||||
keyboardList.append(addList)
|
||||
try:
|
||||
with open(f"{programPath}/list/KeyList.json", "w") as file:
|
||||
file.write(json.dumps(keyboardList))
|
||||
QtWidgets.QMessageBox.information(window, "提示", "添加成功!")
|
||||
except:
|
||||
traceback.print_exc()
|
||||
QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
window = QtWidgets.QMainWindow()
|
||||
ui = Ui_MainWindow()
|
||||
ui.setupUi(window)
|
||||
# 添加选项
|
||||
ui.localKeyboardChoose.addItems(keyList)
|
||||
ui.wineKeyboardChoose.addItems(keyList)
|
||||
# 读取程序参数
|
||||
try:
|
||||
with open(f"{programPath}/list/KeyList.json") as file:
|
||||
keyboardList = json.loads(file.read())
|
||||
choice = keyboardList[int(sys.argv[1])]
|
||||
ui.localKeyboardChoose.setCurrentIndex(keyListDebianMap.index(choice[:-2]))
|
||||
ui.localKey.setText(choice[-2])
|
||||
# 解析命令
|
||||
command = choice[-1]
|
||||
# 筛掉路径
|
||||
command = command[command[1:].index("'") + 2:].strip()
|
||||
# 筛出其中一个快捷键
|
||||
ui.wineKey.setText(command[command.index(" ") - 1])
|
||||
command = command[command.index(" ") + 2:]
|
||||
# 读 exe
|
||||
ui.exeName.setText(command[:command.index("'")])
|
||||
command = command[command.index("'") + 1: ].strip()
|
||||
# 读最后的快捷键
|
||||
ui.wineKeyboardChoose.setCurrentIndex(int(command))
|
||||
except:
|
||||
pass
|
||||
# 连接槽
|
||||
ui.addButton.clicked.connect(Click.AddButton)
|
||||
ui.localKeyboardChoose.currentIndexChanged.connect(Click.LocalValueChange)
|
||||
ui.localKey.textChanged.connect(Click.LocalKeyChange)
|
||||
window.show()
|
||||
#threading.Thread(target=Check.CheckThreading).start()
|
||||
sys.exit(app.exec_())
|
1
deb/opt/apps/deepin-wine-runner/key/list/KeyList.json
Executable file
1
deb/opt/apps/deepin-wine-runner/key/list/KeyList.json
Executable file
@ -0,0 +1 @@
|
||||
[]
|
9
deb/opt/apps/deepin-wine-runner/key/replace.py
Executable file
9
deb/opt/apps/deepin-wine-runner/key/replace.py
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/python3
|
||||
import os
|
||||
import sys
|
||||
file = open(sys.argv[1], "r")
|
||||
things = file.read().replace(sys.argv[2], sys.argv[3])
|
||||
file.close()
|
||||
file = open(sys.argv[1], "w")
|
||||
file.write(things)
|
||||
file.close()
|
BIN
deb/opt/apps/deepin-wine-runner/key/sendkeys.exe
Executable file
BIN
deb/opt/apps/deepin-wine-runner/key/sendkeys.exe
Executable file
Binary file not shown.
107
deb/opt/apps/deepin-wine-runner/key/sendkeys.sh
Executable file
107
deb/opt/apps/deepin-wine-runner/key/sendkeys.sh
Executable file
@ -0,0 +1,107 @@
|
||||
#!/bin/bash
|
||||
|
||||
# $1 key value
|
||||
# $2 process name , default QQ|TIM
|
||||
# $3 control mode , default ctrl+alt
|
||||
# 0 no control key
|
||||
# 1 shift+
|
||||
# 2 ctrl+
|
||||
# 3 alt+
|
||||
# 4 ctrl+alt+
|
||||
# 5 ctrl+shift+
|
||||
# 6 alt+shift+
|
||||
|
||||
SHELL_DIR=$(dirname $0)
|
||||
SHELL_DIR=$(realpath "$SHELL_DIR")
|
||||
if [ $SPECIFY_SHELL_DIR ]; then
|
||||
SHELL_DIR=$SPECIFY_SHELL_DIR
|
||||
fi
|
||||
|
||||
get_wine_by_pid()
|
||||
{
|
||||
cat /proc/$1/maps | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1 | awk '{print $6}'
|
||||
}
|
||||
|
||||
is_wine_process()
|
||||
{
|
||||
wine_module=$(get_wine_by_pid $1)
|
||||
if [ -z "$wine_module" ];then
|
||||
wine_module=$(cat /proc/$1/maps | grep -E "\/wineserver$" | head -1)
|
||||
fi
|
||||
echo $wine_module
|
||||
}
|
||||
|
||||
get_prefix_by_pid()
|
||||
{
|
||||
WINE_PREFIX=$(xargs -0 printf '%s\n' < /proc/$1/environ | grep WINEPREFIX)
|
||||
WINE_PREFIX=${WINE_PREFIX##*=}
|
||||
if [ -z "$WINE_PREFIX" ] && [ -n "$(is_wine_process $1)" ]; then
|
||||
#不指定容器的情况用默认容器目录
|
||||
WINE_PREFIX="$HOME/.wine"
|
||||
fi
|
||||
WINE_PREFIX=$(realpath $WINE_PREFIX)
|
||||
echo $WINE_PREFIX
|
||||
}
|
||||
|
||||
get_bottle_path_by_process_id()
|
||||
{
|
||||
PID_LIST="$1"
|
||||
PREFIX_LIST=""
|
||||
|
||||
for pid_var in $PID_LIST ; do
|
||||
WINE_PREFIX=$(get_prefix_by_pid $pid_var)
|
||||
for path in $(echo -e $PREFIX_LIST) ; do
|
||||
prefix=${path#*=}
|
||||
if [ "$prefix" == "$WINE_PREFIX" ]; then
|
||||
WINE_PREFIX=""
|
||||
fi
|
||||
done
|
||||
if [ -n "$WINE_PREFIX" ];then
|
||||
PREFIX_LIST+="\n$pid_var=$WINE_PREFIX"
|
||||
fi
|
||||
done
|
||||
echo -e $PREFIX_LIST
|
||||
}
|
||||
|
||||
get_bottle_path_by_process_name()
|
||||
{
|
||||
PID_LIST=""
|
||||
for pid_var in $(ps -ef | grep -E -i "$1" | grep -v grep | awk '{print $2}');do
|
||||
#通过判断是否加载wine来判断是不是wine进程
|
||||
if [ -n "$(is_wine_process $pid_var)" ];then
|
||||
PID_LIST+=" $pid_var"
|
||||
fi
|
||||
done
|
||||
get_bottle_path_by_process_id "$PID_LIST"
|
||||
}
|
||||
|
||||
send_to_process()
|
||||
{
|
||||
if [ -z "$2" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
for path in $(get_bottle_path_by_process_name $2); do
|
||||
proc_pid=${path%=*}
|
||||
prefix=${path#*=}
|
||||
wine_cmd=$(get_wine_by_pid $proc_pid)
|
||||
wine_name=$(echo $wine_cmd | awk -F / '{print $(NF-2)}')
|
||||
if command -v $wine_name > /dev/null 2>&1; then
|
||||
wine_cmd="$wine_name"
|
||||
fi
|
||||
echo "send to $path by $wine_cmd"
|
||||
|
||||
env WINEPREFIX="$prefix" "$wine_cmd" "$SHELL_DIR/sendkeys.exe" $1 $3
|
||||
done
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Please input a key [a-zA-Z]"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -n "$2" ]; then
|
||||
send_to_process $1 $2 $3
|
||||
else
|
||||
send_to_process $1 "QQ|TIM"
|
||||
fi
|
18
deb/opt/apps/deepin-wine-runner/key/start-auto-server.sh
Executable file
18
deb/opt/apps/deepin-wine-runner/key/start-auto-server.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# 使用系统默认的 Bash
|
||||
#################################################################################################################
|
||||
# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
# 版本:2.4.0
|
||||
# 更新时间:2022年10月11日
|
||||
# 感谢:感谢 wine、deepin-wine 以及星火团队,提供了 wine、deepin-wine、spark-wine-devel 给大家使用,让我能做这个程序
|
||||
# 基于 Bash 制作
|
||||
#################################################################################################################
|
||||
programPath=$(cd "$(dirname "$0")";pwd)
|
||||
echo $programPath
|
||||
if [[ -f "/etc/xdg/autostart/deepin-wine-runner-keyboard.desktop" ]]; then
|
||||
# 判断是否自启动,已经自启动就不再考虑
|
||||
echo "文件已存在,取消"
|
||||
exit 1
|
||||
fi
|
||||
sudo cp -rv desktop/deepin-wine-runner-keyboard.desktop /etc/xdg/autostart/deepin-wine-runner-keyboard.desktop
|
||||
sudo ./replace.py /etc/xdg/autostart/deepin-wine-runner-keyboard.desktop @programPath@ "$programPath"
|
17
deb/opt/apps/deepin-wine-runner/key/stop-auto-server.sh
Executable file
17
deb/opt/apps/deepin-wine-runner/key/stop-auto-server.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# 使用系统默认的 Bash
|
||||
#################################################################################################################
|
||||
# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
# 版本:2.4.0
|
||||
# 更新时间:2022年10月11日
|
||||
# 感谢:感谢 wine、deepin-wine 以及星火团队,提供了 wine、deepin-wine、spark-wine-devel 给大家使用,让我能做这个程序
|
||||
# 基于 Bash 制作
|
||||
#################################################################################################################
|
||||
programPath=$(cd "$(dirname "$0")";pwd)
|
||||
echo $programPath
|
||||
if [[ ! -f "/etc/xdg/autostart/deepin-wine-runner-keyboard.desktop" ]]; then
|
||||
# 判断是否自启动,已经自启动就不再考虑
|
||||
echo "文件已存在,取消"
|
||||
exit 1
|
||||
fi
|
||||
sudo rm -rfv /etc/xdg/autostart/deepin-wine-runner-keyboard.desktop
|
2
deb/opt/apps/deepin-wine-runner/key/stop.sh
Executable file
2
deb/opt/apps/deepin-wine-runner/key/stop.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
touch /tmp/deepin-wine-runner-keyboard-exit
|
2
deb/opt/apps/deepin-wine-runner/key/unlock.sh
Executable file
2
deb/opt/apps/deepin-wine-runner/key/unlock.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
rm /tmp/deepin-wine-runner-keyboard-lock
|
Binary file not shown.
BIN
dlls-arm.7z
BIN
dlls-arm.7z
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
{
|
||||
"Version": "2.3.0",
|
||||
"Version": "2.4.0~alpha1",
|
||||
"Thank": [
|
||||
"感谢 @a2035274 @虚幻的早晨 https://bbs.deepin.org/post/238301",
|
||||
"感谢 @zhangs https://bbs.deepin.org/post/227948",
|
||||
|
@ -4,6 +4,9 @@ import sys
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
sys.path.append(f"{programPath}/..")
|
||||
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import dbus
|
||||
import threading
|
||||
from UI.KeyAddGui import *
|
||||
@ -29,6 +32,17 @@ class Check:
|
||||
ui.keyBoardList.setDisabled(True)
|
||||
ui.saveButton.setDisabled(True)
|
||||
|
||||
def Clear():
|
||||
ui.keyBoardList.model().removeRows(0, ui.keyBoardList.model().rowCount())
|
||||
model = QtCore.QStringListModel(window)
|
||||
with open(f"{programPath}/list/KeyList.json", "r") as file:
|
||||
lists = []
|
||||
for i in json.loads(file.read()):
|
||||
lists.append(f"{i[0]}({'+'.join(i[1: -1])}),{i[-1]}")
|
||||
model.setStringList(lists)
|
||||
ui.keyBoardList.setModel(model)
|
||||
|
||||
|
||||
class Click:
|
||||
def AddButton():
|
||||
os.system(f"'{programPath}/keyboard-add-gui.py'")
|
||||
@ -48,4 +62,5 @@ if __name__ == "__main__":
|
||||
ui.setUnautoStart.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/stop-auto-server.sh'"]).start())
|
||||
window.show()
|
||||
threading.Thread(target=Check.CheckThreading).start()
|
||||
Clear()
|
||||
sys.exit(app.exec_())
|
@ -3,7 +3,7 @@
|
||||
#################################################################################################################
|
||||
# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
# 版本:2.3.0
|
||||
# 更新时间:2022年10月02日
|
||||
# 更新时间:2022年10月15日
|
||||
# 感谢:感谢 wine、deepin-wine 以及星火团队,提供了 wine、deepin-wine、spark-wine-devel 给大家使用,让我能做这个程序
|
||||
# 基于 Python3 的 PyQt5 构建
|
||||
#################################################################################################################
|
||||
@ -716,6 +716,18 @@ def SetDeepinFileDialogDeepin():
|
||||
return
|
||||
QtWidgets.QMessageBox.information(widget, "提示", "设置完成!")
|
||||
|
||||
def AddReg():
|
||||
path = QtWidgets.QFileDialog.getOpenFileName(window, "保存路径", get_home(), "reg文件(*.reg);;所有文件(*.*)")
|
||||
if path[0] == "" and not path[1]:
|
||||
return
|
||||
RunWineProgram(f"regedit' /S '{path[0]}' 'HKEY_CURRENT_USER\Software\Wine\DllOverrides")
|
||||
|
||||
def SaveDllList():
|
||||
path = QtWidgets.QFileDialog.getSaveFileName(window, "保存路径", get_home(), "reg文件(*.reg);;所有文件(*.*)")
|
||||
if path[0] == "" and not path[1]:
|
||||
return
|
||||
RunWineProgram(f"regedit' /E '{path[0]}' 'HKEY_CURRENT_USER\Software\Wine\DllOverrides")
|
||||
|
||||
def SetDeepinFileDialogDefult():
|
||||
code = os.system(f"pkexec \"{programPath}/deepin-wine-venturi-setter.py\" defult")
|
||||
if code != 0:
|
||||
@ -2170,6 +2182,13 @@ enabledHttpProxy = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "设
|
||||
disbledHttpProxy = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "禁用指定 wine 容器的代理"))
|
||||
settingHttpProxy.addAction(enabledHttpProxy)
|
||||
settingHttpProxy.addAction(disbledHttpProxy)
|
||||
dllOver = wineOption.addMenu(QtCore.QCoreApplication.translate("U", "函数顶替库列表"))
|
||||
saveDllOver = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "导出函数顶替列表"))
|
||||
addDllOver = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "导入函数顶替列表"))
|
||||
editDllOver = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "编辑函数顶替库列表"))
|
||||
dllOver.addAction(saveDllOver)
|
||||
dllOver.addAction(addDllOver)
|
||||
dllOver.addAction(editDllOver)
|
||||
w1.triggered.connect(OpenWineBotton)
|
||||
w2.triggered.connect(InstallWineFont)
|
||||
w3.triggered.connect(OpenWineFontPath)
|
||||
@ -2192,7 +2211,7 @@ wm1_5.triggered.connect(lambda: threading.Thread(target=InstallMonoGecko, args=[
|
||||
wm1_7.triggered.connect(lambda: threading.Thread(target=InstallVB).start())
|
||||
wm1_6.triggered.connect(lambda: threading.Thread(target=InstallOther).start())
|
||||
wm2_1.triggered.connect(lambda: RunWineProgram("control"))
|
||||
wm2_2.triggered.connect(lambda: RunWineProgram("iexplore' 'https://www.deepin.org"))
|
||||
wm2_2.triggered.connect(lambda: RunWineProgram("iexplore' 'https://gfdgd-xi.github.io"))
|
||||
wm2_3.triggered.connect(lambda: RunWineProgram("regedit"))
|
||||
wm2_4.triggered.connect(lambda: RunWineProgram("taskmgr"))
|
||||
wm2_5.triggered.connect(lambda: RunWineProgram("explorer"))
|
||||
@ -2210,6 +2229,9 @@ disbledWineCrashDialog.triggered.connect(lambda: RunWineProgram("reg' add 'HKEY_
|
||||
enabledWineCrashDialog.triggered.connect(lambda: RunWineProgram("reg' add 'HKEY_CURRENT_USER\Software\Wine\WineDbg' /v ShowCrashDialog /t REG_DWORD /d 00000001 '/f"))
|
||||
enabledHttpProxy.triggered.connect(SetHttpProxy)
|
||||
disbledHttpProxy.triggered.connect(DisbledHttpProxy)
|
||||
saveDllOver.triggered.connect(SaveDllList)
|
||||
addDllOver.triggered.connect(AddReg)
|
||||
editDllOver.triggered.connect(lambda: RunWineProgram("winecfg"))
|
||||
|
||||
virtualMachine = menu.addMenu(QtCore.QCoreApplication.translate("U", "虚拟机(&V)"))
|
||||
v1 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "使用 Virtualbox 虚拟机运行 Windows 应用"))
|
||||
|
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
{
|
||||
"Version": "2.3.0"
|
||||
"Version": "2.4.0~alpha1"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user