\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern,textcomp}

\usepackage{listings}
\lstdefinelanguage{hgshell}{
  moredelim=[l][\slshape\bfseries]{\$},
  moredelim=[il][\bfseries\color{red!80!black}]{|red>},
}
\lstset{
  language=hgshell,
  basicstyle=\footnotesize\ttfamily,
  columns=fixed,
  basewidth=0.48em,
  showstringspaces=false,
  frame=single,
  framerule=0.4pt,
  rulecolor=\color{structure.fg},
  keywordstyle=\color{structure.fg}\textbf,
  commentstyle=\color{blue!80!black}\textsl,
  backgroundcolor=\color{black!5!white},
}

\usepackage{tikz}
\usetikzlibrary{chains,positioning,shapes,fit,shadows}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}

\tikzstyle{branch}=[blue!60, ->, >=latex, line join=round]
\tikzstyle{tag}=[below, thick, draw=yellow!50!orange, fill=yellow!50]
\tikzstyle{every pin edge}=[<-, shorten <=3pt]
\tikzstyle{every pin}=[thick, draw=blue!50!black, fill=blue!30,
  font=\small]
\tikzstyle{timeline}=[thick, ->]
\tikzstyle{rev}=[rounded corners=1pt, minimum size=3mm,
  draw=blue!50!black!50, top color=white, bottom color=blue!50!black!20]
\tikzstyle{repository}=[cylinder,shape border rotate=90, draw=structure,
  shade, left color=structure!50, right color=structure!50,
  middle color=structure!10, aspect=0.15, minimum height=20mm,
  text width=20mm, text centered]
\tikzstyle{working copy}=[rounded corners, text width=15mm, inner sep=5pt,
  draw=yellow!40!red,
  top color=yellow!10!white,
  bottom color=yellow!20!white]
\tikzstyle{invisible}=[draw,opacity=0]
\tikzstyle{highlight}=[draw=structure, thick, inner sep=6pt, rounded corners]
\tikzstyle{short}=[shorten <=3pt, shorten >=3pt]
\tikzstyle{every join}=[->]
\tikzstyle{join-nw}=[out=90, in=180]
\tikzstyle{join-sw}=[out=-90, in=180]
\tikzstyle{join-es}=[out=0, in=-90]
\tikzstyle{join-en}=[out=0, in=90]
\tikzstyle{box}=[inner sep=6pt, very thick, rounded corners,
  draw=black!80!white, fill=black!5!white]

\mode<presentation>{
  \setbeamercolor{structure}{fg=green!30!black}
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{footline}[frame number]
  \setbeamertemplate{background}{
    \begin{tikzpicture}<0->[overlay, remember picture]
      \node at (current page.center) {
        \includegraphics[height=0.9\textheight]{hg-droplets}
      };
      \ifnum\thepage>1
      \fill[white,opacity=0.95] (current page.north west)
                      rectangle (current page.south east);

      \usebeamercolor{page number in head/foot}
      \node[above right, color=fg, font=\tiny] at (current page.south west)
           {\includegraphics[height=2cm]{pixelman} aragost Trifork};
      \else
      \fill[white,opacity=0.8] (current page.north west)
                      rectangle (current page.south east);
      \fi
    \end{tikzpicture}
  }
}
\mode<handout>{
  \usepackage{pgfpages}
  \pgfpagesuselayout{4 on 1}[a4paper,landscape,border shrink=5mm]
}

\AtBeginSection[]{
  \begin{frame}<beamer>{Outline}
    \tableofcontents[currentsection]
  \end{frame}
}

\AtBeginSubsection[]{
  \begin{frame}<beamer>{Outline}
    \tableofcontents[currentsubsection]
  \end{frame}
}

\newcommand{\cmd}[1]{\texttt{\color{green!40!black}#1}}
\newcommand{\ext}[1]{\texttt{\color{orange!50!red}#1}}
\newcommand{\curl}[1]{\textcolor{CornflowerBlue!60!black}{\url{#1}}}
