%% This is file `bfh-layout-tabular.cfg' version 2.2.6 (2026-01-12), %% it is part of %% BFH-CI -- Corporate Design for Bern University of Applied Sciences %% ---------------------------------------------------------------------------- %% %% Copyright (C) 2021--2026 by %% Marei Peischl %% Andreas Habegger %% %% ============================================================================ %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.3c or later is part of all distributions of LaTeX %% version 2008/05/04 or later. %% %% This work has the LPPL maintenance status `maintained'. %% %% The Current Maintainers of this work are %% Marei Peischl %% Andreas Habegger %% %% The development respository can be found at %% https://gitlab.ti.bfh.ch/bfh-latex/bfh-ci/ %% Please use the issue tracker for feedback! %% %% ============================================================================ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{bfh-layout-terminal.cfg}[2026-01-12 v2.2.6 terminal configuration for bfhlayout] \RequirePackage{bfhcolors} \RequirePackage{tcolorbox} \RequirePackage{xstring} \tcbuselibrary{skins,xparse,listings} \colorlet{ubuntu-terminalBackground}{violet!50!black} \colorlet{ubuntu-terminalText}{white} \colorlet{ubuntu-terminalFrame}{gray!65!black} \colorlet{ubuntu-terminalFirstBullet}{orange} \colorlet{ubuntu-terminalSecondBullet}{gray} \colorlet{ubuntu-terminalThirdBullet}{gray} \colorlet{macosx-terminalBackground}{white} \colorlet{macosx-terminalText}{black} \colorlet{macosx-terminalFrame}{gray!25} \colorlet{macosx-terminalFirstBullet}{red!65} \colorlet{macosx-terminalSecondBullet}{orange!52!yellow} \colorlet{macosx-terminalThirdBullet}{green!80!black} \definecolor{bashcommentgreen}{RGB}{95,175,85} %% define key because we receive an error for setting them in case minted is not loaded \csname @ifpackageloaded\endcsname{minted}{}{ \tcbset{minted options/.style={}} } \tcbset{ ptxcd/terminal/default/.style={ listing only, listing options={style=tcblatex,language=sh,escapeinside=``,commentstyle=\color{bashcommentgreen}\itshape,}, listing inputencoding=utf8, minted options={escapeinside=\\`\\`,autogobble,formatcom=\BFHterminalFormatLine,breaklines,breaksymbol=\quad}, every listing line={\BFHterminalPrompt{}}, size=small, halign title=flush left, }, ptxcd/terminal/macos/.style={ colback=macosx-terminalBackground, colupper=macosx-terminalText, colframe=macosx-terminalFrame, title={\textcolor{macosx-terminalFirstBullet}{\huge\ttfamily\bfseries{$\bullet$}\textcolor{macosx-terminalSecondBullet}{\huge\ttfamily\bfseries{$\bullet$}\textcolor{macosx-terminalThirdBullet}{\huge\ttfamily\bfseries{$\bullet$}}}}}, }, ptxcd/terminal/ubuntu/.style={ colback=ubuntu-terminalBackground, colupper=ubuntu-terminalText, colframe=ubuntu-terminalFrame, title={\textcolor{ubuntu-terminalFirstBullet}{\huge{$\bullet$}}{\textcolor{ubuntu-terminalSecondBullet}{\huge{$\bullet$}}}{\textcolor{ubuntu-terminalThirdBullet}{\huge{$\bullet$}}}}, } } \newcommand{\BFHterminalFormatLine}{% \def\FancyVerbFormatLine##1{\BFHterminalPrompt{}##1}% } \newtcblisting{ubuntu}{ ptxcd/terminal/default, ptxcd/terminal/ubuntu } \newtcblisting{ubuntu*}[1]{ ptxcd/terminal/default, ptxcd/terminal/ubuntu, #1 } \newtcblisting{macos}{ ptxcd/terminal/default, ptxcd/terminal/macos } \newtcblisting{macos*}[1]{ ptxcd/terminal/default, ptxcd/terminal/macos, #1 } \newcommand{\truncateTo}[2]{% % #1 = text, #2 = number of characters \StrLeft{#1}{\the\numexpr(#2 - 3)/2\relax}...\StrRight{#1}{\the\numexpr(#2 - 3)/2\relax}% } \NewDocumentCommand{\setupLinuxPrompt}{O{} O{} O{} O{} O{} m}{% % Check if we are using old style (no optional arguments provided, only mandatory) \if\relax\detokenize{#1#2#3#4}\relax % Old style usage: \setupLinuxPrompt{key=value} or \setupLinuxPrompt{student} \pgfkeys{/terminal/.cd,host=ubuntu,#6}% \else % New style usage with optional arguments \pgfkeys{/terminal/.cd,host=ubuntu}% \ifx\relax#1\relax\else\pgfkeys{/terminal/.cd,user=#1}\fi \ifx\relax#2\relax\else\pgfkeys{/terminal/.cd,host=#2}\fi \ifx\relax#3\relax\else\pgfkeys{/terminal/.cd,pwd=#3}\fi \ifx\relax#4\relax\else\pgfkeys{/terminal/.cd,prompt char=#4}\fi \ifx\relax#5\relax\else\pgfkeys{/terminal/.cd,pwd chars=#5}\fi \ifx\relax#6\relax\else\pgfkeys{/terminal/.cd,#6}\fi \fi \gdef\BFHterminalPrompt{\textcolor{\TerminalColor}{\small\ttfamily\bfseries\TerminalUser@\TerminalHost{\textcolor{ubuntu-terminalText}:}{\ifx\TerminalPwd\empty{\~{}}\else{\truncateTo{\TerminalPwd}{\TerminalPwdChars}}\fi}\TerminalPromptChar\textcolor{ubuntu-terminalText}\,}}% \lstset{backgroundcolor=}% \lstset{frame=}% \lstset{numberstyle=}% \lstset{numbers=none}% } %%tabular \NewDocumentCommand{\setupOSXPrompt}{O{} O{} O{} O{} O{} m}{% % Check if we are using old style (no optional arguments provided, only mandatory) \if\relax\detokenize{#1#2#3#4#5}\relax % Old style usage: \setupOSXPrompt{key=value} or \setupOSXPrompt{student} \pgfkeys{/terminal/.cd,host=macintosh,#6}% \else % New style usage with optional arguments \pgfkeys{/terminal/.cd,host=macintosh}% \ifx\relax#1\relax\else\pgfkeys{/terminal/.cd,user=#1}\fi \ifx\relax#2\relax\else\pgfkeys{/terminal/.cd,host=#2}\fi \ifx\relax#3\relax\else\pgfkeys{/terminal/.cd,pwd=#3}\fi \ifx\relax#4\relax\else\pgfkeys{/terminal/.cd,prompt char=#4}\fi \ifx\relax#5\relax\else\pgfkeys{/terminal/.cd,pwd chars=#5}\fi \ifx\relax#6\relax\else\pgfkeys{/terminal/.cd,#6}\fi \fi \gdef\BFHterminalPrompt{\textcolor{\TerminalColor}{\small\ttfamily\bfseries\TerminalUser@\TerminalHost{\textcolor{ubuntu-terminalText}:}{\ifx\TerminalPwd\empty{\~{}}\else{\truncateTo{\TerminalPwd}{\TerminalPwdChars}}\fi}\TerminalPromptChar\textcolor{macosx-terminalText}\,}}% \lstset{backgroundcolor=}% \lstset{frame=}% \lstset{numberstyle=}% \lstset{numbers=none}% } %%tabular \pgfkeys{ /terminal/.cd, user/.code={\gdef\TerminalUser{#1}},user={}, host/.code={\gdef\TerminalHost{#1}},host={}, pwd/.code={\gdef\TerminalPwd{#1}},pwd={}, color/.code={\gdef\TerminalColor{#1}},color=white, prompt char/.code={\gdef\TerminalPromptChar{#1}},prompt char=\$, pwd chars/.code={\gdef\TerminalPwdChars{#1}},pwd chars=43, root/.style={user=root,color=BFH-MediumRed,prompt char=\#}, student/.style={user=student,color=BFH-LightGreen,prompt char=\$}, remote/.style={user=user,host=remotehost,color=BFH-LightPurple,prompt char=\$}, } %% \newcommand{\StartConsole}{\gdef\BFHterminalPrompt{}} \endinput