From 789821ae8e07177c3e5b7459db45b920ef4c70eb Mon Sep 17 00:00:00 2001 From: Salt Date: Sun, 23 Dec 2018 12:01:22 -0600 Subject: [PATCH] i3-settree: Change prompt, add script support --- i3-settree | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/i3-settree b/i3-settree index b0abea5..d04e75e 100755 --- a/i3-settree +++ b/i3-settree @@ -29,6 +29,10 @@ prepare_input() { # Cannot read the file; skip it continue fi + if [[ "$file" = *".rc" ]]; then + # File is an rc script; skip it + continue + fi if ! [ -f "$file" ]; then # Glob failed and no files exist; error return 1 @@ -74,7 +78,7 @@ step_validate_files() { } step_get_input() { # Get the user input, store it in $choice - choice="$(rofi -dmenu -p "append tree" <<< "$(prepare_input)")" + choice="$(rofi -dmenu -p "i3 tree" <<< "$(prepare_input)")" if [ -z "$choice" ]; then log "User cancelled the operation" return 1 @@ -87,6 +91,10 @@ step_act() { case "$choice" in *) i3-msg "append_layout $choice" > /dev/null 2>&1 + if [ -r "$choice.rc" ]; then + log "Running $choice.rc" + "$choice".rc + fi return $! ;; esac