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