summaryrefslogtreecommitdiff
path: root/config/GiveConsole.in
blob: c28299760fa087bd81a5b503b936097524528cd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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