From 5a7db2f34aa6a6787d98a001b6d28be97f36abf4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 25 Jun 2021 12:56:30 +0200 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- xorg-xinit/Makefile | 36 ++++++++++++++++++++++++++++++++++++ xorg-xinit/bash-aliases | 9 +++++++++ xorg-xinit/xinit | 7 +++++++ xorg-xinit/xinitrc | 30 ++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 xorg-xinit/Makefile create mode 100644 xorg-xinit/bash-aliases create mode 100644 xorg-xinit/xinit create mode 100644 xorg-xinit/xinitrc (limited to 'xorg-xinit') diff --git a/xorg-xinit/Makefile b/xorg-xinit/Makefile new file mode 100644 index 0000000..1c37d2f --- /dev/null +++ b/xorg-xinit/Makefile @@ -0,0 +1,36 @@ +.POSIX: + +XINITRC_ORDER = 50 + +# Testing that xmonad is installed because it is the default sessions +# Testing that asroot, xorg-setxkbmap, and xorg-xmodmap are installed because setkeys uses them +install: + pacman -Qq -- asroot /dev/null + pacman -Qq -- dconf /dev/null + pacman -Qq -- xmonad /dev/null + pacman -Qq -- xorg-setxkbmap /dev/null + pacman -Qq -- xorg-xmodmap /dev/null + pacman -Qq -- xorg-xrandr /dev/null + pacman -Qq -- xorg-xrdb /dev/null + pacman -Qq -- xorg-xset /dev/null + pacman -Qq -- xorg-xsetroot /dev/null + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/xorg-xinit + ln -sf -- ~/.dotfiles/xorg-xinit/bash-aliases ~/.config/bash/aliases.d/xorg-xinit + mkdir -p -- ~/.config/X11/xinit + test ! -d ~/.config/X11/xinit/xinitrc + ln -sf -- ~/.dotfiles/xorg-xinit/xinitrc ~/.config/X11/xinit/xinitrc + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xinit + ln -sf -- ~/.dotfiles/xorg-xinit/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xinit + +uninstall: + -unlink -- ~/.config/bash/aliases.d/xorg-xinit + -rmdir -- ~/.config/bash/aliases.d + -unlink -- ~/.config/X11/xinit/xinitrc + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xinit + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/xorg-xinit/bash-aliases b/xorg-xinit/bash-aliases new file mode 100644 index 0000000..14b2000 --- /dev/null +++ b/xorg-xinit/bash-aliases @@ -0,0 +1,9 @@ +# -*- shell-script -*- + +if test "$TERM" = dumb; then + alias startx='printf '\''\e[1;31m%s\e[0m\n\c'\'' "Do not start an X session from a dumb terminal"; false' + alias xinit='printf '\''\e[1;31m%s\e[0m\n\c'\'' "Do not start an X session from a dumb terminal"; false' +elif test ! "$TERM" = linux || test -n "$DISPLAY"; then + alias startx='printf '\''\e[1;31m%s\e[0m\n\c'\'' "Do not start an X session from within an X session"; false' + alias xinit='printf '\''\e[1;31m%s\e[0m\n\c'\'' "Do not start an X session from within an X session"; false' +fi diff --git a/xorg-xinit/xinit b/xorg-xinit/xinit new file mode 100644 index 0000000..bd1874c --- /dev/null +++ b/xorg-xinit/xinit @@ -0,0 +1,7 @@ +# -*- shell-script -*- + +for f in /etc/X11/xinit/xinitrc.d/*; do + if test -r "$f"; then + . -- "$f" + fi +done diff --git a/xorg-xinit/xinitrc b/xorg-xinit/xinitrc new file mode 100644 index 0000000..5d6a3ab --- /dev/null +++ b/xorg-xinit/xinitrc @@ -0,0 +1,30 @@ +# -*- shell-script -*- + +# Get selected session +default_session=xmonad +SESSION_="$SESSION" +if test -z "$SESSION" = ""; then + SESSION="$default_session" + SESSION_="$SESSION" +fi + +# Export DESKTOP_SESSION +if [ ! "${SET_DESKTOP_SESSION}" = n ]; then + export DESKTOP_SESSION="$SESSION" +fi + +# Apply package specific settings and run package specific programs +for f in ~/.config/X11/xinit/xinitrc.d/*; do + if test -r "$f"; then + . -- "$f" + fi +done + +# Set keyboard settings +setkeys + +# Start hotkey daemon +xkbdbind & + +# Start session +exec ${SESSION_WRAPPER} "$SESSION" -- cgit v1.2.3-70-g09d2