From 97978dd767d136619bad4e806c83dd21f2377483 Mon Sep 17 00:00:00 2001 From: ThePrimeagen Date: Wed, 8 Sep 2021 20:50:35 -0600 Subject: [PATCH 01/10] the repo you deserve --- bin/.local/bin/tmux-cht.sh | 1 - tmux/.tmux.conf | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/.local/bin/tmux-cht.sh b/bin/.local/bin/tmux-cht.sh index 4f19ab9c..d3bb1807 100755 --- a/bin/.local/bin/tmux-cht.sh +++ b/bin/.local/bin/tmux-cht.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash selected=`cat ~/.tmux-cht-languages ~/.tmux-cht-command | fzf` - read -p "Enter Query: " query if grep -qs "$selected" ~/.tmux-cht-languages; then diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 05b7f8a0..98a42330 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -21,7 +21,7 @@ bind -r l select-pane -R bind -r D neww -c "#{pane_current_path}" "[[ -e TODO.md ]] && nvim TODO.md || nvim ~/dotfiles/todo.md" -bind-key -r ^ run-shell "~/.local/bin/tmux-sessionizer restore 2" +bind-key -r i run-shell "tmux neww bash -c \"~/.local/bin/tmux-cht.sh\"" bind-key -r G run-shell "~/.local/bin/tmux-sessionizer /home/theprimeagen/work/nrdp" bind-key -r C run-shell "~/.local/bin/tmux-sessionizer /home/theprimeagen/work/tvui" bind-key -r R run-shell "~/.local/bin/tmux-sessionizer /home/theprimeagen/work/milo" From cf31accd835380d7faa76f3d086d3d2612d87c13 Mon Sep 17 00:00:00 2001 From: ThePrimeagen Date: Wed, 8 Sep 2021 20:57:32 -0600 Subject: [PATCH 02/10] feat: integration with vim! --- nvim/.config/nvim/init.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index de39acae..a568551e 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -101,7 +101,9 @@ imap luasnip#choice_active() ? 'luasnip-next-choice' smap luasnip#choice_active() ? 'luasnip-next-choice' : '' nnoremap Q -nnoremap :lua require("harpoon.term").sendCommand(1, "tmux-sessionizer\n"); require("harpoon.term").gotoTerminal(1) +nnoremap :silent !tmux neww bash -c "tmux-cht.sh" +inoremap :silent !tmux neww bash -c "tmux-cht.sh" +nnoremap :silent lua require("harpoon.term").sendCommand(1, "tmux-sessionizer\n"); require("harpoon.term").gotoTerminal(1) nnoremap vwh :h =expand("") nnoremap bs /=escape(expand(""), "/") nnoremap u :UndotreeShow From 858cdd66cf35a7d9eec7567bbf0c543b26bbf586 Mon Sep 17 00:00:00 2001 From: ThePrimeagen Date: Mon, 13 Sep 2021 11:40:10 -0600 Subject: [PATCH 03/10] automagic messaging from me in the past. Have you checked up your butthole? --- bin/.local/bin/tmux-cht.sh | 2 ++ nvim/.config/nvim/init.vim | 10 +++++++--- tmux/.tmux.conf | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/.local/bin/tmux-cht.sh b/bin/.local/bin/tmux-cht.sh index d3bb1807..da5055e6 100755 --- a/bin/.local/bin/tmux-cht.sh +++ b/bin/.local/bin/tmux-cht.sh @@ -4,8 +4,10 @@ read -p "Enter Query: " query if grep -qs "$selected" ~/.tmux-cht-languages; then query=`echo $query | tr ' ' '+'` + echo "curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done" tmux neww bash -c "curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done" else + echo "curl cht.sh/$selected~$query & while [ : ]; do sleep 1; done" tmux neww bash -c "curl cht.sh/$selected~$query & while [ : ]; do sleep 1; done" fi diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index a568551e..ea4ee8dd 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -41,6 +41,7 @@ Plug 'rafamadriz/friendly-snippets' Plug 'rust-lang/rust.vim' Plug 'darrikonn/vim-gofmt' Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-rhubarb' Plug 'junegunn/gv.vim' Plug 'vim-utils/vim-man' Plug 'mbbill/undotree' @@ -101,9 +102,7 @@ imap luasnip#choice_active() ? 'luasnip-next-choice' smap luasnip#choice_active() ? 'luasnip-next-choice' : '' nnoremap Q -nnoremap :silent !tmux neww bash -c "tmux-cht.sh" -inoremap :silent !tmux neww bash -c "tmux-cht.sh" -nnoremap :silent lua require("harpoon.term").sendCommand(1, "tmux-sessionizer\n"); require("harpoon.term").gotoTerminal(1) +nnoremap :silent !tmux neww tmux-sessionizer nnoremap vwh :h =expand("") nnoremap bs /=escape(expand(""), "/") nnoremap u :UndotreeShow @@ -125,6 +124,11 @@ nnoremap glp :cprev:call search(_search_term) vnoremap J :m '>+1gv=gv vnoremap K :m '<-2gv=gv +nnoremap Y yg$ +nnoremap n nzzzv +nnoremap N Nzzzv +nnoremap J mzJ`z + " greatest remap ever xnoremap p "_dP diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 98a42330..e1daac4c 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -21,7 +21,7 @@ bind -r l select-pane -R bind -r D neww -c "#{pane_current_path}" "[[ -e TODO.md ]] && nvim TODO.md || nvim ~/dotfiles/todo.md" -bind-key -r i run-shell "tmux neww bash -c \"~/.local/bin/tmux-cht.sh\"" +bind-key -r i run-shell "tmux neww ~/.dotfiles/cht.sh" bind-key -r G run-shell "~/.local/bin/tmux-sessionizer /home/theprimeagen/work/nrdp" bind-key -r C run-shell "~/.local/bin/tmux-sessionizer /home/theprimeagen/work/tvui" bind-key -r R run-shell "~/.local/bin/tmux-sessionizer /home/theprimeagen/work/milo" From 4c21c86bf7547040ed4b277aa324ad15a257c727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Szab=C3=B3?= Date: Tue, 14 Sep 2021 17:42:05 +0300 Subject: [PATCH 04/10] use pager against loop --- bin/.local/bin/tmux-cht.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/.local/bin/tmux-cht.sh b/bin/.local/bin/tmux-cht.sh index da5055e6..99973da6 100755 --- a/bin/.local/bin/tmux-cht.sh +++ b/bin/.local/bin/tmux-cht.sh @@ -4,10 +4,8 @@ read -p "Enter Query: " query if grep -qs "$selected" ~/.tmux-cht-languages; then query=`echo $query | tr ' ' '+'` - echo "curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done" - tmux neww bash -c "curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done" + tmux neww bash -c "curl -s cht.sh/$selected/$query | less" else - echo "curl cht.sh/$selected~$query & while [ : ]; do sleep 1; done" - tmux neww bash -c "curl cht.sh/$selected~$query & while [ : ]; do sleep 1; done" + tmux neww bash -c "curl -s cht.sh/$selected~$query | less" fi From 32f48fbdfae43e277c4d7bdc470602357a393511 Mon Sep 17 00:00:00 2001 From: ThePrimeagen Date: Tue, 14 Sep 2021 10:00:01 -0600 Subject: [PATCH 05/10] Some basic changes no sessionizer and chtsh --- bin/.local/bin/tmux-cht.sh | 2 +- bin/.local/bin/tmux-sessionizer | 57 ++----------------- nvim/.config/nvim/init.vim | 1 + .../nvim/lua/theprimeagen/git-worktree.lua | 43 +------------- tmux/.tmux.conf | 2 +- 5 files changed, 11 insertions(+), 94 deletions(-) diff --git a/bin/.local/bin/tmux-cht.sh b/bin/.local/bin/tmux-cht.sh index 99973da6..78019876 100755 --- a/bin/.local/bin/tmux-cht.sh +++ b/bin/.local/bin/tmux-cht.sh @@ -4,7 +4,7 @@ read -p "Enter Query: " query if grep -qs "$selected" ~/.tmux-cht-languages; then query=`echo $query | tr ' ' '+'` - tmux neww bash -c "curl -s cht.sh/$selected/$query | less" + tmux neww bash -c "echo \"curl cht.sh/$selected/$query/\" & curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done" else tmux neww bash -c "curl -s cht.sh/$selected~$query | less" fi diff --git a/bin/.local/bin/tmux-sessionizer b/bin/.local/bin/tmux-sessionizer index d87178e8..e7069a62 100755 --- a/bin/.local/bin/tmux-sessionizer +++ b/bin/.local/bin/tmux-sessionizer @@ -1,63 +1,18 @@ #!/usr/bin/env bash -TMUX_HISTORY_LENGTH=10 -TMUX_HISTORY_FILE=$HOME/.tmux-sessionizer - -add_new_line() { - tail -n1 $1 | read -r _ || echo >> $1 -} - -update_history() { - # TODO: Probably change this to .config once i have the proper version of tmux - if [[ ! -e "$TMUX_HISTORY_FILE" ]]; then - touch $TMUX_HISTORY_FILE - fi - tmux_contents=`cat $TMUX_HISTORY_FILE` - printf "$1\n$tmux_contents" > $TMUX_HISTORY_FILE - sed -ni "1,${TMUX_HISTORY_LENGTH}p" $TMUX_HISTORY_FILE - add_new_line $TMUX_HISTORY_FILE -} - -clear_history() { - rm $TMUX_HISTORY_FILE - touch $TMUX_HISTORY_FILE -} - -if [[ "$1" = "clear" ]]; then - clear_history - exit 0 -elif [[ "$1" = "-v" ]]; then - cat $TMUX_HISTORY_FILE - exit 0 -elif [[ $# -eq 1 ]]; then +if [[ $# -eq 1 ]]; then selected=$1 -elif [[ $# -eq 2 && "$1" = "restore" ]]; then - history_length=`cat $TMUX_HISTORY_FILE | wc -l` - if [[ $2 -gt $history_length ]]; then - echo "Requested $2 item, but there is only $history_length available." - exit 1 - elif [[ $2 -ge $TMUX_HISTORY_LENGTH ]]; then - echo "cannot provide a length greater than $TMUX_HISTORY_LENGTH" - exit 1 - fi - selected=`cat $TMUX_HISTORY_FILE | sed -n "$2,${2}p"` else - items=`find ~/work -maxdepth 1 -mindepth 1 -type d` - items+=`find ~/personal -maxdepth 1 -mindepth 1 -type d` - items+=`find ~ -maxdepth 1 -mindepth 1 -type d` - selected=`echo "$items" | fzf` + selected=`find ~/personal ~ ~/work -maxdepth 1 -mindepth 1 -type d | echo "$items" | fzf` fi if [[ -z $selected ]]; then exit 0 fi -tmux_session_name=`basename $selected | tr . _` -update_history $selected - -tmux switch-client -t $tmux_session_name -if [[ $? -eq 0 ]]; then - exit 0 +if ! tmux has-session -t $selected_name; then + tmux new-session -ds $selected_name -c $selected fi -tmux new-session -c $selected -d -s $tmux_session_name && tmux switch-client -t $tmux_session_name || tmux new -c $selected -A -s $tmux_session_name +tmux switch-client -t $selected_name + diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index ea4ee8dd..05cc7369 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -1,3 +1,4 @@ +" hello front end masters set path+=** " Nice menu when typing `:find *.py` diff --git a/nvim/.config/nvim/lua/theprimeagen/git-worktree.lua b/nvim/.config/nvim/lua/theprimeagen/git-worktree.lua index d3e82d34..a6a39aa1 100644 --- a/nvim/.config/nvim/lua/theprimeagen/git-worktree.lua +++ b/nvim/.config/nvim/lua/theprimeagen/git-worktree.lua @@ -1,47 +1,8 @@ local Worktree = require("git-worktree") -local Job = require("plenary.job") -local Path = require("plenary.path") - -local function is_nrdp() - return not not (string.find(vim.loop.cwd(), vim.env.NRDP, 1, true)) -end - -local function is_tvui() - return not not (string.find(vim.loop.cwd(), vim.env.TVUI, 1, true)) -end - -local function get_nrdp_build_paths(path) - return - Path:new({vim.env.NRDP, path, "configure"}):absolute(), - Path:new({vim.env.NRDP, "build", path}):absolute() -end Worktree.on_tree_change(function(op, path, upstream) - - if op == Worktree.Operations.Switch and is_tvui() then - Job:new({ - "./tvui", "install" - }):start() - end - - if op == Worktree.Operations.Create and is_nrdp() then - local submodule = Job:new({ - "git", "submodule", "update" - }) - - local configure_path, build_path = get_nrdp_build_paths(path) - local make_build = Job:new({ - "mkdir", "-p", build_path - }) - - local configure = Job:new({ - configure_path, "--ninja", "--debug", - cwd = build_path, - }) - - submodule:and_then_on_success(make_build) - make_build:and_then_on_success(configure) - submodule:start() + if op == Worktree.Operations.Switch then + elseif op == Worktree.Operations.Create then end end) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index e1daac4c..611c1e52 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -21,7 +21,7 @@ bind -r l select-pane -R bind -r D neww -c "#{pane_current_path}" "[[ -e TODO.md ]] && nvim TODO.md || nvim ~/dotfiles/todo.md" -bind-key -r i run-shell "tmux neww ~/.dotfiles/cht.sh" +bind-key -r i run-shell "tmux neww tmux-cht.sh" bind-key -r G run-shell "~/.local/bin/tmux-sessionizer /home/theprimeagen/work/nrdp" bind-key -r C run-shell "~/.local/bin/tmux-sessionizer /home/theprimeagen/work/tvui" bind-key -r R run-shell "~/.local/bin/tmux-sessionizer /home/theprimeagen/work/milo" From de145e7cabc412a528ceb21253a45499998fceaf Mon Sep 17 00:00:00 2001 From: ThePrimeagen Date: Tue, 14 Sep 2021 10:43:21 -0600 Subject: [PATCH 06/10] fix: Oops broke sessionizer --- bin/.local/bin/tmux-sessionizer | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/.local/bin/tmux-sessionizer b/bin/.local/bin/tmux-sessionizer index e7069a62..bf07ee87 100755 --- a/bin/.local/bin/tmux-sessionizer +++ b/bin/.local/bin/tmux-sessionizer @@ -3,16 +3,26 @@ if [[ $# -eq 1 ]]; then selected=$1 else - selected=`find ~/personal ~ ~/work -maxdepth 1 -mindepth 1 -type d | echo "$items" | fzf` + selected=$(find ~/ ~/work ~/personal -mindepth 1 -maxdepth 1 -type d | fzf) fi if [[ -z $selected ]]; then exit 0 fi +selected_name=$(basename "$selected" | tr . _) +tmux_running=$(pgrep tmux) +if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then + tmux new-session -s $selected_name -c $selected + exit 0 +fi + if ! tmux has-session -t $selected_name; then tmux new-session -ds $selected_name -c $selected fi -tmux switch-client -t $selected_name - +if [[ -z $TMUX ]]; then + tmux attach-session -t $selected_name +else + tmux switch-client -t $selected_name +fi From e59ccf8aa8653b44c7d5670fc2f95bd0d94add4a Mon Sep 17 00:00:00 2001 From: ThePrimeagen Date: Tue, 14 Sep 2021 15:15:59 -0600 Subject: [PATCH 07/10] feat: remove asdf to make my dactyl sore --- i3/.config/i3/config | 52 +++++++++++++++++++++++++++----------------- zsh/.zsh_profile | 2 -- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/i3/.config/i3/config b/i3/.config/i3/config index c41619d3..ff662372 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -101,28 +101,40 @@ bindsym $mod+a focus parent #bindsym $mod+d focus child # switch to workspace -bindsym $mod+1 workspace 1 -bindsym $mod+2 workspace 2 -bindsym $mod+3 workspace 3 -bindsym $mod+4 workspace 4 -bindsym $mod+5 workspace 5 -bindsym $mod+6 workspace 6 -bindsym $mod+7 workspace 7 -bindsym $mod+8 workspace 8 -bindsym $mod+9 workspace 9 -bindsym $mod+0 workspace 10 +#bindsym $mod+1 workspace 1 +#bindsym $mod+2 workspace 2 +#bindsym $mod+3 workspace 3 +#bindsym $mod+4 workspace 4 +#bindsym $mod+5 workspace 5 +#bindsym $mod+6 workspace 6 +#bindsym $mod+7 workspace 7 +#bindsym $mod+8 workspace 8 +#bindsym $mod+9 workspace 9 +#bindsym $mod+0 workspace 10 + +# switch to workspace +bindsym $mod+Shift+equal workspace 1 +bindsym $mod+bracketleft workspace 2 +bindsym $mod+Shift+bracketleft workspace 3 +bindsym $mod+Shift+9 workspace 4 +bindsym $mod+Shift+7 workspace 5 +bindsym $mod+equal workspace 6 +bindsym $mod+Shift+0 workspace 7 +bindsym $mod+Shift+bracketright workspace 8 +bindsym $mod+bracketright workspace 9 +bindsym $mod+Shift+8 workspace 10 # move focused container to workspace -bindsym $mod+Shift+1 move container to workspace 1 -bindsym $mod+Shift+2 move container to workspace 2 -bindsym $mod+Shift+3 move container to workspace 3 -bindsym $mod+Shift+4 move container to workspace 4 -bindsym $mod+Shift+5 move container to workspace 5 -bindsym $mod+Shift+6 move container to workspace 6 -bindsym $mod+Shift+7 move container to workspace 7 -bindsym $mod+Shift+8 move container to workspace 8 -bindsym $mod+Shift+9 move container to workspace 9 -bindsym $mod+Shift+0 move container to workspace 10 +bindsym $mod+1 move container to workspace 1 +bindsym $mod+2 move container to workspace 2 +bindsym $mod+3 move container to workspace 3 +bindsym $mod+4 move container to workspace 4 +bindsym $mod+5 move container to workspace 5 +bindsym $mod+6 move container to workspace 6 +bindsym $mod+7 move container to workspace 7 +bindsym $mod+8 move container to workspace 8 +bindsym $mod+9 move container to workspace 9 +bindsym $mod+0 move container to workspace 10 # reload the configuration file bindsym $mod+Shift+c reload diff --git a/zsh/.zsh_profile b/zsh/.zsh_profile index 0c54160d..ad19f658 100644 --- a/zsh/.zsh_profile +++ b/zsh/.zsh_profile @@ -73,5 +73,3 @@ eslintify() { cat $1 > /tmp/file_to_eslint npx eslint } - -asdf From 2d564e836c062b8a2e77e54a3adfd8276333e9ef Mon Sep 17 00:00:00 2001 From: ThePrimeagen Date: Wed, 15 Sep 2021 18:56:35 -0600 Subject: [PATCH 08/10] feat --- bin/.local/bin/tmux-cht.sh | 4 ++++ zsh/.zshrc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/.local/bin/tmux-cht.sh b/bin/.local/bin/tmux-cht.sh index 78019876..68215e86 100755 --- a/bin/.local/bin/tmux-cht.sh +++ b/bin/.local/bin/tmux-cht.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash selected=`cat ~/.tmux-cht-languages ~/.tmux-cht-command | fzf` +if [[ -z $selected ]]; then + exit 0 +fi + read -p "Enter Query: " query if grep -qs "$selected" ~/.tmux-cht-languages; then diff --git a/zsh/.zshrc b/zsh/.zshrc index 6c6dad59..8fa612a6 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -53,7 +53,7 @@ ZSH_THEME="robbyrussell" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git zsh-autosuggestions) +plugins=(git) source $ZSH/oh-my-zsh.sh From 2439bab133536e3cabee6b9ded74189b43b00ee7 Mon Sep 17 00:00:00 2001 From: ThePrimeagen Date: Wed, 15 Sep 2021 19:15:23 -0600 Subject: [PATCH 09/10] no more null --- bin/.local/bin/tmux-sessionizer | 2 +- nvim/.config/nvim/init.vim | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/.local/bin/tmux-sessionizer b/bin/.local/bin/tmux-sessionizer index bf07ee87..15a5f695 100755 --- a/bin/.local/bin/tmux-sessionizer +++ b/bin/.local/bin/tmux-sessionizer @@ -17,7 +17,7 @@ if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then exit 0 fi -if ! tmux has-session -t $selected_name; then +if ! tmux has-session -t $selected_name 2> /dev/null; then tmux new-session -ds $selected_name -c $selected fi diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 05cc7369..6b3061da 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -121,6 +121,7 @@ nnoremap dwm :lua require("vim-with-me").disconnect() nnoremap gll :let g:_search_term = expand("%"):Gclog -- %:call search(g:_search_term) nnoremap gln :cnext:call search(_search_term) nnoremap glp :cprev:call search(_search_term) +nnoremap x :!chmod +x % vnoremap J :m '>+1gv=gv vnoremap K :m '<-2gv=gv From 6ef260676bfaa653c9960edc72d81973f4fb6903 Mon Sep 17 00:00:00 2001 From: William Taylor <340016+willt@users.noreply.github.com> Date: Fri, 17 Sep 2021 09:24:48 -0700 Subject: [PATCH 10/10] add stderr redirect in case folder doesn't exist --- bin/.local/bin/tmux-sessionizer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/.local/bin/tmux-sessionizer b/bin/.local/bin/tmux-sessionizer index 15a5f695..e4c7a9b3 100755 --- a/bin/.local/bin/tmux-sessionizer +++ b/bin/.local/bin/tmux-sessionizer @@ -3,7 +3,7 @@ if [[ $# -eq 1 ]]; then selected=$1 else - selected=$(find ~/ ~/work ~/personal -mindepth 1 -maxdepth 1 -type d | fzf) + selected=$(find ~/ ~/work ~/personal -mindepth 1 -maxdepth 1 -type d 2> /dev/null | fzf) fi if [[ -z $selected ]]; then