From cda3a34c7ab8f61720397514776f235d38080dca Mon Sep 17 00:00:00 2001 From: lemniskett Date: Wed, 28 Oct 2020 16:06:06 +0000 Subject: [PATCH] Merge Archbox scripts. --- README.md | 2 ++ archbox.bash | 4 ++-- archboxcommand.bash | 4 +++- archboxenter.bash | 4 ---- install.sh | 3 +-- 5 files changed, 8 insertions(+), 9 deletions(-) delete mode 100755 archboxenter.bash diff --git a/README.md b/README.md index 8b19643..4471c05 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,5 @@ You may want to add this, if you don't want to run archbox chroot without passwo Instead of opening terminal everytime you want to run application inside chroot, you may want to launch rofi inside chroot, install rofi and do ```archbox rofi ```. #### Pulseaudio If the audio doesn't work, comment ```mount -R /var/lib/dbus $CHROOT/var/lib/dbus``` in init script and start pulseaudio inside chroot instead, do ```archbox pulseaudio```. +#### Prompt +If you use bash you could add a nice little Arch Linux icon in your prompt, add ```[[ -e /etc/arch-release ]] && export PS1=" $PS1"``` to your ```~/.bashrc``` diff --git a/archbox.bash b/archbox.bash index 654d1e9..761e8fe 100755 --- a/archbox.bash +++ b/archbox.bash @@ -75,7 +75,7 @@ case $1 in ;; --enter) copyresolv - $PRIV /usr/local/share/archbox/bin/archboxenter + $PRIV /usr/local/share/archbox/bin/archbox --enter ;; --help) help_text @@ -89,6 +89,6 @@ case $1 in *) copyresolv COMMAND=$(echo $@ | tr ' ' '\ ') - $PRIV /usr/local/share/archbox/bin/archboxcommand $COMMAND + $PRIV /usr/local/share/archbox/bin/archbox $COMMAND ;; esac diff --git a/archboxcommand.bash b/archboxcommand.bash index 23c9493..13fe7ba 100755 --- a/archboxcommand.bash +++ b/archboxcommand.bash @@ -1,5 +1,7 @@ #!/bin/bash source /etc/archbox.conf + COMMAND=$(echo $@ | tr ' ' '\ ') -chroot $CHROOT /bin/su -c "$COMMAND" $USER \ No newline at end of file +[[ ! $1 = "--enter" ]] && chroot $CHROOT /bin/su -c "$COMMAND" $USER \ + || chroot $CHROOT /bin/su $USER diff --git a/archboxenter.bash b/archboxenter.bash deleted file mode 100755 index 596f2ed..0000000 --- a/archboxenter.bash +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -source /etc/archbox.conf -chroot $CHROOT /bin/su $USER \ No newline at end of file diff --git a/install.sh b/install.sh index 450213f..58d627e 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,6 @@ mkdir -p /usr/local/share/archbox/bin cp -v ./archbox.bash /usr/local/bin/archbox cp -v ./archbox.conf /etc/archbox.conf -cp -v ./archboxenter.bash /usr/local/share/archbox/bin/archboxenter cp -v ./copyresolv.bash /usr/local/share/archbox/bin/copyresolv -cp -v ./archboxcommand.bash /usr/local/share/archbox/bin/archboxcommand +cp -v ./archboxcommand.bash /usr/local/share/archbox/bin/archbox cp -v ./chroot_setup.bash /usr/local/share/archbox/chroot_setup.bash