[mutter.wiki] Upload attachment dbus-session.sh
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter.wiki] Upload attachment dbus-session.sh
- Date: Wed, 9 Jun 2021 15:05:53 +0000 (UTC)
commit b18f625b41c9e950b75116c1f499e2908e986770
Author: Jonas Ådahl <jadahl gmail com>
Date: Wed Jun 9 15:05:52 2021 +0000
Upload attachment dbus-session.sh
.../dbus-session.sh | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
---
diff --git a/uploads/a209c8f1fe6b51df669b58bab1300199/dbus-session.sh
b/uploads/a209c8f1fe6b51df669b58bab1300199/dbus-session.sh
new file mode 100644
index 0000000..db6aa9c
--- /dev/null
+++ b/uploads/a209c8f1fe6b51df669b58bab1300199/dbus-session.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/bash
+
+LIGHT_GRAY="\[\033[1m\]"
+NO_COLOR="\[\033[0m\]"
+export PS1="[$LIGHT_GRAY D-Bus \$(echo \$DBUS_SESSION_BUS_ADDRESS | sed -e
's/.*guid=\([a-z0-9]\{4\}\).*$/\1/') $NO_COLOR][\u@\h \W]$ "
+
+ENV_FILE="$XDG_RUNTIME_DIR/nested-dbus-session.txt"
+
+if [ "x$1" = "x-x" ];then
+ export DBUS_SESSION_BUS_ADDRESS=$(cat $ENV_FILE)
+ bash -i
+elif [ "x$1" = "x-n" ];then
+ cat > /tmp/dbussessionbashrc << __EOF__
+. ~/.bashrc
+echo \$DBUS_SESSION_BUS_ADDRESS > $ENV_FILE
+__EOF__
+
+ dbus-run-session -- bash --init-file /tmp/dbussessionbashrc -i
+else
+ echo "Usage: $0 [-x|-n]"
+ exit 1
+fi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]