summaryrefslogtreecommitdiff
path: root/runas
diff options
context:
space:
mode:
authorTslil Clingman <tslil.clingman@gmail.com>2015-08-11 14:45:21 +0200
committerTslil Clingman <tslil.clingman@gmail.com>2015-08-11 14:45:21 +0200
commit4042f1622a4f3a26270894dfcb0da7ff4f6d3745 (patch)
tree75a733190bd9d27a4791cd86f34d6e49adba2185 /runas
parent648365197b36e8abf98c856533cd5e88143df15b (diff)
Tings
Diffstat (limited to 'runas')
-rwxr-xr-xrunas16
1 files changed, 16 insertions, 0 deletions
diff --git a/runas b/runas
new file mode 100755
index 0000000..f9b11f6
--- /dev/null
+++ b/runas
@@ -0,0 +1,16 @@
+#!/usr/bin/env sh
+
+# Simple script to run graphical programme as a separate user
+
+# The user is expected to have a script $1 which does, roughly:
+# cd /home/USERNAME
+# cp /tmp/.Xauthority .
+# shred -v /tmp/.Xauthority
+# DISPLAY=:0 some/graphical/programme
+
+cp .Xauthority /tmp
+chmod 606 /tmp/.Xauthority
+
+su -l $1 -c /home/$1/$1
+
+rm /tmp/.Xauthority