From 86ffff4315137c0d065f5407ed51dab0a830247b Mon Sep 17 00:00:00 2001 From: HonusBot Date: Sat, 15 May 2021 23:43:21 +0200 Subject: [PATCH] Use systemd temp folder --- honusbot-cli.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/honusbot-cli.sh b/honusbot-cli.sh index d35c683..aa92a8c 100755 --- a/honusbot-cli.sh +++ b/honusbot-cli.sh @@ -3,6 +3,10 @@ command="$1" shift args="$@" +temp_path="/tmp" +if [ -n "${XDG_RUNTIME_DIR}" ]; then + temp_path="${XDG_RUNTIME_DIR}" +fi picture_download_command="cat" picture_save_to_temp_command="cat" display_command_pipe="display -title \"HonusBot CLI\" -quiet" @@ -11,9 +15,9 @@ download_url_to_stdin=true if [ -x "$(command -v viu)" ]; then echo "Found viu" - picture_save_to_temp_command="tee /tmp/temp-honus.bin" + picture_save_to_temp_command="tee ${temp_path}/temp-honus.bin" display_command_pipe="cat > /dev/null" - display_command_after="viu /tmp/temp-honus.bin" + display_command_after="viu ${temp_path}/temp-honus.bin" download_url_to_stdin=true elif [ -x "$(command -v feh)" ]; then echo "Found feh"