Set Term = "foot"

# Task Switcher
switcher {
  interval = 700
  icons = true
  labels = false
  cols = 5
}

function("SfwbarInit") {
  SetBarId "bar-0"
  SetLayer "bottom"
}

function("ToggleMinimize") {
  [!Minimized] Minimize
  [Minimized] UnMinimize
}

function("ToggleMaximize") {
  [!Maximized] Maximize
  [Maximized] UnMaximize
}


function("ShowDesktopSaveFocus") {
  [Focused] UserState "2:on"
  [!Focused] UserState "2:off"
}

function("ShowdesktopMinimize") {
  [!Minimized] UserState "on"
  [Minimized] UserState "off"
  [!Minimized] Minimize
}

function("ShowDesktopRestore") {
  [UserState] UnMinimize
}

function("ShowDesktopRestoreFocus") {
  [UserState2] Focus
}

function("ShowDesktopCheckWindow") {
  [!Minimized] UserState "target","2:on"
}

function("ShowDesktopReminimize")
{
  [!Minimized] UserState "on"
  [!Minimized] Minimize
}

function("ShowDesktopUnminimized") {
  [UserState2 | Children] Function "ShowDesktopSaveFocus"
  [UserState2 | Children]  Function "ShowDesktopReminimize"
  [!UserState2 | Children] Function "ShowDesktopRestore"
  [!UserState2 | Children] Function "ShowDesktopRestoreFocus"
  [!UserState2] UserState "off"
  [UserState2] UserState "on"
}

function("ShowDesktop") {
  [!UserState | Children] Function "ShowDesktopSaveFocus"
  [!UserState | Children] Function "ShowDesktopMinimize"
  [UserState] UserState "2:off"
  [UserState| Children ] Function "ShowDesktopCheckWindow"
  [UserState] Function "target","ShowDesktopUnminimized"
  [!UserState] UserState "on"
}

menu("winops") {
  item("Focus", Focus );
  item("Close", Close );
  item("Toggle minimize", Function "ToggleMinimize" );
  item("Toggle maximize", Function "ToggleMaximize" );
}

# Panel layout

layout {
  button {
    style = "launcher"
    value = "/usr/share/icons/Adwaita/scalable/actions/view-app-grid-symbolic.svg"
    action = Exec "wtype -M alt ' ' -m alt"
  }
  button {
    style = "launcher"
    value = "/usr/share/icons/Adwaita/scalable/actions/system-run-symbolic.svg"
    tooltip = "Quick run"
    action = Exec "bash -c \"`drun`\""
  }
  button {
    value = "/usr/share/icons/Adwaita/scalable/devices/tv-symbolic.svg"
    style = "launcher"
    tooltip = "Show Desktop"
    action = Function "target", "ShowDesktop"
  }
  button {
    style = "launcher"
    value = $Term
    tooltip = "Terminal"
    action = Exec $Term
  }
  taskbar "target" {
   rows = 1
    css = "* { -GtkWidget-hexpand:false; }" # stretch horizontally
    icons = true
    group = false
    sort = false
    labels = true
    action[3] = Menu "winops"
    action[2] = Close
  }
  label {
    css = "* { -GtkWidget-hexpand: true; }"
  }
  tray {
    rows = 1
  }
  include("network-module.widget")
  include("cpu.widget")
  include("memory.widget")
}

#CSS
button#launcher, button#module{
  padding: 0px 2px 0px 2px;
  /*background: none;
  background-color: #5F548E;*/
  border-style:none;
  box-shadow: none;
  border-radius: 0;
}

window {
  -GtkWidget-direction: top;
  /*background-color: rgba(0,0,0,0.6);*/
  border-color: rgba(0,0,0,0.3);
}

#hidden {
  -GtkWidget-visible: false;
}

button#taskbar_normal grid {
  -GtkWidget-hexpand: false;
  padding-right: 0px;
  margin-right: 0px;
}
button#launcher image, button#taskbar_normal image, button#taskbar_active image, button#taskbar_normal:hover image {
  -GtkWidget-vexpand: true;
  box-shadow: none;
  border: none;
  border-image: none;
  background-image: none;
  background: none;
  min-width: 24px;
  min-height: 24px;
  -gtk-icon-shadow: none;
}

