summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-10-31 16:48:32 +0100
committerAnton Khirnov <anton@khirnov.net>2021-10-31 16:48:32 +0100
commit82c708cb0ed45809f7b1d64d29b7b8c539219cc2 (patch)
treed10da88f0d9c2253be1b5b9e220ac8461219644f
parentcaf58bd17270246ca5479cf3d287fa51e06d1e62 (diff)
Xsession: only run auxiliary utilities if they are installed
-rw-r--r--dotfiles/Xsession14
1 files changed, 10 insertions, 4 deletions
diff --git a/dotfiles/Xsession b/dotfiles/Xsession
index 0ee6946..ab17699 100644
--- a/dotfiles/Xsession
+++ b/dotfiles/Xsession
@@ -1,13 +1,19 @@
-#!/bin/sh
+#!/bin/bash
+
+run_if_exists() {
+ bin=$1
+ binpath=$(which "$bin")
+ [ -x "$binpath" ] && "$binpath" &
+}
# screen locker
-xscreensaver &
+run_if_exists xscreensaver
# keyboard layout indicator
-fbxkb &
+run_if_exists fbxkb
# clipboard manager
-parcellite &
+run_if_exists parcellite
# on FIDO HW key add/remove, update the SSH agent
udev_match --subsystem=hidraw --match=ACTION=remove --match=ID_FIDO_TOKEN=1 ssh_sk_clean &