aboutsummaryrefslogtreecommitdiff
path: root/openbsd/xenodm/GiveConsole
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-04-03 00:37:03 +0200
committerMateja <mail@matejamaric.com>2021-04-03 00:37:03 +0200
commita945feb02f6d64df2219ea1044251a7fe2ea98fc (patch)
treefe0242495eb35317fd5358e403a047657dfa04b5 /openbsd/xenodm/GiveConsole
downloadmisc-a945feb02f6d64df2219ea1044251a7fe2ea98fc.tar.gz
misc-a945feb02f6d64df2219ea1044251a7fe2ea98fc.zip
Initial commit.
Diffstat (limited to 'openbsd/xenodm/GiveConsole')
-rw-r--r--openbsd/xenodm/GiveConsole18
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsd/xenodm/GiveConsole b/openbsd/xenodm/GiveConsole
new file mode 100644
index 0000000..079392f
--- /dev/null
+++ b/openbsd/xenodm/GiveConsole
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Assign ownership of the console to the invoking user
+# $OpenBSD: GiveConsole,v 1.3 2019/05/12 11:53:06 jsg Exp $
+#
+# By convention, both xconsole and xterm -C check that the
+# console is owned by the invoking user and is readable before attaching
+# the console output. This way a random user can invoke xterm -C without
+# causing serious grief.
+#
+pkill xclock
+chown $USER /dev/console
+if [ -c /dev/drm0 ]; then
+ chown $USER /dev/drm0
+fi
+if [ -c /dev/drmR128 ]; then
+ chown $USER /dev/drmR128
+fi
+/usr/X11R6/bin/sessreg -a -l $DISPLAY -u none $USER