Skip to content

Commit

Permalink
完善默认打开方式配置
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuchen Deng committed Mar 29, 2022
1 parent 751e5e6 commit 1787bda
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions base-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,12 @@ source /usr/local/bin/$1-config
if [ \$EUID == 0 ]; then
find /tmp/ -maxdepth 1 -name dbus* -exec machinectl bind --read-only --mkdir $1 {} \; -print
$(echo $XHOST_AUTH)
machinectl --setenv=DISPLAY=\$DISPLAY shell $1 /bin/su - u\$USER_UID -w DISPLAY -c 'echo "xrdb -merge ~/.Xresources && neofetch && exit" | /bin/bash --login'
machinectl --setenv=DISPLAY=\$DISPLAY shell $1 /bin/su - u\$USER_UID -w DISPLAY -c 'echo "
xrdb -merge ~/.Xresources ;
xdg-mime default thunar.desktop inode/directory ;
xdg-mime default mupdf.desktop application/pdf ;
neofetch ;
" | /bin/bash --login'
else
source /usr/local/bin/$1-bind
machinectl shell $1 /bin/su - u\$UID -c "\$RUN_ENVIRONMENT start /usr/share/applications/lxterminal.desktop"
Expand Down Expand Up @@ -1089,7 +1094,6 @@ cat > /usr/local/bin/$1-install-file <<EOF
source /usr/local/bin/$1-config
machinectl shell $1 /bin/bash -c "apt install -y thunar thunar-archive-plugin xarchiver unrar catfish mousepad gpicview libcanberra-gtk-module --no-install-recommends && apt autopurge -y"
machinectl shell $1 /bin/bash -c "[ -f /usr/share/applications/Thunar.desktop ] && mv /usr/share/applications/Thunar.desktop /usr/share/applications/thunar.desktop"
machinectl shell $1 /bin/su - u\$UID -c "xdg-mime default thunar.desktop inode/directory"
EOF

chmod 755 /usr/local/bin/$1-install-file
Expand Down Expand Up @@ -1154,7 +1158,6 @@ cat > /usr/local/bin/$1-install-mupdf <<EOF
#!/bin/bash
source /usr/local/bin/$1-config
machinectl shell $1 /bin/bash -c "apt install -y mupdf --no-install-recommends && apt autopurge -y"
machinectl shell $1 /bin/su - u\$UID -c "xdg-mime default mupdf.desktop application/pdf"
EOF

chmod 755 /usr/local/bin/$1-install-mupdf
Expand Down

0 comments on commit 1787bda

Please sign in to comment.