summaryrefslogtreecommitdiff
path: root/xbindkeys/run
blob: 6e5b6e9ec9ea075e9c6124054775a426a0370bb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

xdg_runtime_dir=$(id -ur | sed 's:^:/run/user/:')
test -d "$xdg_runtime_dir" || exit -1;

mkdir -p env

echo "$xdg_runtime_dir" \
    > env/XDG_RUNTIME_DIR

ls /tmp/.X11-unix | tr 'X' ':' | head -n1 \
    > env/DISPLAY

user_home=$(id -urn | xargs getent passwd | cut -d: -f6)
local_bin="$user_home/.local/bin"
path="/bin:/usr/bin"
test -d "$local_bin" && path="$path:$local_bin"
echo "$path" \
    > env/PATH

exec s6-envdir env xbindkeys -n -v