i3-settree: Add kdialog integration
This commit is contained in:
parent
06352b30a6
commit
022afcb4c0
21
i3-settree
21
i3-settree
@ -97,9 +97,24 @@ step_act() {
|
|||||||
case "$choice" in
|
case "$choice" in
|
||||||
Save)
|
Save)
|
||||||
file="$treespath/$name-layout-$(date +%s%N).json"
|
file="$treespath/$name-layout-$(date +%s%N).json"
|
||||||
if [ -f "$file" ]; then
|
if command -v kdialog > /dev/null 2>&1; then
|
||||||
log "Not clobbering existing layout file: $file"
|
# Handle with kdialog
|
||||||
return 60
|
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
|
fi
|
||||||
i3-save-tree > "$file"
|
i3-save-tree > "$file"
|
||||||
notify-send \
|
notify-send \
|
||||||
|
Loading…
Reference in New Issue
Block a user