From ce196b3436c74cbbffb68c98b8743c12e421930a Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Wed, 3 Feb 2021 11:18:04 +0100 Subject: sxhkd --- sxhkd/log/run | 1 + sxhkd/run | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 120000 sxhkd/log/run create mode 100755 sxhkd/run (limited to 'sxhkd') diff --git a/sxhkd/log/run b/sxhkd/log/run new file mode 120000 index 0000000..04b2c93 --- /dev/null +++ b/sxhkd/log/run @@ -0,0 +1 @@ +../../.log/run \ No newline at end of file diff --git a/sxhkd/run b/sxhkd/run new file mode 100755 index 0000000..82504bb --- /dev/null +++ b/sxhkd/run @@ -0,0 +1,24 @@ +#!/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 + +env_full_path=$PWD/env + +cd $HOME +exec s6-envdir $env_full_path sxhkd -- cgit v1.2.3