summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2021-01-08 13:16:38 +0100
committerGuillermo Ramos2021-01-08 13:16:38 +0100
commit611f5c069ec67fdb032e9b7d77502d96368dc4a1 (patch)
treecd859dc4808ec6645a0c29bd9b649a9d201b7a47
parente0f54a7413f3a7c5eff0d02f7e9652f2498ddebd (diff)
downloads6-services-611f5c069ec67fdb032e9b7d77502d96368dc4a1.tar.gz
Add xbindkeys service
l---------xbindkeys/log/run1
-rwxr-xr-xxbindkeys/run23
2 files changed, 24 insertions, 0 deletions
diff --git a/xbindkeys/log/run b/xbindkeys/log/run
new file mode 120000
index 0000000..04b2c93
--- /dev/null
+++ b/xbindkeys/log/run
@@ -0,0 +1 @@
+../../.log/run \ No newline at end of file
diff --git a/xbindkeys/run b/xbindkeys/run
new file mode 100755
index 0000000..a280cee
--- /dev/null
+++ b/xbindkeys/run
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -x
+
+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