修改文件名

This commit is contained in:
gfdgd xi 2023-06-25 12:53:52 +08:00
parent 42c7d2aa17
commit 09d9155f7b
12 changed files with 41 additions and 12 deletions

View File

@ -10,4 +10,4 @@ if [[ $firstPWD != $secondPWD ]]; then
exit 1
fi
echo -e "$firstPWD\n$firstPWD\n\n\n\n\n\nY\n" | ./run-root.sh adduser `whoami`
./run-root.sh bash -c "echo $USER >> /etc/sudo"
gx-env-run-root bash -c "echo $USER >> /etc/sudo"

2
gx-env-filemanager Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
gx-env-run dolphin

View File

@ -11,11 +11,11 @@ fi
echo aa > /tmp/env-$USER.txt
if [[ ! -f $chrootEnvPath/tmp/env-$USER.txt ]]; then
echo 未挂载目录,立即挂载
sudo ./load-env-root.sh
sudo gx-env-mount-root
fi
#user=`whoami`
if [[ ! -f $chrootEnvPath/user/$USER ]]; then
./load-env-user-root.sh
gx-env-adduser-root
if [[ $? != 0 ]]; then
echo Create User Error!
exit 1

3
gx-env-install-deb Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
gx-env-run-root apt update
gx-env-run-root apt install "$1"

29
gx-env-load-desktop Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env python3
import os
chrootEnvPath="/opt/new-system-env"
for i in os.listdir("{}/usr/share/applications".format(chrootEnvPath)):
if os.path.exists("/usr/share/applications/gx-env-{}".format(i)):
continue
info = ""
try:
with open("{}/usr/share/applications/{}".format(chrootEnvPath, i), "r") as file:
info = file.read()
except:
try:
with open("{}/opt/apps/{}/entries/applications/{}".format(chrootEnvPath, os.path.splitext(os.path.basename(i))[0], i), "r") as file:
info = file.read()
except:
continue
newInfo = ""
for r in info.splitlines():
if "exec=" in r.lower():
newInfo += "Exec=gx-env-run " + r[5:].strip() + "\n"
elif "name=" in r.lower() or "name[" in r.lower():
newInfo += r + "(兼容模式)\n"
else:
newInfo += r + "\n"
print(newInfo)
print(i)
with open("/usr/share/applications/gx-env-{}".format(i), "w") as file:
file.write(newInfo)

View File

@ -6,5 +6,5 @@ chrootEnvPath=/opt/new-system-env
#fi
command="$@"
#echo $command
sudo chroot $chrootEnvPath sudo -u $USER bash -c "$command"
#echo $@
pkexec env DISPLAY=$DISPLAY chroot $chrootEnvPath sudo -u $USER bash -c "$command"
#echo $@

2
gx-env-run-terminal.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
gx-env-run xfce4-terminal

View File

@ -1,3 +0,0 @@
#!/bin/bash
./run-root.sh apt update
./run-root.sh apt install "$1"

View File

@ -1,2 +0,0 @@
#!/bin/bash
./run.sh dolphin

View File

@ -1,2 +0,0 @@
#!/bin/bash
./run.sh xfce4-terminal