commit d9f65d9b96b44411c72af3343dc2d1ec9a439ff3 parent 9340646cdd12db05e596a439531d4578a4d55479 Author: pyratebeard <root@pyratebeard.net> Date: Thu, 25 Feb 2021 17:34:05 +0000 move to zsh function Diffstat:
D | bin/bin/raise | | | 27 | --------------------------- |
A | zsh/.zsh/functions/raise | | | 27 | +++++++++++++++++++++++++++ |
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/bin/bin/raise b/bin/bin/raise @@ -1,27 +0,0 @@ -#!/bin/sh - -createmenu () -{ - arrsize=$1 - - PS3="select window to raise: " - select option in "${@:2}"; do - if [ "$REPLY" -eq "$arrsize" ]; - then - echo "bye..." - break; - elif [ 1 -le "$REPLY" ] && [ "$REPLY" -le $((arrsize-1)) ]; - then - $(hidden -c | grep -i ${window_list[REPLY]} | awk -F: '{print $NF}' | tr -d "'") - break; - else - echo "no window. select a number 1-$arrsize" - fi - done -} - -declare -a window_list=($(/usr/local/bin/hidden | awk '{print $1}' | tr '[:upper:]' '[:lower:]')) - -window_list+=("quit") - -createmenu "${#window_list[@]}" "${window_list[@]}" diff --git a/zsh/.zsh/functions/raise b/zsh/.zsh/functions/raise @@ -0,0 +1,27 @@ +#!/usr/bin/zsh + +createmenu () +{ + arrsize=$1 + + PS3="select window to raise: " + select option in "${@:2}"; do + if [ "$REPLY" -eq "$arrsize" ]; + then + echo "bye..." + break; + elif [ 1 -le "$REPLY" ] && [ "$REPLY" -le $((arrsize-1)) ]; + then + $(hidden -c | grep -i ${window_list[REPLY]} | awk -F: '{print $NF}' | tr -d "'") + break; + else + echo "no window. select a number 1-$arrsize" + fi + done +} + +declare -a window_list=($(/usr/local/bin/hidden | awk '{print $1}' | tr '[:upper:]' '[:lower:]')) + +window_list+=("quit") + +createmenu "${#window_list[@]}" "${window_list[@]}"