From 50cd5e549b62b395b7b9093c4c1fa847047e3507 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Fri, 1 Mar 2024 01:19:38 +0530 Subject: [PATCH] [feat] Add mocha theme for ironbar --- config/nix/linux/default.nix | 2 +- config/nix/linux/ironbar.nix | 283 --------------------------- config/nix/linux/ironbar/default.nix | 86 ++++++++ config/nix/linux/ironbar/ironbar.css | 207 ++++++++++++++++++++ 4 files changed, 294 insertions(+), 284 deletions(-) delete mode 100644 config/nix/linux/ironbar.nix create mode 100644 config/nix/linux/ironbar/default.nix create mode 100644 config/nix/linux/ironbar/ironbar.css diff --git a/config/nix/linux/default.nix b/config/nix/linux/default.nix index 9eab22b0..41fed627 100644 --- a/config/nix/linux/default.nix +++ b/config/nix/linux/default.nix @@ -4,7 +4,7 @@ ../linux/hyprland.nix ../linux/gtk.nix ../linux/anyrun.nix - ../linux/ironbar.nix + ../linux/ironbar ../linux/foot.nix ]; systemd.user.services.spotify-player = { diff --git a/config/nix/linux/ironbar.nix b/config/nix/linux/ironbar.nix deleted file mode 100644 index b1e36287..00000000 --- a/config/nix/linux/ironbar.nix +++ /dev/null @@ -1,283 +0,0 @@ -{ inputs, ... }: { - imports = [ inputs.ironbar.homeManagerModules.default ]; - programs.ironbar = { - enable = true; - config.monitors = { - HDMI-A-2 = { - position = "bottom"; - start = [ - { - type = "launcher"; - favourites = [ "firefox" "discord" ]; - show_names = false; - show_icons = true; - } - { type = "focused"; } - ]; - end = [ - { - type = "clipboard"; - max_items = 3; - truncate.length = 50; - truncate.mode = "end"; - } - { - type = "music"; - player_type = "mpris"; - } - { type = "clock"; } - ]; - }; - DP-1 = { - position = "bottom"; - icon_theme = "Papirus-Dark"; - end = [ - { - type = "sys_info"; - format = [ - " CPU {cpu_percent}% | {temp_c=coretemp-Package-id-0}°C" - " RAM {memory_percent}%" - # -  {disk_used=/home} GiB / {disk_total:/home} GiB ({disk_percent:/home}%) - # - 猪 {load_average=1} | {load_average:5} | {load_average:15} - # - 李 {net_down=eno1} / {net_up:eno1} Mbps - # -  {uptime} - ]; - interval = { - cpu = 1; - temps = 5; - memory = 30; - # disks= 300; - # networks= 3; - }; - } - { type = "tray"; } - ]; - start = [{ - type = "workspaces"; - name_map = { - "1" = "icon:foot"; - "2" = "icon:code"; - "3" = "icon:firefox"; - "4" = "icon:slack"; - "5" = "icon:steam"; - "6" = "icon:misc"; - "7" = "icon:misc"; - "8" = "icon:firefox"; - "9" = "icon:discord"; - "10" = "icon:spotify"; - }; - favorites = [ "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" ]; - all_monitors = true; - }]; - }; - }; - style = '' - @define-color color_bg #2d2d2d; - @define-color color_bg_dark #1c1c1c; - @define-color color_border #424242; - @define-color color_border_active #6699cc; - @define-color color_text #ffffff; - @define-color color_urgent #8f0a0a; - - /* -- base styles -- */ - - * { - font-family: Noto Sans Nerd Font, sans-serif; - font-size: 16px; - border: none; - border-radius: 0; - } - - box, menubar, button { - background-color: @color_bg; - background-image: none; - } - - button, label { - color: @color_text; - } - - button:hover { - background-color: @color_bg_dark; - } - - #bar { - border-top: 1px solid @color_border; - } - - .popup { - border: 1px solid @color_border; - padding: 1em; - } - - - /* -- clipboard -- */ - - .clipboard { - margin-left: 5px; - font-size: 1.1em; - } - - .popup-clipboard .item { - padding-bottom: 0.3em; - border-bottom: 1px solid @color_border; - } - - - /* -- clock -- */ - - .clock { - font-weight: bold; - margin-left: 5px; - } - - .popup-clock .calendar-clock { - color: @color_text; - font-size: 2.5em; - padding-bottom: 0.1em; - } - - .popup-clock .calendar { - background-color: @color_bg; - color: @color_text; - } - - .popup-clock .calendar .header { - padding-top: 1em; - border-top: 1px solid @color_border; - font-size: 1.5em; - } - - .popup-clock .calendar:selected { - background-color: @color_border_active; - } - - - /* -- launcher -- */ - - .launcher .item { - margin-right: 4px; - } - - .launcher .item:not(.focused):hover { - background-color: @color_bg_dark; - } - - .launcher .open { - border-bottom: 1px solid @color_text; - } - - .launcher .focused { - border-bottom: 2px solid @color_border_active; - } - - .launcher .urgent { - border-bottom-color: @color_urgent; - } - - .popup-launcher { - padding: 0; - } - - .popup-launcher .popup-item:not(:first-child) { - border-top: 1px solid @color_border; - } - - - /* -- music -- */ - - .music:hover * { - background-color: @color_bg_dark; - } - - .popup-music .album-art { - margin-right: 1em; - } - - .popup-music .icon-box { - margin-right: 0.4em; - } - - .popup-music .title .icon, .popup-music .title .label { - font-size: 1.7em; - } - - .popup-music .controls *:disabled { - color: @color_border; - } - - .slider slider { - color: @color_urgent; - background-color: @color_urgent; - } - - .popup-music .volume .slider slider { - border-radius: 100%; - } - - .popup-music .volume .icon { - margin-left: 4px; - } - - .popup-music .progress .slider slider { - border-radius: 100%; - } - - /* -- script -- */ - - .script { - padding-left: 10px; - } - - - /* -- sys_info -- */ - - .sysinfo { - margin-left: 10px; - } - - .sysinfo .item { - margin-left: 5px; - } - - - /* -- tray -- */ - - .tray { - margin-left: 10px; - } - - - /* -- workspaces -- */ - - .workspaces .item.focused { - box-shadow: inset 0 -3px; - background-color: @color_bg_dark; - } - - .workspaces .item:hover { - box-shadow: inset 0 -3px; - } - - - /* -- custom: power menu -- */ - - .popup-power-menu #header { - font-size: 1.4em; - padding-bottom: 0.4em; - margin-bottom: 0.6em; - border-bottom: 1px solid @color_border; - } - - .popup-power-menu .power-btn { - border: 1px solid @color_border; - padding: 0.6em 1em; - } - - .popup-power-menu #buttons > *:nth-child(1) .power-btn { - margin-right: 1em; - } - - ''; - }; -} diff --git a/config/nix/linux/ironbar/default.nix b/config/nix/linux/ironbar/default.nix new file mode 100644 index 00000000..5c0fa1c4 --- /dev/null +++ b/config/nix/linux/ironbar/default.nix @@ -0,0 +1,86 @@ +{ inputs, pkgs, ... }: { + imports = [ inputs.ironbar.homeManagerModules.default ]; + programs.ironbar = { + enable = true; + config.monitors = { + HDMI-A-2 = { + position = "bottom"; + start = [ + { + type = "launcher"; + favourites = [ "firefox" "discord" ]; + show_names = false; + show_icons = true; + } + { type = "focused"; } + ]; + end = [ + { + type = "clipboard"; + max_items = 3; + truncate.length = 50; + truncate.mode = "end"; + } + { + type = "music"; + player_type = "mpris"; + } + { type = "clock"; } + ]; + }; + DP-1 = { + position = "bottom"; + icon_theme = "Papirus-Dark"; + end = [ + { + type = "sys_info"; + format = [ + " CPU {cpu_percent}% | {temp_c:coretemp-Package-id-0}°C" + " RAM {memory_used}GB/{memory_total}GB ({memory_percent})%" + ]; + interval = { + cpu = 1; + temps = 5; + memory = 30; + # disks= 300; + # networks= 3; + }; + } + { type = "tray"; } + ]; + start = [{ + type = "workspaces"; + name_map = { + "1" = "icon:foot"; + "2" = "icon:code"; + "3" = "icon:firefox"; + "4" = "icon:slack"; + "5" = "icon:steam"; + "6" = "icon:misc"; + "7" = "icon:misc"; + "8" = "icon:firefox"; + "9" = "icon:discord"; + "10" = "icon:spotify"; + }; + favorites = [ "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" ]; + all_monitors = true; + }]; + }; + }; + style = + let + # mocha = fetchurl { + # url = "https://github.com/catppuccin/waybar/releases/download/v1.0/mocha.css"; + # sha256 = pkgs.lib.fakeSha256; + # }; + catppuccin = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "waybar"; + rev = "v1.0"; + sha256 = "sha256-vfwfBE3iqIN1cGoItSssR7h0z6tuJAhNarkziGFlNBw"; + }; + mocha = builtins.readFile "${catppuccin}/mocha.css"; + in + mocha + builtins.readFile ./ironbar.css; + }; +} diff --git a/config/nix/linux/ironbar/ironbar.css b/config/nix/linux/ironbar/ironbar.css new file mode 100644 index 00000000..c7e2a2b4 --- /dev/null +++ b/config/nix/linux/ironbar/ironbar.css @@ -0,0 +1,207 @@ +@define-color color_bg @base; +@define-color color_bg_dark @mantle; +@define-color color_border @crust; +@define-color color_border_active @mauve; +@define-color color_text #ffffff; +@define-color color_urgent @lavender; + +/* -- base styles -- */ + +* { + font-family: Noto Sans Nerd Font, sans-serif; + font-size: 16px; + border: none; + border-radius: 0; +} + +box, menubar, button { + background-color: @color_bg; + background-image: none; +} + +button, label { + color: @color_text; +} + +button:hover { + background-color: @color_bg_dark; +} + +#bar { + border-top: 1px solid @color_border; +} + +.popup { + border: 1px solid @color_border; + padding: 1em; +} + + +/* -- clipboard -- */ + +.clipboard { + margin-left: 5px; + font-size: 1.1em; +} + +.popup-clipboard .item { + padding-bottom: 0.3em; + border-bottom: 1px solid @color_border; +} + + +/* -- clock -- */ + +.clock { + font-weight: bold; + margin-left: 5px; +} + +.popup-clock .calendar-clock { + color: @color_text; + font-size: 2.5em; + padding-bottom: 0.1em; +} + +.popup-clock .calendar { + background-color: @color_bg; + color: @color_text; +} + +.popup-clock .calendar .header { + padding-top: 1em; + border-top: 1px solid @color_border; + font-size: 1.5em; +} + +.popup-clock .calendar:selected { + background-color: @color_border_active; +} + + +/* -- launcher -- */ + +.launcher .item { + margin-right: 4px; +} + +.launcher .item:not(.focused):hover { + background-color: @color_bg_dark; +} + +.launcher .open { + border-bottom: 1px solid @color_text; +} + +.launcher .focused { + border-bottom: 2px solid @color_border_active; +} + +.launcher .urgent { + border-bottom-color: @color_urgent; +} + +.popup-launcher { + padding: 0; +} + +.popup-launcher .popup-item:not(:first-child) { + border-top: 1px solid @color_border; +} + + +/* -- music -- */ + +.music:hover * { + background-color: @color_bg_dark; +} + +.popup-music .album-art { + margin-right: 1em; +} + +.popup-music .icon-box { + margin-right: 0.4em; +} + +.popup-music .title .icon, .popup-music .title .label { + font-size: 1.7em; +} + +.popup-music .controls *:disabled { + color: @color_border; +} + +.slider slider { + color: @color_urgent; + background-color: @color_urgent; +} + +.popup-music .volume .slider slider { + border-radius: 100%; +} + +.popup-music .volume .icon { + margin-left: 4px; +} + +.popup-music .progress .slider slider { + border-radius: 100%; +} + +/* -- script -- */ + +.script { + padding-left: 10px; +} + + +/* -- sys_info -- */ + +.sysinfo { + margin-left: 10px; +} + +.sysinfo .item { + margin-left: 5px; +} + + +/* -- tray -- */ + +.tray { + margin-left: 10px; +} + + +/* -- workspaces -- */ + +.workspaces .item.focused { + box-shadow: inset 0 -3px; + background-color: @color_bg_dark; +} + +.workspaces .item:hover { + box-shadow: inset 0 -3px; +} + + +/* -- custom: power menu -- */ + +.popup-power-menu #header { + font-size: 1.4em; + padding-bottom: 0.4em; + margin-bottom: 0.6em; + border-bottom: 1px solid @color_border; +} + +.popup-power-menu .power-btn { + border: 1px solid @color_border; + padding: 0.6em 1em; +} + +.popup-power-menu #buttons > *:nth-child(1) .power-btn { + margin-right: 1em; +} + +