mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Compare commits
4 Commits
formatting
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| f268c12f3f | |||
|
adb008b301
|
|||
| 9941b28063 | |||
|
|
68b02f07b0 |
@@ -214,8 +214,8 @@ load_window() {
|
|||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
window="$2"
|
window="$2"
|
||||||
else
|
else
|
||||||
window="${1/%.window.sh}"
|
window="${1/%.window.sh/}"
|
||||||
window="${window/%.sh}"
|
window="${window/%.sh/}"
|
||||||
fi
|
fi
|
||||||
source "$file"
|
source "$file"
|
||||||
window=
|
window=
|
||||||
@@ -258,8 +258,8 @@ load_session() {
|
|||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
session="$2"
|
session="$2"
|
||||||
else
|
else
|
||||||
session="${1/%.session.sh}"
|
session="${1/%.session.sh/}"
|
||||||
session="${session/%.sh}"
|
session="${session/%.sh/}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_default_path=true
|
set_default_path=true
|
||||||
@@ -350,7 +350,6 @@ finalize_and_go_to_session() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Internal functions
|
# Internal functions
|
||||||
#
|
#
|
||||||
@@ -382,7 +381,7 @@ __get_current_window_index() {
|
|||||||
-F "#{window_active}:#{window_index}" 2> /dev/null | grep "^1:")
|
-F "#{window_active}:#{window_index}" 2> /dev/null | grep "^1:")
|
||||||
|
|
||||||
if [ -n "$lookup" ]; then
|
if [ -n "$lookup" ]; then
|
||||||
echo "${lookup/1:}"
|
echo "${lookup/1:/}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
calling-help() {
|
calling-help() {
|
||||||
if [[ " $@ " != *" --help "* ]] && [[ " $@ " != *" -h "* ]]; then
|
if [[ " $* " != *" --help "* ]] && [[ " $* " != *" -h "* ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
calling-complete() {
|
calling-complete() {
|
||||||
if [[ " $@ " != *" --complete "* ]]; then
|
if [[ " $* " != *" --complete "* ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,4 +43,5 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
exit 1
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ fi
|
|||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
{ for path in ${PATH//:/$'\n'}; do
|
{
|
||||||
|
for path in ${PATH//:/$'\n'}; do
|
||||||
for command in "${path}/tmuxifier-"*; do
|
for command in "${path}/tmuxifier-"*; do
|
||||||
command="${command##*tmuxifier-}"
|
command="${command##*tmuxifier-}"
|
||||||
echo "$command"
|
echo "$command"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ has-completions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "$(tmuxifier-help completions $@)" >&2
|
tmuxifier-help completions "$@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ fi
|
|||||||
|
|
||||||
if [ -n "$TMUX" ]; then
|
if [ -n "$TMUX" ]; then
|
||||||
for item in $(tmuxifier-tmux list-pane -F "#{session_name}"); do
|
for item in $(tmuxifier-tmux list-pane -F "#{session_name}"); do
|
||||||
echo $item
|
echo "$item"
|
||||||
exit 0
|
exit 0
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if calling-complete "$@"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "$(tmuxifier-help edit-session $@)" >&2
|
tmuxifier-help edit-session "$@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if calling-complete "$@"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "$(tmuxifier-help edit-window $@)" >&2
|
tmuxifier-help edit-window "$@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ Load Tmuxifier by adding the following to your ${profile}:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Print help if "-" argument is not given
|
# Print help if "-" argument is not given
|
||||||
if [[ " $@ " != *" - "* ]]; then
|
if [[ " $* " != *" - "* ]]; then
|
||||||
echo "$(tmuxifier-help init $@)" >&2
|
tmuxifier-help init "$@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ if calling-complete "$@"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "$(tmuxifier-help load-session $@)" >&2
|
tmuxifier-help load-session "$@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,14 @@ if calling-complete "$@"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "$(tmuxifier-help load-window $@)" >&2
|
tmuxifier-help load-window "$@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load runtime functions.
|
# Load runtime functions.
|
||||||
source "$TMUXIFIER/lib/runtime.sh"
|
source "$TMUXIFIER/lib/runtime.sh"
|
||||||
|
|
||||||
if [ ! -z $TMUX ]; then
|
if [ ! -z "$TMUX" ]; then
|
||||||
session="$(tmuxifier-current-session)"
|
session="$(tmuxifier-current-session)"
|
||||||
load_window "$1"
|
load_window "$1"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if calling-complete "$@"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "$(tmuxifier-help new-session $@)" >&2
|
tmuxifier-help new-session "$@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if calling-complete "$@"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "$(tmuxifier-help new-window $@)" >&2
|
tmuxifier-help new-window "$@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user