From cbfd974f652a12c601a95ea6d364549f45cb87e3 Mon Sep 17 00:00:00 2001
From: Yaroslav <contact@yaroslavps.com>
Date: Mon, 6 Apr 2020 02:30:09 +0300
Subject: improved script for pacman package download cron job; waybar
 improvements

---
 dotfiles/.local/bin/setsessionenv | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100755 dotfiles/.local/bin/setsessionenv

(limited to 'dotfiles/.local/bin/setsessionenv')

diff --git a/dotfiles/.local/bin/setsessionenv b/dotfiles/.local/bin/setsessionenv
new file mode 100755
index 0000000..8d8459d
--- /dev/null
+++ b/dotfiles/.local/bin/setsessionenv
@@ -0,0 +1,21 @@
+#!/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 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 I3SOCK=%s
+export SWAYSOCK=%s"\
+  "$DISPLAY" \
+  "$WAYLAND_DISPLAY" \
+  "$XDG_SESSION_ID" \
+  "$XDG_SESSION_CLASS" \
+  "$XDG_SEAT" \
+  "$XDG_RUNTIME_DIR" \
+  "$I3SOCK" \
+  "$SWAYSOCK" > ~/.cache/sessionenv
-- 
cgit v1.2.3