fix(): Update root's bash prompt for asciinema expect command

feat(): Add asciinema config
This commit is contained in:
Chris Daßler 2024-10-24 23:34:48 +02:00
parent 6f849b94d4
commit cf6e2ced59
3 changed files with 63 additions and 12 deletions

View File

@ -19,26 +19,28 @@ RUN apt-get update \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
# Installing devbox
RUN curl -fsSL https://get.jetify.com/devbox | bash -s -- -f
RUN devbox version update
# Install NIX package manager
# Install Nix package manager
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux --init none --no-confirm
# Now use devbox as global package manager
RUN echo 'eval "$(devbox global shellenv --preserve-path-stack -r)" && hash -r' >> ~/.bashrc
RUN echo "\n# Use devbox as global package manager\n" \
'eval "$(devbox global shellenv --preserve-path-stack -r)" && hash -r' \
>> ~/.bashrc
# Backup of the nix-store
RUN cp -a /nix/store /nix-store-backup
# Add start script
COPY scripts/start.sh /usr/local/bin/start.sh
RUN chmod +x /usr/local/bin/start.sh
# Set start script as entrypoint
ENTRYPOINT ["/usr/local/bin/start.sh"]
# Installing devbox
RUN curl -fsSL https://get.jetify.com/devbox | bash -s -- -f
RUN devbox version update
# Copy asciinema config to home dir
COPY asciinema-config /root/.config/asciinema/config
RUN echo "\n# Update root's bash prompt for asciinema expect commands\n" \
'PS1="\u@\h:\w\$ "' \
>> ~/.bashrc
WORKDIR /workspace
# use sh ant not bash, because bash will initialize devbox runtime
CMD ["sh"]

View File

@ -0,0 +1,46 @@
[api]
; API server URL, default: https://asciinema.org
; If you run your own instance of asciinema server then set its address here
; It can also be overriden by setting ASCIINEMA_API_URL environment variable
url = https://asciinema.starconnect.ch
[record]
; Command to record, default: $SHELL
command = PS1="\u@\h:\w\$ " bash -l
[play]
; Playback speed (can be fractional), default: 1
; speed = 2
; Limit replayed terminal inactivity to max n seconds, default: off
idle_time_limit = 1
; Define hotkey for pausing/resuming playback,
; default: space
; pause_key = p
; Define hotkey for stepping through playback, a frame at a time,
; default: . (dot)
; step_key = s
; Define hotkey for jumping to the next marker,
; default: ]
next_marker_key = m
[notifications]
; Desktop notifications are displayed in several situations, e.g. when
; pausing/resuming the capture of terminal with C-\ keyboard shortcut.
; Should desktop notifications be enabled, default: yes
enabled = no
; Custom notification command
; asciinema automatically detects available desktop notification system
; (notify-send on GNU/Linux, osacript on macOS). Custom command can be
; used if needed.
; When invoked, environment variable $TEXT contains notification text, while
; $ICON_PATH contains path to the asciinema logo image.
; command = tmux display-message "$TEXT"

View File

@ -5,9 +5,12 @@ services:
context: .
dockerfile: Dockerfile
args:
DOCKER_BUILDKIT: 1
UID: ${UID}
GID: ${GID}
restart: unless-stopped
environment:
- SHELL=/bin/bash
volumes:
# access hosts docker socket
- /var/run/docker.sock:/var/run/docker.sock