dotfiles/scripts/.local/share/scripts/tmuxp-session

28 lines
498 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
select_action() {
action_content=(
2021-11-11 15:55:54 +01:00
"local"
"zion"
2021-10-11 18:44:50 +02:00
"hpc"
2021-11-03 18:03:13 +01:00
"idlab"
)
action=$(printf '%s\n' "${action_content[@]}" | rofi -no-auto-select -i "$@" -dmenu -p "Choose a session")
execute_action "$action"
}
launch_session() {
bash -c "tmuxp load ~/.tmuxp/$1.yaml"
}
execute_action() {
case "$1" in
2021-11-11 15:55:54 +01:00
"local") launch_session "local" ;;
2021-10-11 18:44:50 +02:00
"zion") launch_session "zion" ;;
"hpc") launch_session "hpc" ;;
2021-11-03 18:03:13 +01:00
"idlab") launch_session "idlab" ;;
esac
}
select_action "$@"