summaryrefslogtreecommitdiff
path: root/config/GiveConsole.in
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2021-08-30 15:38:28 +0000
committerMatthieu Herrb <matthieu@herrb.eu>2021-08-30 20:41:27 +0200
commit4fa5bb88de05a7af4acd4a96f0185a2b55264844 (patch)
treeda1a4130d8c3be99f45d00deeafa843f11ca9f19 /config/GiveConsole.in
parent2da2e9923a5ec3641444ea0bd5f0fab508b3aeea (diff)
Generate all the config scripts to avoid hard-coding /usr/X11R6.HEADmaster
This was already done partially.
Diffstat (limited to 'config/GiveConsole.in')
-rw-r--r--config/GiveConsole.in26
1 files changed, 26 insertions, 0 deletions
diff --git a/config/GiveConsole.in b/config/GiveConsole.in
new file mode 100644
index 0000000..c282997
--- /dev/null
+++ b/config/GiveConsole.in
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Assign ownership of the console to the invoking user
+# $OpenBSD: GiveConsole.in,v 1.1 2021/08/30 15:38:27 matthieu 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.
+#
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+
+chown $USER /dev/console
+if [ -c /dev/drm0 ]; then
+ chown $USER /dev/drm0
+fi
+if [ -c /dev/drmR128 ]; then
+ chown $USER /dev/drmR128
+fi
+if [ -c /dev/dri/card0 ]; then
+ chown $USER /dev/dri/card0
+fi
+if [ -c /dev/dri/renderD128 ]; then
+ chown $USER /dev/dri/renderD128
+fi
+@bindir@/sessreg -a -l $DISPLAY -u none $USER