openbsd-dotfiles

Base configurations for my Openbsd desktop
git clone https://git.kausban.com/openbsd-dotfiles/raw/.git
Log | Files | Refs

GiveConsole (653B)


      1 #!/bin/sh
      2 # Assign ownership of the console to the invoking user
      3 # $OpenBSD: GiveConsole.in,v 1.2 2022/01/06 23:35:41 jsg Exp $
      4 #
      5 # By convention, both xconsole and xterm -C check that the
      6 # console is owned by the invoking user and is readable before attaching
      7 # the console output.  This way a random user can invoke xterm -C without
      8 # causing serious grief.
      9 #
     10 
     11 /usr/bin/pkill xclock
     12 
     13 prefix="/usr/X11R6"
     14 exec_prefix="${prefix}"
     15 
     16 chown $USER /dev/console
     17 if [ -c /dev/dri/card0 ]; then
     18     chown $USER /dev/dri/card0
     19 fi
     20 if [ -c /dev/dri/renderD128 ]; then
     21     chown $USER /dev/dri/renderD128
     22 fi
     23 ${exec_prefix}/bin/sessreg -a -l $DISPLAY -u none $USER