[bin] Manually add static SWAYSOCK to externally called executables

This commit is contained in:
Sebastian Schulze 2022-04-09 21:23:50 +02:00
parent ccd4e965fa
commit ede1d846df
No known key found for this signature in database
GPG Key ID: F6BA63C6A7D3044E
3 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@
set -eo pipefail
BROWSER=qutebrowser
SWAYSOCK="/run/user/1000/sway-ipc.sock"
if ! pgrep $BROWSER > /dev/null; then
echo "Opening a new instance of ${BROWSER}"

View File

@ -8,7 +8,7 @@ if [[ "${NAME}" != '"ZSA Technology Labs Inc ErgoDox EZ Shine Keyboard"' ]] &&
exit 0
fi;
SWAYSOCK=/run/user/$(id -u)/sway-ipc.$(id -u).$(pgrep -x sway).sock
SWAYSOCK=/run/user/$(id -u)/sway-ipc.sock
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u)/bus"
export SWAYSOCK
export DBUS_SESSION_BUS_ADDRESS

View File

@ -2,6 +2,8 @@
set -eo pipefail
export SWAYSOCK=/run/user/1000/sway-ipc.sock
# Strip file:// protocol as file -b will handle this
argument=$(echo $1 | sed "s|file://||")
url_regex='^(https?|alfaview|mailto|ftp):/?/?.*'