summaryrefslogtreecommitdiff
path: root/.config/wmii-hg/util.sh
diff options
context:
space:
mode:
Diffstat (limited to '.config/wmii-hg/util.sh')
-rw-r--r--.config/wmii-hg/util.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh
index 55344b2..f80b871 100644
--- a/.config/wmii-hg/util.sh
+++ b/.config/wmii-hg/util.sh
@@ -116,3 +116,31 @@ scansection() {
conffile() {
echo "$HOME/.wmii-hg/$1"
}
+
+################################################################################
+# 9P filesystem #
+################################################################################
+
+# Prefer 9pfuse since:
+# 1. Linux 9p directory listings are broken on i686
+# 2. 9umount doesn't work with recent versions of Linux 9p
+if (. /etc/profile.d/plan9.sh || true; type 9pfuse) &>/dev/null; then
+ . /etc/profile.d/plan9.sh || true
+ mount.9p() {
+ 9pfuse "$1" "$2"
+ while ! [[ -f "$2/event" ]]; do :; done
+ }
+ umount.9p() {
+ fusermount -u "$1"
+ }
+elif type 9mount &>/dev/null; then
+ mount.9p() {
+ 9mount -i "$1" "$2"
+ }
+ umount.9p() {
+ 9umount "$1"
+ }
+else
+ >&2 echo "ERROR: I don't know how to mount 9P filesystems"
+ exit 5 # EXIT_NOTINSTALLED (LSB)
+fi