gui
This commit is contained in:
parent
1ae38adb59
commit
e3e3a5fde7
@ -4,4 +4,4 @@ gx-env-run-root python3 /gx-env/gx-env-load-desktop-in-chroot
|
|||||||
if [[ ! -d /usr/share/applications/gx-env ]]; then
|
if [[ ! -d /usr/share/applications/gx-env ]]; then
|
||||||
sudo mkdir /usr/share/applications/gx-env -p
|
sudo mkdir /usr/share/applications/gx-env -p
|
||||||
fi
|
fi
|
||||||
sudo cp $chrootEnvPath/gx-env/desktop/* /usr/share/applications/gx-env -v
|
pkexec cp $chrootEnvPath/gx-env/desktop/* /usr/share/applications/gx-env -v
|
@ -6,16 +6,16 @@ chrootEnvPath=/opt/new-system-env
|
|||||||
#fi
|
#fi
|
||||||
if [[ -f ~/.config/gx-env/bwrap ]]; then
|
if [[ -f ~/.config/gx-env/bwrap ]]; then
|
||||||
bwrap --dev-bind / / --dev-bind $chrootEnvPath/etc /etc --dev-bind $chrootEnvPath/opt /opt --dev-bind $chrootEnvPath/usr /usr --dev-bind $chrootEnvPath/var /var --dev-bind $chrootEnvPath/bin /bin --dev-bind $chrootEnvPath/boot /boot --dev-bind $chrootEnvPath/lib /lib --dev-bind $chrootEnvPath/lib32 /lib32 --dev-bind $chrootEnvPath/lib64 /lib64 --dev-bind $chrootEnvPath/libx32 /libx32 --dev-bind $chrootEnvPath/gx-env /gx-env "$@"
|
bwrap --dev-bind / / --dev-bind $chrootEnvPath/etc /etc --dev-bind $chrootEnvPath/opt /opt --dev-bind $chrootEnvPath/usr /usr --dev-bind $chrootEnvPath/var /var --dev-bind $chrootEnvPath/bin /bin --dev-bind $chrootEnvPath/boot /boot --dev-bind $chrootEnvPath/lib /lib --dev-bind $chrootEnvPath/lib32 /lib32 --dev-bind $chrootEnvPath/lib64 /lib64 --dev-bind $chrootEnvPath/libx32 /libx32 --dev-bind $chrootEnvPath/gx-env /gx-env "$@"
|
||||||
pkexec gx-env-load-desktop
|
#pkexec env `` gx-env-load-desktop
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
echo aa > /tmp/env-$USER.txt
|
echo aa > /tmp/env-$USER.txt
|
||||||
if [[ ! -f $chrootEnvPath/tmp/env-$USER.txt ]]; then
|
if [[ ! -f $chrootEnvPath/tmp/env-$USER.txt ]]; then
|
||||||
echo 未挂载目录,立即挂载
|
echo 未挂载目录,立即挂载
|
||||||
pkexec gx-env-init
|
pkexec env `printenv` gx-env-init
|
||||||
fi
|
fi
|
||||||
command="$@"
|
command="$@"
|
||||||
#echo $command
|
#echo $command
|
||||||
pkexec env `printenv` chroot $chrootEnvPath sudo -u $USER bash -c "$command"
|
pkexec env `printenv` chroot $chrootEnvPath sudo -u $USER bash -c "$command"
|
||||||
#echo $@
|
#echo $@
|
||||||
pkexec gx-env-load-desktop
|
#pkexec gx-env-load-desktop
|
@ -5,20 +5,17 @@ chrootEnvPath=/opt/new-system-env
|
|||||||
# exit 1
|
# exit 1
|
||||||
#fi
|
#fi
|
||||||
if [[ -f ~/.config/gx-env/bwrap ]]; then
|
if [[ -f ~/.config/gx-env/bwrap ]]; then
|
||||||
if [[ `whoami` != "root" ]]; then
|
pkexec env `printenv` bwrap --dev-bind / / --dev-bind $chrootEnvPath/etc /etc --dev-bind $chrootEnvPath/opt /opt --dev-bind $chrootEnvPath/usr /usr --dev-bind $chrootEnvPath/var /var --dev-bind $chrootEnvPath/bin /bin --dev-bind $chrootEnvPath/boot /boot --dev-bind $chrootEnvPath/lib /lib --dev-bind $chrootEnvPath/lib32 /lib32 --dev-bind $chrootEnvPath/lib64 /lib64 --dev-bind $chrootEnvPath/libx32 /libx32 --dev-bind $chrootEnvPath/gx-env /gx-env "$@"
|
||||||
echo 请使用 root 权限运行
|
#pkexec gx-env-load-desktop
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
bwrap --dev-bind / / --dev-bind $chrootEnvPath/etc /etc --dev-bind $chrootEnvPath/opt /opt --dev-bind $chrootEnvPath/usr /usr --dev-bind $chrootEnvPath/var /var --dev-bind $chrootEnvPath/bin /bin --dev-bind $chrootEnvPath/boot /boot --dev-bind $chrootEnvPath/lib /lib --dev-bind $chrootEnvPath/lib32 /lib32 --dev-bind $chrootEnvPath/lib64 /lib64 --dev-bind $chrootEnvPath/libx32 /libx32 --dev-bind $chrootEnvPath/gx-env /gx-env "$@"
|
|
||||||
pkexec gx-env-load-desktop
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
echo aa > /tmp/env-$USER.txt
|
echo aa > /tmp/env-$USER.txt
|
||||||
if [[ ! -f $chrootEnvPath/tmp/env-$USER.txt ]]; then
|
if [[ ! -f $chrootEnvPath/tmp/env-$USER.txt ]]; then
|
||||||
echo 未挂载目录,立即挂载
|
echo 未挂载目录,立即挂载
|
||||||
sudo gx-env-mount-root
|
pkexec env `printenv` gx-env-mount-root
|
||||||
fi
|
fi
|
||||||
command="$@"
|
command="$@"
|
||||||
#echo $command
|
#echo $command
|
||||||
pkexec env DISPLAY=$DISPLAY chroot $chrootEnvPath "$@"
|
pkexec env `printenv` chroot $chrootEnvPath "$@"
|
||||||
|
#pkexec gx-env-load-desktop
|
||||||
#echo $@
|
#echo $@
|
27
gx-env-setting-gui
Normal file
27
gx-env-setting-gui
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import threading
|
||||||
|
import PyQt5.QtWidgets as QtWidgets
|
||||||
|
|
||||||
|
|
||||||
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
|
window = QtWidgets.QMainWindow()
|
||||||
|
widget = QtWidgets.QWidget()
|
||||||
|
layout = QtWidgets.QGridLayout()
|
||||||
|
sparkStoreRun = QtWidgets.QPushButton("打开星火应用商店")
|
||||||
|
gdebiRun = QtWidgets.QPushButton("安装 deb 包")
|
||||||
|
xfce4TerminalRun = QtWidgets.QPushButton("终端")
|
||||||
|
xfce4TerminalRootRun = QtWidgets.QPushButton("终端(root)")
|
||||||
|
sparkStoreRun.clicked.connect(lambda: threading.Thread(target=os.system, args=["gx-env-run-root spark-store --no-sandbox ; pkexec env `printenv` gx-env-run"]).start())
|
||||||
|
gdebiRun.clicked.connect(lambda: threading.Thread(target=os.system, args=["gx-env-run-root gdebi ; pkexec env `printenv` gx-env-run"]).start())
|
||||||
|
xfce4TerminalRun.clicked.connect(lambda: threading.Thread(target=os.system, args=["gx-env-run xfce4-terminal"]).start())
|
||||||
|
xfce4TerminalRootRun.clicked.connect(lambda: threading.Thread(target=os.system, args=["gx-env-run-root xfce4 ; pkexec env `printenv` gx-env-run"]).start())
|
||||||
|
layout.addWidget(sparkStoreRun, 0, 0)
|
||||||
|
layout.addWidget(gdebiRun, 0, 1)
|
||||||
|
layout.addWidget(xfce4TerminalRun, 0, 2)
|
||||||
|
layout.addWidget(xfce4TerminalRootRun, 0, 3)
|
||||||
|
widget.setLayout(layout)
|
||||||
|
window.setCentralWidget(widget)
|
||||||
|
window.show()
|
||||||
|
sys.exit(app.exec_())
|
Loading…
x
Reference in New Issue
Block a user