diff options
Diffstat (limited to 'ar/.local/bin/tmuxdbussync')
| -rwxr-xr-x | ar/.local/bin/tmuxdbussync | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/ar/.local/bin/tmuxdbussync b/ar/.local/bin/tmuxdbussync index ffebff9..10b4088 100755 --- a/ar/.local/bin/tmuxdbussync +++ b/ar/.local/bin/tmuxdbussync @@ -1,18 +1,16 @@ #!/bin/sh -TMUX_DBUS="$DBUS_SESSION_BUS_ADDRESS" -BROWSER="${BROWSER:-firefox}" -BROWSER_NAME=$(basename "$BROWSER") -BROWSER_PID=$(pgrep -f "$BROWSER_NAME" | head -n1) +tmux_dbus="$DBUS_SESSION_BUS_ADDRESS" +fcitx5_pid=$(pgrep -f fcitx5 | head -n1) -if [ -z "$BROWSER_PID" ]; then - echo "No browser process found matching: $BROWSER_NAME" +if [ -z "$fcitx5_pid" ]; then + echo "No terminal process found matching: fcitx5" exit 1 fi -BROWSER_DBUS=$(tr '\0' '\n' </proc/"$BROWSER_PID"/environ | grep DBUS_SESSION_BUS_ADDRESS) -BROWSER_DBUS="${BROWSER_DBUS#DBUS_SESSION_BUS_ADDRESS=}" +fcitx5_dbus=$(tr '\0' '\n' </proc/"$fcitx5_pid"/environ | grep DBUS_SESSION_BUS_ADDRESS) +fcitx5_dbus="${fcitx5_dbus#DBUS_SESSION_BUS_ADDRESS=}" -if [ "$TMUX_DBUS" != "$BROWSER_DBUS" ]; then - export DBUS_SESSION_BUS_ADDRESS="$BROWSER_DBUS" +if [ "$tmux_dbus" != "$fcitx5_dbus" ]; then + export DBUS_SESSION_BUS_ADDRESS="$fcitx5_dbus" fi |
