aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2022-07-27 13:26:06 +1200
committerTom Ryder <tom@sanctum.geek.nz>2022-07-27 13:26:06 +1200
commit5fd82a3c8d25511f20e293b8dab8deec6e5f8c12 (patch)
treed58a975c9f6d73957fbc36a87f6dc78cb24c9b7c
parentAdd local bindir even if it doesn't exist yet (diff)
downloaddotfiles-5fd82a3c8d25511f20e293b8dab8deec6e5f8c12.tar.gz
dotfiles-5fd82a3c8d25511f20e293b8dab8deec6e5f8c12.zip
Add .xprofile
-rw-r--r--Makefile17
-rw-r--r--README.md2
-rw-r--r--check/x.sh1
-rw-r--r--check/xsession.sh1
-rw-r--r--lint/x.sh1
-rw-r--r--lint/xsession.sh1
-rw-r--r--man/man7/dotfiles.7df2
-rw-r--r--vim/filetype.vim2
-rw-r--r--x/xprofile5
-rw-r--r--x/xsession.sh6
10 files changed, 23 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index a82856b3..1f6ccd12 100644
--- a/Makefile
+++ b/Makefile
@@ -69,7 +69,7 @@
check-man \
check-sh \
check-urxvt \
- check-xsession \
+ check-x \
check-zsh \
lint \
lint-bash \
@@ -80,7 +80,7 @@
lint-sh \
lint-urxvt \
lint-vim \
- lint-xsession
+ lint-x
.SUFFIXES:
.SUFFIXES: .awk .bash .m4 .mi5 .pl .sed .sh
@@ -670,11 +670,12 @@ install-wget: install-sh
mkdir -p -- $(XDG_CACHE_HOME)/wget $(XDG_CONFIG_HOME)/wget
cp -p -- wget/wgetrc $(XDG_CONFIG_HOME)/wget/wgetrc
-install-x: x/xsession check-xsession install-logrotate
+install-x: x/xsession check-x install-logrotate
mkdir -p -- \
$(HOME)/.xsession.d \
$(HOME)/.Xresources.d \
$(XDG_CONFIG_HOME)/log/xsession
+ cp -p -- x/xprofile $(HOME)/.xprofile
cp -p -- x/xsession $(HOME)/.xsession
cp -p -- x/Xresources $(HOME)/.Xresources
cp -p -- x/Xresources.d/* $(HOME)/.Xresources.d
@@ -724,8 +725,8 @@ check-sh:
check-urxvt: urxvt/ext/select
sh check/urxvt.sh
-check-xsession: x/xsession
- sh check/xsession.sh
+check-x: x/xsession
+ sh check/x.sh
check-zsh:
sh check/zsh.sh
@@ -738,7 +739,7 @@ lint: lint-bash \
lint-sh \
lint-urxvt \
lint-vim \
- lint-xsession
+ lint-x
lint-bash: check-bash
sh lint/bash.sh
@@ -764,5 +765,5 @@ lint-urxvt: check-urxvt
lint-vim:
sh lint/vim.sh
-lint-xsession: check-xsession
- sh lint/xsession.sh
+lint-x: check-x
+ sh lint/x.sh
diff --git a/README.md b/README.md
index 3b89b34b..d8156671 100644
--- a/README.md
+++ b/README.md
@@ -657,7 +657,7 @@ available to run them:
- `lint-games`
- `lint-ksh`
- `lint-sh`
- - `lint-xsession`
+ - `lint-x`
- Perl::Critic:
- `lint-urxvt`
- [Vint](https://github.com/Kuniwak/vint):
diff --git a/check/x.sh b/check/x.sh
new file mode 100644
index 00000000..d2ec1435
--- /dev/null
+++ b/check/x.sh
@@ -0,0 +1 @@
+sh -n -- x/xprofile x/xsession
diff --git a/check/xsession.sh b/check/xsession.sh
deleted file mode 100644
index 0b72d8a6..00000000
--- a/check/xsession.sh
+++ /dev/null
@@ -1 +0,0 @@
-sh -n -- x/xsession
diff --git a/lint/x.sh b/lint/x.sh
new file mode 100644
index 00000000..070d0567
--- /dev/null
+++ b/lint/x.sh
@@ -0,0 +1 @@
+shellcheck -e SC1090 -e SC1091 -s sh -- x/xprofile x/xsession
diff --git a/lint/xsession.sh b/lint/xsession.sh
deleted file mode 100644
index dc291fd3..00000000
--- a/lint/xsession.sh
+++ /dev/null
@@ -1 +0,0 @@
-shellcheck -e SC1090 -s sh -- x/xsession
diff --git a/man/man7/dotfiles.7df b/man/man7/dotfiles.7df
index 8c19fbfe..8c766c05 100644
--- a/man/man7/dotfiles.7df
+++ b/man/man7/dotfiles.7df
@@ -1043,7 +1043,7 @@ ShellCheck (https://www.shellcheck.net/):
.IP \[bu] 2
\f[C]lint-sh\f[R]
.IP \[bu] 2
-\f[C]lint-xsession\f[R]
+\f[C]lint-x\f[R]
.RE
.IP \[bu] 2
Perl::Critic:
diff --git a/vim/filetype.vim b/vim/filetype.vim
index 589346b2..01cc0f3a 100644
--- a/vim/filetype.vim
+++ b/vim/filetype.vim
@@ -412,6 +412,7 @@ augroup filetypedetect
\,.shinit
\,.shrc
\,.xinitrc
+ \,.xprofile
\,.xsession
\,.xsessionrc
\,*/etc/default/*
@@ -420,6 +421,7 @@ augroup filetypedetect
\,shinit
\,shrc
\,xinitrc
+ \,xprofile
\,xsession
\,xsessionrc
\,*/etc/X11/xinit
diff --git a/x/xprofile b/x/xprofile
new file mode 100644
index 00000000..354df44b
--- /dev/null
+++ b/x/xprofile
@@ -0,0 +1,5 @@
+# Environment variables common to any X session
+
+# Update browser, since .profile set this to a curses browser on login
+# shellcheck disable=SC2034
+BROWSER=x-www-browser
diff --git a/x/xsession.sh b/x/xsession.sh
index 483707e6..0219c87d 100644
--- a/x/xsession.sh
+++ b/x/xsession.sh
@@ -1,8 +1,8 @@
# Custom X session to fit into Debian's way of doing things
-# Update browser, since .profile set this to a curses browser on login
-# shellcheck disable=SC2034
-BROWSER=x-www-browser
+# Load common environment variables
+# shellcheck disable=SC1091
+. "$HOME"/.profile
# Monitor and wallpaper setup is very machine-specific, and isn't versioned in
# here. Neither xrandr(1) nor xwallpaper(1) have config files, so we fake it