File: xbindkeys_autostart

package info (click to toggle)
xbindkeys 1.8.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 972 kB
  • sloc: ansic: 4,518; sh: 4,281; lisp: 112; tcl: 39; makefile: 30
file content (27 lines) | stat: -rw-r--r-- 708 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

set -e
set -u
set -E

PROG="/usr/bin/xbindkeys"
NOAUTO="${HOME}/.xbindkeys.noauto"

# This file autostarts xbindkeysrc if the user (or system) has a config
# for it AND does NOT Have a .xbindkeys.noauto in his homedir.

# we only run if there is no NOAUTO file
if ! [[ -f ${NOAUTO} ]] && [[ -x ${PROG} ]]; then
    # User config wins over system config
    # guile config wins over classic config
    for cfile in "/etc/xbindkeysrc" "$HOME/.xbindkeysrc" "$HOME/.xbindkeysrc.scm"; do
        if [[ -f ${cfile} ]] || [[ -L ${cfile} ]]; then
            CONF="${cfile}"
        fi
    done

    # Run $PROG - if it has been configured
    if [ -n "${CONF}" ]; then
        $PROG -f $CONF
    fi
fi