From ffbec879fe80a0dc586517af738107bebac29c83 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Tue, 4 Jun 2024 13:04:42 +0200 Subject: [PATCH] Fix layout file being created twice --- gui/hypr/scripts.d/layout.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/hypr/scripts.d/layout.sh b/gui/hypr/scripts.d/layout.sh index b47e2d93..dabc9601 100755 --- a/gui/hypr/scripts.d/layout.sh +++ b/gui/hypr/scripts.d/layout.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Create layout file -cat << EOF >> /tmp/hyprland-layout.txt +[[ ! -f /tmp/hyprland-layout.txt ]] && cat << EOF >> /tmp/hyprland-layout.txt Hyprland Keybindings Listed in order of appearance in hyprland.conf @@ -56,8 +56,8 @@ Media keys --> Play previous track -> Audio Previous EOF +# Remove layout file +( sleep 1s; rm -rf /tmp/hyprland-layout.txt ) & + # Display layout file less /tmp/hyprland-layout.txt - -# Remove layout file -rm -rf /tmp/hyprland-layout.txt