POSIX compliance, shellcheck

This commit is contained in:
ItsDrike 2021-12-18 18:09:25 +01:00
parent d843e90462
commit 826cef4e6e
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843
5 changed files with 114 additions and 96 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
# Environmental variable definitions.
# This file is only sourced once after login, unlike .zshrc/.bashrc
@ -8,6 +8,8 @@
# which means the XDG definitions will be ignored anyway, and
# defining them may break programs when root is actually logged in.
# Define some variables for POSIX compatibility
uid="$(id -u)"
# Default programs
export EDITOR="nvim"
@ -18,7 +20,7 @@ export TERMINAL="alacritty"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_RUNTIME_DIR="/run/user/$UID"
export XDG_RUNTIME_DIR="/run/user/$uid"
# Per-Application XDG settings
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
@ -44,6 +46,7 @@ export NERDTREE_BOOKMARKS="$XDG_CONFIG_HOME/NERDTreeBookmarks"
# Colorful man pages
# If bat is installed, use it as manpager
# shellcheck disable=SC2155
if command -v bat > /dev/null; then
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
else
@ -64,3 +67,6 @@ export XSECURELOCK_SHOW_DATETIME=1 # Show current date and time in xsecurelock
export QT_QPA_PLATFORMTHEME=qt5ct # Have QT use the theme from qt5ct
#export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
# Remove irrelevant variables added for posix compatibility
unset posix