blob: 10b408899be8ca0471fe0ae18e6590362cd48d30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/sh
tmux_dbus="$DBUS_SESSION_BUS_ADDRESS"
fcitx5_pid=$(pgrep -f fcitx5 | head -n1)
if [ -z "$fcitx5_pid" ]; then
echo "No terminal process found matching: fcitx5"
exit 1
fi
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" != "$fcitx5_dbus" ]; then
export DBUS_SESSION_BUS_ADDRESS="$fcitx5_dbus"
fi
|