diff --git a/README.md b/README.md index ed47265..2ddcfce 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,13 @@ Based on code in Mate-HUD. Attach to a running `tmux` session or create a new one. Since this script starts a new terminal it can also been used with a keybinding from your favorite window-manager. +## docker_bash.sh + +Start a Bash session in a Docker container. Like `tmux_session.sh` this opens a new terminal and is suitable for keybinding. + +### Screenshot +![Docker-Bash](docker_bash.png) + ### Usage Interactive usage diff --git a/docker_bash.png b/docker_bash.png new file mode 100644 index 0000000..71372ba Binary files /dev/null and b/docker_bash.png differ diff --git a/docker_bash.sh b/docker_bash.sh new file mode 100755 index 0000000..316fb1d --- /dev/null +++ b/docker_bash.sh @@ -0,0 +1,9 @@ +#! /bin/bash + +CONTAINER=$(docker ps | tail -n +2 | rofi -dmenu -p 'Select container' | cut -d ' ' -f 1) + +if [[ -z "$CONTAINER" ]]; then + echo 'Cancel' +else + rofi-sensible-terminal -e "docker exec -ti $CONTAINER /bin/bash" & +fi