diff --git a/README.md b/README.md index 1171edf..475bd25 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Configuration and scripts targeting: - Portability: - POSIX compliant code - Drop-in configuration files - - Tested in Qubes OS Dom0, Debian, Fedora + - Tested in Qubes OS Dom0, Debian, Fedora, OpenBSD - Tasks: - GUI: x11, gtk - SCM: git, tig, git-shell diff --git a/files/git/.config/git/config b/files/git/.config/git/config index e73c948..e5d9ad9 100644 --- a/files/git/.config/git/config +++ b/files/git/.config/git/config @@ -77,7 +77,7 @@ ; Signed tags and commits stag = "!sh -c '\ commit_id=\"$(git rev-parse --verify \"$@\")\"; \ - tag_name=\"signed_tag_for_$(echo $commit_id | head -c 8)\"; \ + tag_name=\"signed_tag_for_$(echo $commit_id | cut -c 1-8)\"; \ git tag -s \"$tag_name\" \ -m \"Tag for commit $commit_id\" \"$commit_id\"; \ echo \"$tag_name\"'" - diff --git a/files/git/.local/bin/git-server-setup b/files/git/.local/bin/git-server-setup index 115ba3b..3c9a587 100755 --- a/files/git/.local/bin/git-server-setup +++ b/files/git/.local/bin/git-server-setup @@ -39,7 +39,7 @@ chmod -R 0755 "$git_home/git-shell-commands" git config --system receive.updateServerInfo true git config --system receive.advertisePushOptions true -nonce="$(head /dev/urandom | LC_ALL=C tr -dc 'A-Za-z0-9!#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c 256)" +nonce="$(head /dev/urandom | LC_ALL=C tr -dc 'A-Za-z0-9!#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | cut -c 1-256)" git config --system receive.certNonceSeed "$nonce" chown -R "$git_user":"$git_user" "$git_home" diff --git a/files/sh/.config/bash/bashrc b/files/sh/.config/bash/bashrc index 974f3c1..f2b68c5 100644 --- a/files/sh/.config/bash/bashrc +++ b/files/sh/.config/bash/bashrc @@ -46,7 +46,7 @@ _reset_line() { local termios cur_y ## Ask the terminal for any pending (line buffered) input. - termios=$(stty --save) && stty -icanon && stty "$termios" + termios=$(stty -g) && stty -icanon && stty "$termios" ## On pending input, assume it's been echoed and we're not in first column. ## Otherwise ask the terminal for current column and read it from input. if read -t 0 || { diff --git a/files/sh/.config/sh/profile b/files/sh/.config/sh/profile index e62dc01..4919fa5 100644 --- a/files/sh/.config/sh/profile +++ b/files/sh/.config/sh/profile @@ -94,12 +94,19 @@ KDEHOME="$XDG_CONFIG_HOME/kde" #KDEROOTHOME="/root/.config/kde" INPUTRC="$BASHDIR/inputrc" if has less; then - if test "$(less -V | awk -F '[ .]' 'NR==1 {print $2}')" -ge 582; then + lesskey_src=0 + less_version="$(less -V | awk -F '[ .]' 'NR==1 {print $2}')" + case "${less_version}" in + ""|*[!0-9]*) ;; + *) if test "${less_version}" -ge 582; then lesskey_src=1; fi;; + esac + if test "${lesskey_src}" = "1"; then LESSKEY="$XDG_CONFIG_HOME/less/lesskey" elif has lesskey; then LESSKEY="$XDG_CONFIG_HOME/less/lesskey-old" lesskey -o "$LESSKEY" "$XDG_CONFIG_HOME/less/lesskey" fi + unset lesskey_src less_version fi export GTK2_RC_FILES KDEHOME KDEROOTHOME INPUTRC LESSKEY diff --git a/files/sh/.config/sh/shrc b/files/sh/.config/sh/shrc index 84ce5ec..dce4bac 100644 --- a/files/sh/.config/sh/shrc +++ b/files/sh/.config/sh/shrc @@ -38,7 +38,9 @@ if has lsblk; then alias lsblk='lsblk -o $_lsblk_options' alias lsblku='lsblk -o $_lsblk_options,UUID,PARTUUID' fi -if ! grep --color 2>&1 | grep -q "unrecognized option"; then +if ! grep --color 2>&1 | grep -qE "(unrecognized|unknown) option" && + ! grep --exclude 2>&1 | grep -qE "(unrecognized|unknown) option" +then alias grep="grep --exclude='.*.swp' --exclude='*~' --color=auto" fi alias fgrep="grep -F" @@ -210,7 +212,7 @@ _git_prompt_info(){ fi ref="$(git symbolic-ref HEAD 2>/dev/null | cut -d '/' -f3)" test "${ref-}" || ref="$(git describe --tags --exact-match HEAD 2>/dev/null)" - test "${ref-}" || ref="$(git rev-parse HEAD 2>/dev/null | head -c 7)" + test "${ref-}" || ref="$(git rev-parse HEAD 2>/dev/null | cut -c 1-7)" test "${ref-}" || return # shellcheck disable=2039,3003 case "${TERM-}" in diff --git a/files/sh/.config/zsh/.zprofile b/files/sh/.config/zsh/.zprofile index c2d17fd..7638a5b 100644 --- a/files/sh/.config/zsh/.zprofile +++ b/files/sh/.config/zsh/.zprofile @@ -8,5 +8,7 @@ ## some distributions such as Qubes, Whonix, Debian, Gentoo ship files to ## /etc/profile.d. -emulate sh -c "source /etc/profile" +if test -r /etc/profile; then + emulate sh -c "source /etc/profile" +fi . "$HOME/.profile" diff --git a/files/sh/.config/zsh/.zshrc b/files/sh/.config/zsh/.zshrc index 051b192..a858ac2 100644 --- a/files/sh/.config/zsh/.zshrc +++ b/files/sh/.config/zsh/.zshrc @@ -71,7 +71,7 @@ if test "${color_prompt-}" = "yes"; then autoload -U colors && colors [[ "${COLORTERM-}" == (24bit|truecolor) || "${terminfo[colors]}" -eq '16777216' ]] || zmodload zsh/nearcolor - PS1="\$(resize-terminal)%F{magenta}[%{$usercolor%}%n@%M%F{reset_color%} %{$dircolor%}%50<...<%~%<<%F{reset_color%}\$(_git_prompt_info)%F{magenta}]%F{reset_color}${newline-}${ps1_symbol} " + PS1="\$(resize-terminal)%F{magenta}[%{$usercolor%}%n@%m%F{reset_color%} %{$dircolor%}%50<...<%~%<<%F{reset_color%}\$(_git_prompt_info)%F{magenta}]%F{reset_color}${newline-}${ps1_symbol} " RPS1="%(?..(%{"$'\e[31m'"%}%?%{$reset_color%}%)%<<)" else PS1="\$(resize-terminal)[%n@%M %~\$(_git_prompt_info)]${newline}${ps1_symbol} "