From fc075cc8bfa597011a2634a55e50a71e847bc6d8 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 30 Apr 2022 22:05:32 +1200 Subject: Use .xsession as executable script --- X/xsession | 47 ----------------------------------------------- X/xsession.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 47 deletions(-) delete mode 100644 X/xsession create mode 100755 X/xsession.sh (limited to 'X') diff --git a/X/xsession b/X/xsession deleted file mode 100644 index daef7e42..00000000 --- a/X/xsession +++ /dev/null @@ -1,47 +0,0 @@ -# If a file ~/.xrandrrc exists for monitor setup, source that first of all and -# wait for it to finish, so that window geometries and monitor order make sense -# for the rest of the session setup. -# -# shellcheck disable=SC1091 -if [ -e "$HOME"/.xrandrrc ] ; then - . "$HOME"/.xrandrrc -fi - -# Set the background, one of two ways: -## 1. If there's a ~/.fehbg from a prior run, just re-run that -if [ -x "$HOME"/.fehbg ] ; then - "$HOME"/.fehbg & -## 2. Otherwise, apply a random background image, if the relevant dir exists -elif [ -d "${XBACKGROUNDS:-"$HOME"/.xbackgrounds}" ] ; then - xrbg & -fi - -# Set a few keyboard map options -# - Remap right Alt as a Compose key -# - Remap Caps Lock as another Control key -# - Kill X server with Ctrl+Alt+Backspace -setxkbmap \ - -option compose:ralt \ - -option ctrl:nocaps \ - -option terminate:ctrl_alt_bksp & - -# Set fast mouse acceleration with a natural threshold -xset mouse 5/2 0 & - -# Pick a GUI browser, depending on availability -if command -v librewolf >/dev/null 2>&1 ; then - BROWSER=librewolf -elif command -v firefox >/dev/null 2>&1 ; then - BROWSER=firefox -fi -export BROWSER - -# Load all supplementary scripts in ~/.xsession.d -for sh in "$HOME"/.xsession.d/*.sh ; do - [ -e "$sh" ] || continue - . "$sh" -done -unset -v sh - -# Start i3 window manager now that everything's ready -exec i3 diff --git a/X/xsession.sh b/X/xsession.sh new file mode 100755 index 00000000..daef7e42 --- /dev/null +++ b/X/xsession.sh @@ -0,0 +1,47 @@ +# If a file ~/.xrandrrc exists for monitor setup, source that first of all and +# wait for it to finish, so that window geometries and monitor order make sense +# for the rest of the session setup. +# +# shellcheck disable=SC1091 +if [ -e "$HOME"/.xrandrrc ] ; then + . "$HOME"/.xrandrrc +fi + +# Set the background, one of two ways: +## 1. If there's a ~/.fehbg from a prior run, just re-run that +if [ -x "$HOME"/.fehbg ] ; then + "$HOME"/.fehbg & +## 2. Otherwise, apply a random background image, if the relevant dir exists +elif [ -d "${XBACKGROUNDS:-"$HOME"/.xbackgrounds}" ] ; then + xrbg & +fi + +# Set a few keyboard map options +# - Remap right Alt as a Compose key +# - Remap Caps Lock as another Control key +# - Kill X server with Ctrl+Alt+Backspace +setxkbmap \ + -option compose:ralt \ + -option ctrl:nocaps \ + -option terminate:ctrl_alt_bksp & + +# Set fast mouse acceleration with a natural threshold +xset mouse 5/2 0 & + +# Pick a GUI browser, depending on availability +if command -v librewolf >/dev/null 2>&1 ; then + BROWSER=librewolf +elif command -v firefox >/dev/null 2>&1 ; then + BROWSER=firefox +fi +export BROWSER + +# Load all supplementary scripts in ~/.xsession.d +for sh in "$HOME"/.xsession.d/*.sh ; do + [ -e "$sh" ] || continue + . "$sh" +done +unset -v sh + +# Start i3 window manager now that everything's ready +exec i3 -- cgit v1.2.3