修改文件名
This commit is contained in:
parent
42c7d2aa17
commit
09d9155f7b
@ -10,4 +10,4 @@ if [[ $firstPWD != $secondPWD ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo -e "$firstPWD\n$firstPWD\n\n\n\n\n\nY\n" | ./run-root.sh adduser `whoami`
|
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
2
gx-env-filemanager
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
gx-env-run dolphin
|
@ -11,11 +11,11 @@ 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 ./load-env-root.sh
|
sudo gx-env-mount-root
|
||||||
fi
|
fi
|
||||||
#user=`whoami`
|
#user=`whoami`
|
||||||
if [[ ! -f $chrootEnvPath/user/$USER ]]; then
|
if [[ ! -f $chrootEnvPath/user/$USER ]]; then
|
||||||
./load-env-user-root.sh
|
gx-env-adduser-root
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
echo Create User Error!
|
echo Create User Error!
|
||||||
exit 1
|
exit 1
|
3
gx-env-install-deb
Executable file
3
gx-env-install-deb
Executable 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
29
gx-env-load-desktop
Normal 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)
|
@ -6,5 +6,5 @@ chrootEnvPath=/opt/new-system-env
|
|||||||
#fi
|
#fi
|
||||||
command="$@"
|
command="$@"
|
||||||
#echo $command
|
#echo $command
|
||||||
sudo chroot $chrootEnvPath sudo -u $USER bash -c "$command"
|
pkexec env DISPLAY=$DISPLAY chroot $chrootEnvPath sudo -u $USER bash -c "$command"
|
||||||
#echo $@
|
#echo $@
|
2
gx-env-run-terminal.sh
Executable file
2
gx-env-run-terminal.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
gx-env-run xfce4-terminal
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
./run-root.sh apt update
|
|
||||||
./run-root.sh apt install "$1"
|
|
@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
./run.sh dolphin
|
|
@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
./run.sh xfce4-terminal
|
|
Loading…
x
Reference in New Issue
Block a user