moved scripts folder to root directory
This commit is contained in:
5
scripts/colors.sh
Normal file
5
scripts/colors.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
show256colors () {
|
||||
for code in {0..255}; do
|
||||
echo -e "\e[38;05;${code}m $code: Color";
|
||||
done
|
||||
}
|
||||
33
scripts/default-tmux-session
Executable file
33
scripts/default-tmux-session
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DEFAULT_SESSION='quak'
|
||||
DUMMY_SESSION='dummy'
|
||||
|
||||
# start dummy session to avoid error messages on `has-session`
|
||||
tmux new-session -d -s "$DUMMY_SESSION"
|
||||
|
||||
# check if the default session exists
|
||||
# redirect stderr to /dev/null because `session not found` is
|
||||
# not a relevant error in this case
|
||||
if $(tmux has-session -t ${DEFAULT_SESSION} 2>/dev/null); then
|
||||
echo "default session <${DEFAULT_SESSION}> already exists"
|
||||
# no action needed if the session exists, the attach command is run externally
|
||||
else
|
||||
# dont forget the '-d' option, otherwise the session is closed
|
||||
# before the rest of the commands are executed
|
||||
tmux new-session -d -s "$DEFAULT_SESSION" -n "temp" -c "$HOME" # create dummy window to set default path for new windows
|
||||
tmux new-window -t "$DEFAULT_SESSION" -n "dotfiles" -c "$HOME/dotfiles"
|
||||
tmux new-window -t "$DEFAULT_SESSION" -n "docs" -c "$HOME/collection"
|
||||
tmux new-window -t "$DEFAULT_SESSION" -n "stuff" -c "$HOME"
|
||||
tmux kill-window -t "temp"
|
||||
|
||||
# this causes the script to exit only, when the session is ended or detached
|
||||
# it also causes tmux's detach command with hang up signal to fail
|
||||
# therefore the following line is commented out
|
||||
# an `alias` is created in `.bashrc` which calls this script and runs
|
||||
# `tmux attach` on successful execution
|
||||
|
||||
#tmux attach -t "$DEFAULT_SESSION"
|
||||
fi
|
||||
|
||||
tmux kill-session -t "$DUMMY_SESSION"
|
||||
15
scripts/dunst.sh
Normal file
15
scripts/dunst.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# reset dunst and send notification to Test dUNST config
|
||||
tunst() {
|
||||
killall -9 dunst
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
notify-send "Henlo" "fren of fren of very fren";
|
||||
else
|
||||
for n in $(seq 1 $1); do
|
||||
notify-send "Henlo(${n})" "fren of fren of fren number ${n}";
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
3
scripts/fzf-bash-history
Normal file
3
scripts/fzf-bash-history
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
alias search-history='eval $(fc -lnr 1 | fzf --tmux )'
|
||||
|
||||
32
scripts/navigate_bash_setup.sh
Normal file
32
scripts/navigate_bash_setup.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
__call_navigate() {
|
||||
arg_pid=" --pid $$ "
|
||||
eval "$(navigate ${arg_pid} $@)"
|
||||
}
|
||||
|
||||
function push {
|
||||
__call_navigate "push $@"
|
||||
}
|
||||
|
||||
function pop {
|
||||
__call_navigate "pop $@"
|
||||
}
|
||||
|
||||
function stack {
|
||||
__call_navigate "stack $@"
|
||||
}
|
||||
|
||||
function book {
|
||||
__call_navigate "bookmark $@"
|
||||
}
|
||||
|
||||
# completion for `book`
|
||||
function _book {
|
||||
CURRENT_WORD=${COMP_WORDS[COMP_CWORD]}
|
||||
BOOKMARKS="$(__call_navigate bookmark names)"
|
||||
COMPREPLY=($(compgen -W "${BOOKMARKS}" -- $CURRENT_WORD))
|
||||
}
|
||||
|
||||
complete -o dirnames push
|
||||
complete -F _book book
|
||||
Reference in New Issue
Block a user