From 419dbdfc27afe4c10a9c30ae7895717e8a3969ff Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 23 Sep 2024 16:52:11 +0200 Subject: [PATCH] Add unified .xprofile for all systems --- .xprofile | 8 ++++++++ .xprofile.d/01-fix-keyboard.sh | 3 +++ .xprofile.d/50-fix-ssh-agent.sh | 5 +++++ .xprofile.d/50-xbindkeys.sh | 2 ++ 4 files changed, 18 insertions(+) create mode 100755 .xprofile create mode 100644 .xprofile.d/01-fix-keyboard.sh create mode 100644 .xprofile.d/50-fix-ssh-agent.sh create mode 100644 .xprofile.d/50-xbindkeys.sh diff --git a/.xprofile b/.xprofile new file mode 100755 index 0000000..868dfb8 --- /dev/null +++ b/.xprofile @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +[[ -d ${HOME}/.xprofile.d ]] && { + for lc in $(find ${HOME}/.xprofile.d -name '*.zsh' -o -name '*.sh'); do + [[ -e $lc ]] && source ${lc} || true + done +} || true diff --git a/.xprofile.d/01-fix-keyboard.sh b/.xprofile.d/01-fix-keyboard.sh new file mode 100644 index 0000000..343901d --- /dev/null +++ b/.xprofile.d/01-fix-keyboard.sh @@ -0,0 +1,3 @@ +# Fix Keyboard setup +setxkbmap -option '' +setxkbmap -layout us,de -option 'grp_led:scroll,grp:caps_toggle,compose:ralt' diff --git a/.xprofile.d/50-fix-ssh-agent.sh b/.xprofile.d/50-fix-ssh-agent.sh new file mode 100644 index 0000000..04bf82d --- /dev/null +++ b/.xprofile.d/50-fix-ssh-agent.sh @@ -0,0 +1,5 @@ +# Fix broken ssh-agent after crash +systemctl --user is-active ssh-agent.service | grep -q active || { + rm -f ~/.ssh/ssh_auth_sock + systemctl --user restart ssh-agent.service +} diff --git a/.xprofile.d/50-xbindkeys.sh b/.xprofile.d/50-xbindkeys.sh new file mode 100644 index 0000000..a850a98 --- /dev/null +++ b/.xprofile.d/50-xbindkeys.sh @@ -0,0 +1,2 @@ +killall xbindkeys || true +xbindkeys -p