Created
April 29, 2022 14:58
-
-
Save ormaaj/78ab9692b891c14068c2fa42375a5dc8 to your computer and use it in GitHub Desktop.
xinitrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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