diff --git a/i3-settree b/i3-settree index 63dabc0..f64bb9c 100755 --- a/i3-settree +++ b/i3-settree @@ -97,9 +97,24 @@ step_act() { case "$choice" in Save) file="$treespath/$name-layout-$(date +%s%N).json" - if [ -f "$file" ]; then - log "Not clobbering existing layout file: $file" - return 60 + if command -v kdialog > /dev/null 2>&1; then + # Handle with kdialog + newpath="$(kdialog --getsavefilename "$file" "i3 Layout Trees (*.json)")" + # Shellcheck you're a dumb + # We need that output, man + #shellcheck disable=2181 + if ! [ $? -eq 0 ]; then + log "User canceled the save operation" + return 61 + else + file="$newpath" + fi + else + # Basic handling + if [ -f "$file" ]; then + log "Not clobbering existing layout file: $file" + return 60 + fi fi i3-save-tree > "$file" notify-send \