aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-02-15 17:12:44 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2023-02-15 17:12:44 +0100
commit7e19d0f0c26abb2eb32b7067640c0897d7936e4a (patch)
tree7cdd91a2c8dad671157fadc95e154d4cefd2f442
parent919b48f8e237a8c8b5b91c05304c817eec49e8f0 (diff)
add add prompt scriptHEADmaster
-rwxr-xr-xconfig/smash.d/prompt5
-rw-r--r--lib/sys/getcwd.h11
2 files changed, 16 insertions, 0 deletions
diff --git a/config/smash.d/prompt b/config/smash.d/prompt
new file mode 100755
index 0000000..fa2a8e5
--- /dev/null
+++ b/config/smash.d/prompt
@@ -0,0 +1,5 @@
+#!/system/core/smash
+
+[CWD]=cwd
+
+print " %S%F%s%S@%S%F%s%S %s > " BOLD RED liveiso RESET BOLD GREEN rex RESET $[CWD]
diff --git a/lib/sys/getcwd.h b/lib/sys/getcwd.h
new file mode 100644
index 0000000..ee14c2f
--- /dev/null
+++ b/lib/sys/getcwd.h
@@ -0,0 +1,11 @@
+#ifndef GETCWD_H
+#define GETCWD_H
+
+#include "syscalls.h"
+
+static int getcwd(char *buf, unsigned long size)
+{
+ return syscall(GETCWD, buf, size);
+}
+
+#endif