Skip to content

Instantly share code, notes, and snippets.

@ormaaj
Created April 29, 2022 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ormaaj/78ab9692b891c14068c2fa42375a5dc8 to your computer and use it in GitHub Desktop.
Save ormaaj/78ab9692b891c14068c2fa42375a5dc8 to your computer and use it in GitHub Desktop.
xinitrc
#!/bin/bash
shopt -s extglob lastpipe
shopt -u assoc_expand_once
function xinitrc_main {
typeset myRootPath
if myRootPath=$(dirname "$(readlink -sne -- "${BASH_SOURCE[0]}")") && [[ -d $myRootPath ]]; then
source "${myRootPath}/shell/functions"
typeset -A d=(
[KDE]=startplasma-x11
[XFCE]=startxfce4
)
typeset x
for x in KDE XFCE; do
if d[$x]=$(type -P -- "${d[$x]}"); then
typeset -gx DE=${XDG_CURRENT_DESKTOP:-$x}
exec "${d[$x]}"
fi
done
fi
}
xinitrc_main
# vim: set fenc=utf-8 ff=unix ft=sh :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment