From 82c708cb0ed45809f7b1d64d29b7b8c539219cc2 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 31 Oct 2021 16:48:32 +0100 Subject: Xsession: only run auxiliary utilities if they are installed --- dotfiles/Xsession | 14 ++++++++++---- 1 file 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 & -- cgit v1.2.3