summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bfh-ci/bfh-layout-terminal.cfg
blob: fce09fcdcf41b3cecba147e4157e7fd98cfe0ff3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
%% This is file `bfh-layout-tabular.cfg' version 2.0.0 (2021/12/23),
%% it is part of
%% BFH-CI -- Corporate Design for Bern University of Applied Sciences
%% ----------------------------------------------------------------------------
%%
%%  Copyright (C) 2021 by
%%      Marei Peischl <marei@peitex.de>
%%      Andreas Habegger <andreas.habegger@bfh.ch>
%%
%% ============================================================================
%% 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 <bfh-ci@peitex.de>
%%   Andreas Habegger <andreas.habegger@bfh.ch>
%%
%% 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-tabular.cfg}[2021/12/23 v2.0.0 terminal configuration for bfhlayout]

\RequirePackage{bfhcolors}
\RequirePackage{tcolorbox}
\RequirePackage{url}

\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}

%define key because we receive an error for setting them in case minted isn't loaded
\csname @ifpackageloaded\endcsname{minted}{}{
	\tcbset{minted options/.style={}}
}


\newcommand{\BFHterminalFormatLine}{%
	\def\FancyVerbFormatLine##1{\BFHterminalPrompt{}##1}%
}
\newtcblisting{ubuntu}{ %
  colback=ubuntu-terminalBackground,
  colupper=ubuntu-terminalText,
  colframe=ubuntu-terminalFrame,
  listing only,
  listing options={style=tcblatex,language=sh,escapeinside=``,},
  listing inputencoding=utf8,
  minted options={escapeinside=\\`\\`,autogobble,formatcom=\BFHterminalFormatLine,breaklines,breaksymbol=\quad},
  size=small,
  halign title=flush left,
  title={\textcolor{ubuntu-terminalFirstBullet}{\huge{$\bullet$}}{\textcolor{ubuntu-terminalSecondBullet}{\huge{$\bullet$}}}{\textcolor{ubuntu-terminalThirdBullet}{\huge{$\bullet$}}}},
  every listing line={\BFHterminalPrompt{}}
} %%

\newcommand{\setupLinuxPrompt}[1]{\pgfkeys{/terminal/.cd,host=ubuntu,#1}%
  \gdef\BFHterminalPrompt{\textcolor{\TerminalColor}{\small\ttfamily\bfseries \TerminalUser\url{@}\TerminalHost{\textcolor{ubuntu-terminalText}:}\textcolor{ubuntu-terminalText}{\url{~}}{\textcolor{ubuntu-terminalText}\TerminalPromptChar}\,}}
  \lstset{backgroundcolor=}
  \lstset{frame=}
  \lstset{numberstyle=}
} %%tabular

\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}

\newtcblisting{macos}{ %
  colback=macosx-terminalBackground,
  colupper=macosx-terminalText,
  colframe=macosx-terminalFrame,
  listing only,
  listing options={style=tcblatex,language=sh,escapeinside=``},
  listing inputencoding=utf8,
  size=small,
  halign title=flush left,
  title={\textcolor{macosx-terminalFirstBullet}{\huge\ttfamily\bfseries{$\bullet$}\textcolor{macosx-terminalSecondBullet}{\huge\ttfamily\bfseries{$\bullet$}\textcolor{macosx-terminalThirdBullet}{\huge\ttfamily\bfseries{$\bullet$}}}}}, 
  every listing line={\BFHterminalPrompt{}},
  minted options={escapeinside=\\`\\`,autogobble,formatcom=\BFHterminalFormatLine,breaklines,breaksymbol=\quad}
}

\newcommand{\setupOSXPrompt}[1]{\pgfkeys{/terminal/.cd,host=macintosh,#1}%
  \gdef\BFHterminalPrompt{\textcolor{\TerminalColor}{\small\ttfamily\bfseries \TerminalUser\url{@}\TerminalHost{\textcolor{macosx-terminalText}:}\textcolor{macosx-terminalText}{\url{~}}{\textcolor{macosx-terminalText}\TerminalPromptChar}\,}}
} %%


\pgfkeys{
  /terminal/.cd,
  user/.code={\gdef\TerminalUser{#1}},user={},
  host/.code={\gdef\TerminalHost{#1}},host={},
  color/.code={\gdef\TerminalColor{#1}},color=whyite,
  prompt char/.code={\gdef\TerminalPromptChar{#1}},
  prompt char=\$,
  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