diff options
author | Yigit Sever | 2024-08-08 11:01:06 +0200 |
---|---|---|
committer | Yigit Sever | 2024-08-08 11:01:06 +0200 |
commit | 45550488f9f4effc3b9dc5bc0fc4c25c130d69fd (patch) | |
tree | dd306773bd27caa99385e07c42491cfbb47a0e0e /.local/bin | |
parent | e7133668e8cd3909d808678f0b690052f75a3d52 (diff) | |
download | dotfiles-45550488f9f4effc3b9dc5bc0fc4c25c130d69fd.tar.gz dotfiles-45550488f9f4effc3b9dc5bc0fc4c25c130d69fd.tar.bz2 dotfiles-45550488f9f4effc3b9dc5bc0fc4c25c130d69fd.zip |
mailsync: add wayland/x11 guard
Diffstat (limited to '.local/bin')
-rwxr-xr-x | .local/bin/mailsync | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/.local/bin/mailsync b/.local/bin/mailsync index 40a2dee..abb4c18 100755 --- a/.local/bin/mailsync +++ b/.local/bin/mailsync | |||
@@ -27,7 +27,14 @@ command -v notify-send > /dev/null || echo 'Note that `libnotify` or `libnotify- | |||
27 | 27 | ||
28 | # Required to display notifications if run as a cronjob: | 28 | # Required to display notifications if run as a cronjob: |
29 | export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus | 29 | export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus |
30 | export DISPLAY=:0.0 | 30 | |
31 | SESH=$(loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}') | ||
32 | |||
33 | if [[ "$SESH" = "wayland" ]]; then | ||
34 | export WAYLAND_DISPLAY=wayland-1 | ||
35 | else | ||
36 | export DISPLAY=:0.0 | ||
37 | fi | ||
31 | 38 | ||
32 | # For individual configurations: | 39 | # For individual configurations: |
33 | [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" | 40 | [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" |