button#taskbar_normal label, button#taskbar_active label, button#taskbar_normal:hover label {
  -GtkWidget-vexpand: true;
  -GtkWidget-hexpand: false;
  padding-left: 0.75mm;
  padding-top: 0px;
  padding-bottom: 0px;
  font: 0.3cm Sans;
}

button#taskbar_normal , button#taskbar_active , button#taskbar_normal:hover {
  padding-left: 0.75mm;
  padding-top: 0.5mm;
  padding-bottom: 0.5mm;
  background-image: none;
  border-radius: 0;
  border-image: none;
  -GtkWidget-hexpand: false;
  -GtkWidget-vexpand: true;
  background-color: rgba(119,119,119,0.2);
  border: none;
  /*border-color: rgba(119,119,119,0.3);*/
  box-shadow: none;
}

button#taskbar_normal label {
  color: black;
}

button#taskbar_active {
  /* background-color: rgba(255,255,255,0.2);
   border-color: rgba(255,255,255,0.4); */
   border-bottom:3px solid #5F548E;
}
button#taskbar_active label, button#taskbar_normal:hover label {
   color: #5F548E;
}
/* button#taskbar_active:hover*/
button#taskbar_normal:hover  {
  background-color: #d2d2d2;
  border-color: rgba(234,234,234,0.44);
}

grid#switcher_active image,
grid#switcher_active {
  min-width: 1.25cm;
  min-height: 1.25cm;
  border-image: none;
  padding: 1.25mm;
  background-color: #777777;
  border: 0px;
  box-shadow: none;
  border-radius: 1.25mm;
  -GtkWidget-hexpand: true;
}

grid#switcher_normal image,
grid#switcher_normal {
  min-width: 1.25cm;
  min-height: 1.25cm;
  border-image: none;
  padding: 1.25mm;
  -GtkWidget-direction: right;
  -GtkWidget-hexpand: true;
}

window#switcher { 
  border-style: solid;
  border-width: 0.25mm;
  border-color: #000000;
  border-radius: 1.25mm; 
  padding: 1.25mm; 
  -GtkWidget-hexpand: true;
}

grid#switcher { 
  border-radius: 1.25mm;
  padding: 1.25mm;
  background-color: rgba(0,0,0,0.8);
  border-color: rgba(119,119,119,0.8);
  box-shadow: none;
  -GtkWidget-hexpand: true;
}

button#tray_active,
button#tray_passive,
button#tray_attention {
  background-image: none;
  border: 0px;
  padding: 0px 1px;
  margin: 0px;
  border-image: none;
  border-radius: 0px;
  outline-style: none;
  box-shadow: none;
  -GtkWidget-hexpand: true;
  -GtkWidget-vexpand: true;
}

button#tray_active image,
button#tray_passive image,
button#tray_attention image {
  min-width: 26px;
}

grid#layout {
  padding: 0.25mm;
  -GtkWidget-direction: right;
  min-height: 30px;
}

menu {
  background-color: rgba(0,0,0,0.8);
  border-color: rgba(119,119,119,0.3);
  box-shadow: none;
}

menuitem {
color: #ffffff;
}

menu image {
  min-width: 24px;
  min-height: 24px;
  padding-right: 5px;
}

chart#cpu_chart {
  background: rgba(127,127,127,0.3);
  min-width: 9px;
  -GtkWidget-vexpand: true;
  margin: 2px;
  border: 1px solid @theme_fg_color;
  color: red;
}

progressbar#memory {
  -GtkWidget-direction: top;
  -GtkWidget-vexpand: true;
  min-width: 9px;
  border: 1px solid @theme_fg_color;
  margin: 2px;
}

progressbar#memory trough {
  min-height: 2px;
  min-width: 9px;
  border: none;
  border-radius: 0px;
  background: rgba(127,127,127,0.3);
}

progressbar#memory progress {
  -GtkWidget-hexpand: true;
  min-width: 9px;
  border-radius: 0px;
  border: none;
  margin: 0px;
  background-color: alpha(green,0.9);
}


label {
  font: 0.27cm Sans;
  color: #ffffff;
  text-shadow: none;
}

* {
  -GtkWidget-vexpand: true;
}
