{ isLaptop, ... }:

let
  laptop_power =
''
        {
          type = "upower"
          format = "{percentage}%"
        }
'';
in
{
  home.file.".config/ironbar/config.corn".text = ''
let {
  $uwsm = "app2unit -- {app_name}"
} in {
  monitors.${if isLaptop then "eDP-1" else "DP-3"} = {
    position = "bottom"
    height = 32
    start = [
      {
        type = "menu"
        label_icon = "distributor-logo-nixos"
        label = ""
        label_icon_size = 44
        width = 512
        launch_command = $uwsm
      }
      {
        type = "launcher"
        favorites = [ "firefox" "Dolphin" "kitty" "prismlauncher" "Sober" ]
        show_names = false
        show_icons = true
        reversed = false
        launch_command = $uwsm
      }
      {
        type = "focused"
        show_icon = false
        show_title = true
        icon_size = 24

        truncate.mode = "end"
        truncate.max_length = 25
      }
    ]
    center = [
      { type = "music" }
      {
        type = "clock" justify = "left"
        format = "  %H:%M:%S\n%d/%m/%Y"
        format_popup = "Calendrier"
      }
      {
        type = "sys_info"
        interval.cpu = 1
        format = [ "   {cpu_percent@mean}% {cpu_frequency@max#M} MHz   " ]
      }
      { type = "volume" }
    ]
    end = [
      ${if isLaptop then laptop_power else ""}
      //{ type = "network_manager" icon_size = 32 }
      { type = "tray" icon_size = 32 }
    ]
  }
  icon_theme = "Papirus-Dark"
}
'';

  home.file.".config/ironbar/style.css".text = ''
.container {
    font-family: MesloLGSDZ Nerd Font;
    /*  font-family: CaskaydiaCove Nerd Font; */
    /*  font-weight: bold; */
    font-size: 18px;
}

.cava {
    padding: 0px 20px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 8px;
    border-radius: 10px;
    color: #7dcfff;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}

.background {
    background-color: rgba(0, 0, 0, 0);
}

.wlogout {
    padding: 0px 15px 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 8px;
    border-radius: 10px;
    color: #ff757f;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
.wlogout:hover {
    color: #7dcfff;
    background: #1a1b26;
    border-radius: 10px;
    min-width: 30px;
    transition: all 0.3s ease-in-out;
    opacity: 0.8;
}
.airpod {
    padding: 0px 15px 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 8px;
    border-radius: 10px;
    color: #ff757f;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
.airpod:hover {
    color: #7dcfff;
    background: #1a1b26;
    border-radius: 10px;
    min-width: 30px;
    transition: all 0.3s ease-in-out;
    opacity: 0.8;
}
/* cpu */
.sysinfo .item:nth-child(1) {
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 0px;
    border-radius: 10px;
    color: #ff9e64;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
/* memory */
.sysinfo .item:nth-child(2) {
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 0px;
    border-radius: 10px;
    color: #7dcfff;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
/* temp */
.sysinfo .item:nth-child(3) {
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 0px;
    border-radius: 10px;
    color: #bb9af7;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
/* disk */
.sysinfo .item:nth-child(4) {
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 10px;
    border-radius: 10px;
    color: #9ece6a;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
.pacman {
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 10px;
    border-radius: 10px;
    color: #c3e88d;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
.zellij {
    padding: 0px 7px 0px 9px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 8px;
    border-radius: 10px;
    color: #c3e88d;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
.zellij:hover {
    color: #7dcfff;
    background: #1a1b26;
    border-radius: 10px;
    min-width: 30px;
    transition: all 0.3s ease-in-out;
    opacity: 0.8;
}
.volume {
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 10px;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
    color: #9abdf5;
    background: #1a1b26;
    opacity: 0.8;
}

.popup-volume {
    padding: 20px 20px 20px 20px;
    border-radius: 5px;
    color: #c0caf5;
    /* background: #1a1b26; */
    background-color: rgba(26, 27, 38, 0.8);
    border: 2px solid #bb9af7;
}

.weather,
.kbdd {
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 8px;
    border-radius: 10px;
    color: #ff9e64;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}

.clock {
    font-family: CaskaydiaCove Nerd Font;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 10px;
    margin-left: 10px;
    padding-right: 10px;
    padding-left: 10px;
    padding-bottom: 3px;
    border-radius: 10px;
    color: #7dcfff;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}

.clock_date {
    color: rgb(94, 129, 172);
}

.popup-clock {
    font-weight: bolder;
    background-color: rgba(26, 27, 38, 0.8);
    border-radius: 10px;
    border: 2px solid #bb9af7;
}

.popup-clock .calendar-clock {
    color: #c0caf5;
    /*  font-size: 2.5em; */
    padding-bottom: 0.1em;
}

.popup-clock .calendar {
    background-color: rgba(26, 27, 38, 0.8);
    color: #c0caf5;
    border-radius: 10px;
}

.popup-clock .calendar .header {
    padding-top: 1em;
    border-top: 1px solid #424242;
    font-size: 1.5em;
}

.popup-clock .calendar:selected {
    background-color: #3d59a1;
}

.launcher .item {
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 8px;
    margin-left: 8px;
}

.focused {
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 8px;
    margin-left: 8px;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
    color: #c3e88d;
    background: #1a1b26;
    opacity: 0.8;
    /* top right bottom left */
}

.clipboard {
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 8px;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
    color: #9abdf5;
    background: #1a1b26;
    opacity: 0.8;
}

.popup-clipboard {
    margin-left: 5px;
    padding: 10px 10px 10px 10px;
    border-radius: 5px;
    color: #c0caf5;
    background: #1a1b26;
    background-color: rgba(26, 27, 38, 0.8);
    border: 2px solid #bb9af7;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}

.work1,
.work2,
.work3,
.work4,
.work5,
.work6,
.work7,
.work8,
.work9 {
    padding: 0px 5px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 3px;
    border-radius: 10px;
    color: #ff9e64;
    opacity: 0.8;
    background: #1a1b26;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}

.work2 {
    padding: 0px 10px 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 3px;
    border-radius: 10px;
    color: #c3e88d;
    opacity: 0.8;
    background: #1a1b26;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}

.work1:hover,
.work2:hover,
.work3:hover,
.work4:hover,
.work5:hover,
.work6:hover,
.work7:hover,
.work8:hover,
.work9:hover {
    color: #c3e88d;
    background: #1a1b26;
    border-radius: 10px;
    min-width: 40px;
    transition: all 0.3s ease-in-out;
    opacity: 0.8;
}

.script {
    padding: 0px 10px 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 8px;
    margin-left: 8px;
    border-radius: 10px;
    color: #9abdf5;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}

.script:hover {
    color: #7dcfff;
    background: #1a1b26;
    border-radius: 10px;
    min-width: 30px;
    transition: all 0.3s ease-in-out;
    opacity: 0.8;
}

.zscroll {
    border-radius: 10px;
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 7px;
    margin-left: 10px;
    color: #bb9af7;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
.music {
    border-radius: 10px;
    padding: 0px 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 7px;
    margin-left: 10px;
    color: #bb9af7;
    background: #1a1b26;
    opacity: 0.8;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}
.popup-music {
    margin-left: 5px;
    padding: 10px 10px 10px 10px;
    border-radius: 5px;
    color: #c0caf5;
    background: #1a1b26;
    background-color: rgba(26, 27, 38, 0.8);
    border: 2px solid #bb9af7;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}

.popup-music.volume {
}
.popup-music .volume .slider {
    padding: 2px 2px 2px 2px;
    margin-top: 5px;
    margin-bottom: 5px;
    margin-right: 5px;
    margin-left: 5px;
}
.popup-music .volume .icon {
}

tooltip.background {
    background-color: rgba(00, 00, 00, 0.5);
    font-size: 18px;
    border-radius: 10px;
    color: #fdfdfd;
}

tooltip * {
    padding: 4px;
    background-color: transparent;
    color: white;
}

.host tooltip {
    background-color: rgba(255, 00, 00, 0.5);
}

.workspaces {
    background: #1a1b26;
    padding: 5px 5px;
    margin-top: 5px;
    margin-bottom: 15px;
    margin-right: 10px;
    margin-left: 10px;
    border-radius: 10px;
    font-weight: bold;
    font-style: normal;
    opacity: 0.8;
    font-size: 16px;
    color: #ffffff;
    box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
}

.workspaces button {
    padding: 1px 1px;
    margin: 0px 1px;
    border-radius: 19px;
    border: 0px;
    color: #c0caf5;
    background-color: #3b4261;
    transition: all 0.3s ease-in-out;
    opacity: 0.7;
}

.workspaces .item.focused {
    color: #ffffff;
    background: #545c7e;
    border-radius: 19px;
    min-width: 50px;
    transition: all 0.3s ease-in-out;
    opacity: 1;
}

.workspaces button:hover {
    color: #ffffff;
    background: #545c7e;
    border-radius: 15px;
    min-width: 50px;
    opacity: 0.7;
}
'';
}
