use default xinit scripts again
This commit is contained in:
parent
0efcfda643
commit
08f30a9684
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
. "$XDG_CONFIG_HOME/X11/xprofile"
|
||||
|
||||
run-parts "$XDG_CONFIG_HOME/X11/xinitrc.d"
|
||||
|
||||
exec dbus-run-session -- dwm
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Any host specific display configuration goes here
|
||||
# This file is excluded from the dotsync script
|
2
.config/X11/xsession.d/60gpg-agent → .config/X11/xinitrc.d/60gpg-agent
Normal file → Executable file
2
.config/X11/xsession.d/60gpg-agent → .config/X11/xinitrc.d/60gpg-agent
Normal file → Executable file
|
@ -1,4 +1,4 @@
|
|||
# vim:set ft=sh:
|
||||
#!/bin/sh
|
||||
|
||||
if [ "${SSH_AUTH_SOCK:-0}" -ne $$ ]; then
|
||||
sock="$(gpgconf --list-dirs agent-ssh-socket)"
|
7
.config/X11/xsession.d/80autostart → .config/X11/xinitrc.d/80autostart
Normal file → Executable file
7
.config/X11/xsession.d/80autostart → .config/X11/xinitrc.d/80autostart
Normal file → Executable file
|
@ -1,14 +1,13 @@
|
|||
# vim:set ft=sh:
|
||||
#!/bin/sh
|
||||
|
||||
start() {
|
||||
pidof -sx $1 || $@ &
|
||||
}
|
||||
|
||||
xwallpaper --zoom "${XDG_DATA_HOME:-$HOME/.local/share}/bg" &
|
||||
killall remaps
|
||||
remaps &
|
||||
checkup &
|
||||
|
||||
start remaps
|
||||
start checkup
|
||||
start playerctld daemon
|
||||
start picom
|
||||
start unclutter -noevents
|
2
.config/X11/xsession.d/90xsecurelock → .config/X11/xinitrc.d/90xsecurelock
Normal file → Executable file
2
.config/X11/xsession.d/90xsecurelock → .config/X11/xinitrc.d/90xsecurelock
Normal file → Executable file
|
@ -1,4 +1,4 @@
|
|||
# vim:set ft=sh:
|
||||
#!/bin/sh
|
||||
|
||||
export XSECURELOCK_AUTH_BACKGROUND_COLOR="#24283b"
|
||||
export XSECURELOCK_AUTH_FOREGROUND_COLOR="#c0caf5"
|
3
.config/X11/xsession.d/99host-setup → .config/X11/xinitrc.d/99host-setup
Normal file → Executable file
3
.config/X11/xsession.d/99host-setup → .config/X11/xinitrc.d/99host-setup
Normal file → Executable file
|
@ -1,3 +1,4 @@
|
|||
# vim:set ft=sh:
|
||||
#!/bin/sh
|
||||
|
||||
# Any host specific configuration goes here
|
||||
# This file is excluded from the dotsync script
|
|
@ -1,125 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
PROGNAME=Xsession
|
||||
|
||||
OPTIONFILE=/etc/X11/Xsession.options
|
||||
|
||||
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/X11/xresources" ] && USRRESOURCES=${XDG_CONFIG_HOME:-$HOME/.config}/X11/xresources || USRRESOURCES=$HOME/.Xresources
|
||||
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/X11/xsession.d" ] && SESSIONDIR=${XDG_CONFIG_HOME:-$HOME/.config}/X11/xsession.d || SESSIONDIR=/etc/X11/Xsession.d
|
||||
[ -r "${XDG_DATA_HOME:-$HOME/.local/share}/xorg/xsession-errors" ] &&
|
||||
ERRFILE=${XDG_DATA_HOME:-$HOME/.local/share}/xorg/xsession-errors ||
|
||||
ERRFILE=$HOME/.xsession-errors && touch $ERRFILE
|
||||
|
||||
message() {
|
||||
# pretty-print messages of arbitrary length; use xmessage if it
|
||||
# is available and $DISPLAY is set
|
||||
MESSAGE="$PROGNAME: $*"
|
||||
echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
|
||||
# if [ -n "$DISPLAY" ] && command -v xmessage > /dev/null 2>&1; then
|
||||
# echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
|
||||
# fi
|
||||
}
|
||||
|
||||
message_nonl() {
|
||||
# pretty-print messages of arbitrary length (no trailing newline); use
|
||||
# xmessage if it is available and $DISPLAY is set
|
||||
MESSAGE="$PROGNAME: $*"
|
||||
echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
|
||||
# if [ -n "$DISPLAY" ] && command -v xmessage > /dev/null 2>&1; then
|
||||
# echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
|
||||
# fi
|
||||
}
|
||||
|
||||
errormsg() {
|
||||
# exit script with error
|
||||
message "$*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
internal_errormsg() {
|
||||
# exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
|
||||
# One big call to message() for the sake of xmessage; if we had two then
|
||||
# the user would have dismissed the error we want reported before seeing the
|
||||
# request to report it.
|
||||
errormsg "$*" \
|
||||
"Please report the installed version of the \"x11-common\"" \
|
||||
"package and the complete text of this error message to" \
|
||||
"<debian-x@lists.debian.org>."
|
||||
}
|
||||
|
||||
OPTIONS="$(
|
||||
if [ -r "$OPTIONFILE" ]; then
|
||||
cat "$OPTIONFILE"
|
||||
fi
|
||||
if [ -d /etc/X11/Xsession.options.d ]; then
|
||||
run-parts --list --regex '\.conf$' /etc/X11/Xsession.options.d | xargs -d '\n' cat
|
||||
fi
|
||||
)"
|
||||
|
||||
has_option() {
|
||||
# Ensure that a later no-foo overrides an earlier foo
|
||||
if [ "$(echo "$OPTIONS" | grep -Eo "^(no-)?$1\>" | tail -n 1)" = "$1" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# attempt to create an error file; abort if we cannot
|
||||
if (umask 077 && touch "$ERRFILE") 2>/dev/null && [ -w "$ERRFILE" ] &&
|
||||
[ ! -L "$ERRFILE" ]; then
|
||||
chmod 600 "$ERRFILE"
|
||||
elif ERRFILE=$(mktemp 2>/dev/null); then
|
||||
if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
|
||||
message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
|
||||
"\"$ERRFILE\"; look for session log/errors in" \
|
||||
"\"$TMPDIR/xsession-$USER\"."
|
||||
fi
|
||||
else
|
||||
errormsg "unable to create X session log/error file; aborting."
|
||||
fi
|
||||
|
||||
# truncate ERRFILE if it is too big to avoid disk usage DoS
|
||||
if [ "$(stat -c%s "$ERRFILE")" -gt 500000 ]; then
|
||||
T=$(mktemp -p "$HOME")
|
||||
tail -c 500000 "$ERRFILE" >"$T" && mv -f "$T" "$ERRFILE" || rm -f "$T"
|
||||
fi
|
||||
|
||||
exec >>"$ERRFILE" 2>&1
|
||||
|
||||
# sanity check; is our session script directory present?
|
||||
if [ ! -d "$SESSIONDIR" ]; then
|
||||
errormsg "no \"$SESSIONDIR\" directory found; aborting."
|
||||
fi
|
||||
|
||||
# Attempt to create a file of non-zero length in /tmp; a full filesystem can
|
||||
# cause mysterious X session failures. We do not use touch, :, or test -w
|
||||
# because they won't actually create a file with contents. We also let standard
|
||||
# error from mktemp and echo go to the error file to aid the user in
|
||||
# determining what went wrong.
|
||||
WRITE_TEST=$(mktemp)
|
||||
if ! echo "*" >>"$WRITE_TEST"; then
|
||||
message "warning: unable to write to ${WRITE_TEST%/*}; X session may exit" \
|
||||
"with an error"
|
||||
fi
|
||||
rm -f "$WRITE_TEST"
|
||||
|
||||
SESSIONFILES=$(run-parts --list $SESSIONDIR)
|
||||
if [ -n "$SESSIONFILES" ]; then
|
||||
set +e
|
||||
for SESSIONFILE in $SESSIONFILES; do
|
||||
message "Executing $SESSIONFILE"
|
||||
. $SESSIONFILE
|
||||
done
|
||||
set -e
|
||||
fi
|
||||
|
||||
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/X11/xprofile" ]; then
|
||||
. ${XDG_CONFIG_HOME:-$HOME/.config}/X11/xprofile
|
||||
else
|
||||
. $HOME/.xprofile
|
||||
fi
|
||||
|
||||
exec dwm
|
|
@ -1,23 +0,0 @@
|
|||
# vim:set ft=sh:
|
||||
|
||||
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && [ -n "$XDG_RUNTIME_DIR" ] &&
|
||||
[ "$XDG_RUNTIME_DIR" = "/run/user/$(id -u)" ] &&
|
||||
[ -S "$XDG_RUNTIME_DIR/bus" ]; then
|
||||
# We are under systemd-logind or something remarkably similar, and
|
||||
# a user-session socket has already been set up.
|
||||
#
|
||||
# Be nice to non-libdbus, non-sd-bus implementations by using
|
||||
# that as the session bus address in the environment. The check for
|
||||
# XDG_RUNTIME_DIR = "/run/user/`id -u`" is because we know that
|
||||
# form of the address, from systemd-logind, doesn't need escaping,
|
||||
# whereas arbitrary addresses might.
|
||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
|
||||
fi
|
||||
|
||||
if [ -x "/usr/bin/dbus-update-activation-environment" ]; then
|
||||
# tell dbus-daemon --session (and systemd --user, if running)
|
||||
# to put a minimal subset of the Xsession's environment in activated
|
||||
# services' environments
|
||||
dbus-update-activation-environment --verbose --systemd \
|
||||
DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY
|
||||
fi
|
|
@ -1,3 +0,0 @@
|
|||
# vim:set ft=sh:
|
||||
|
||||
xrdb -merge $USRRESOURCES
|
|
@ -1,3 +0,0 @@
|
|||
# vim:set ft=sh
|
||||
# Any host specific disylay configuration goes here
|
||||
# This file is excluded from the dotsync script
|
|
@ -1,23 +0,0 @@
|
|||
# vim:set ft=sh:
|
||||
|
||||
add_module() {
|
||||
case :$GTK_MODULES: in
|
||||
*:$1:*) ;;
|
||||
|
||||
*)
|
||||
if [ -z "$GTK_MODULES" ]; then
|
||||
GTK_MODULES=$1
|
||||
else
|
||||
GTK_MODULES=$GTK_MODULES:$1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
add_module gail
|
||||
add_module atk-bridge
|
||||
|
||||
export GTK_MODULES
|
||||
if [ -x "/usr/bin/dbus-update-activation-environment" ]; then
|
||||
dbus-update-activation-environment --verbose --systemd GTK_MODULES
|
||||
fi
|
|
@ -1,7 +0,0 @@
|
|||
# vim:set ft=sh:
|
||||
|
||||
export QT_ACCESSIBILITY=1
|
||||
|
||||
if [ -x "/usr/bin/dbus-update-activation-environment" ]; then
|
||||
dbus-update-activation-environment --verbose --systemd QT_ACCESSIBILITY
|
||||
fi
|
|
@ -17,11 +17,11 @@ export XDG_PICTURES_DIR="$HOME/Pictures"
|
|||
export XDG_PUBLICSHARE_DIR="$HOME/Public"
|
||||
export XDG_TEMPLATES_DIR="$HOME/Templates"
|
||||
export XDG_VIDEOS_DIR="$HOME/Videos"
|
||||
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export KEYMAPS_DIR="$HOME/.local/bin/keymaps"
|
||||
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
|
||||
|
||||
export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump"
|
||||
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
|
||||
export GTK2_RC_FILES="$XDG_CONFIG_HOME/.config}/gtk-2.0/gtkrc-2.0"
|
||||
|
@ -61,6 +61,3 @@ export ANSIBLE_NOCOWS=1 # Stop those fucking cows in Ansible
|
|||
|
||||
localpath="$(find -L ~/.local/bin -type d -printf %p: | sed 's/.$//')"
|
||||
export PATH="$PATH:$HOME/.local/share/npm-global/bin:$localpath"
|
||||
|
||||
# Start X Server if logging in on TTY1 and no other server is running
|
||||
[ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startgraphical
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
DISPLAY=:0
|
||||
|
||||
XKBDIR="${XDG_CONFIG_HOME:-$HOME/.config}/X11/xkb"
|
||||
XKBMAPFILE="$XKBDIR/keymap/$(hostname --fqdn)"
|
||||
XKBDIR="$XDG_CONFIG_HOME/X11/xkb"
|
||||
XKBMAPFILE="$XKBDIR/keymap/$(hostname)"
|
||||
[ -r "$XKBMAPFILE" ] || XKBMAPFILE="$XKBDIR/keymap/default"
|
||||
xkbcomp -I"$XKBDIR" "$XKBMAPFILE" "${DISPLAY%%.*}" 1>/dev/null 2>&1
|
||||
unset XKBDIR XKBMAPFILE
|
||||
|
|
|
@ -1,98 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/X11/xserverrc" ]; then
|
||||
server=${XDG_CONFIG_HOME:-$HOME/.config}/X11/xserverrc
|
||||
elif [ -r "$HOME/.xserverrc" ]; then
|
||||
server=$HOME/.xserverrc
|
||||
else
|
||||
server=/etc/X11/xinit/xserverrc
|
||||
fi
|
||||
|
||||
if [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/X11/xsession" ]; then
|
||||
client=${XDG_CONFIG_HOME:-$HOME/.config}/X11/xsession
|
||||
elif [ -r "$HOME/.xsession" ]; then
|
||||
client="$HOME/.xsession"
|
||||
else
|
||||
client=/etc/X11/xinit/xinitrc
|
||||
fi
|
||||
|
||||
# Automatically determine an unused $DISPLAY
|
||||
d=0
|
||||
while true; do
|
||||
[ -e "/tmp/.X$d-lock" ] || [ -S "/tmp/.X11-unix/X$d" ] || break
|
||||
d=$((d + 1))
|
||||
done
|
||||
display=":$d"
|
||||
unset d
|
||||
|
||||
if [ -z "${XAUTHORITY+x}" ]; then
|
||||
XAUTHORITY=$HOME/.Xauthority
|
||||
export XAUTHORITY
|
||||
fi
|
||||
|
||||
removelist=
|
||||
|
||||
# check for GNU hostname
|
||||
if hostname --version >/dev/null 2>&1; then
|
||||
if ! hostname --version 2>&1 | grep GNU -q; then
|
||||
hostname=$(hostname -f)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$hostname" ]; then
|
||||
hostname=$(hostname)
|
||||
fi
|
||||
|
||||
authdisplay=${display:-:0}
|
||||
|
||||
mcookie=$(/usr/bin/mcookie)
|
||||
|
||||
if [ -z "${mcookie+x}" ]; then
|
||||
echo "Couldn't create cookie"
|
||||
exit 1
|
||||
fi
|
||||
dummy=0
|
||||
|
||||
# create a file with auth information for the server. ':0' is a dummy.
|
||||
xserverauthfile=$(mktemp --tmpdir serverauth.XXXXXXXXXX)
|
||||
trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP BUS TERM
|
||||
xauth -q -f "$xserverauthfile" <<EOF
|
||||
add :$dummy . $mcookie
|
||||
EOF
|
||||
|
||||
serverargs=${serverargs}" -auth "${xserverauthfile}
|
||||
|
||||
# now add the same credentials to the client authority file
|
||||
# if '$displayname' already exists do not overwrite it as another
|
||||
# server may need it. Add them to the '$xserverauthfile' instead.
|
||||
for displayname in $authdisplay $hostname$authdisplay; do
|
||||
authcookie=$(xauth list "$displayname" | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p") 2>/dev/null
|
||||
if [ -n "${authcookie+x}" ]; then
|
||||
xauth -q <<EOF
|
||||
add $displayname . $mcookie
|
||||
EOF
|
||||
removelist="$displayname $removelist"
|
||||
else
|
||||
dummy=$((dummy + 1))
|
||||
xauth -q -f "$xserverauthfile" <<EOF
|
||||
add :$dummy . $authcookie
|
||||
EOF
|
||||
fi
|
||||
done
|
||||
|
||||
xinit $client -- $server $serverargs $display
|
||||
|
||||
retval=$?
|
||||
|
||||
if [ -z "${removelist+x}" ]; then
|
||||
xauth remove $removelist
|
||||
fi
|
||||
if [ x"$xserverauthfile" != x ]; then
|
||||
rm -f "$xserverauthfile"
|
||||
fi
|
||||
|
||||
if command -v deallocvt >/dev/null 2>&1; then
|
||||
deallocvt
|
||||
fi
|
||||
|
||||
exit $retval
|
||||
echo lol
|
||||
|
|
Loading…
Reference in New Issue