aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/setsessionenv
blob: 85479e027bce3c6e6fd1fcd486b0bcabd06c972a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

# Create a file with the env variables of the current wayland session so that
# cron scripts can source it and function properly

printf "export PASSWORD_STORE_DIR=%s
export GTK2_RC_FILES=%s
export DISPLAY=%s
export WAYLAND_DISPLAY=%s
export XDG_SESSION_ID=%s
export XDG_SESSION_CLASS=%s
export XDG_SEAT=%s
export XDG_RUNTIME_DIR=%s
export DBUS_SESSION_BUS_ADDRESS=%s
export DBUS_SESSION_BUS_PID=%s
export I3SOCK=%s
export SWAYSOCK=%s
export NIRI_SOCKET=%s"\
  "$PASSWORD_STORE_DIR" \
  "$GTK2_RC_FILES" \
  "$DISPLAY" \
  "$WAYLAND_DISPLAY" \
  "$XDG_SESSION_ID" \
  "$XDG_SESSION_CLASS" \
  "$XDG_SEAT" \
  "$XDG_RUNTIME_DIR" \
  "$DBUS_SESSION_BUS_ADDRESS" \
  "$DBUS_SESSION_BUS_PID" \
  "$I3SOCK" \
  "$SWAYSOCK" \
  "$NIRI_SOCKET" > ~/.cache/sessionenv