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