diff --git a/flake.lock b/flake.lock index def7406..535602d 100755 --- a/flake.lock +++ b/flake.lock @@ -58,6 +58,24 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -122,6 +140,27 @@ "type": "github" } }, + "ironbar": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1685985608, + "narHash": "sha256-SSJ8y34G/ygc0a7V/HouUzdbJsn+r++vtxpxuQknQsI=", + "owner": "JakeStanger", + "repo": "ironbar", + "rev": "b4f1c7ac2d101ba52237252fe87476b00ab21bd6", + "type": "github" + }, + "original": { + "owner": "JakeStanger", + "repo": "ironbar", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1685931219, @@ -160,10 +199,33 @@ "disko": "disko", "home-manager": "home-manager", "hyprland": "hyprland", + "ironbar": "ironbar", "nixpkgs": "nixpkgs", "sops-nix": "sops-nix" } }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "ironbar", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685500416, + "narHash": "sha256-P6wLC+P8o9w4XNLZAbZy3BwKkp1xi/+H9dF+7SXDP70=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "9651f0beee6e7a9783cc02eac722854851c65ae7", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "sops-nix": { "inputs": { "nixpkgs": [ @@ -185,6 +247,21 @@ "type": "github" } }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1667395993, diff --git a/flake.nix b/flake.nix index 3179c16..de61e91 100755 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,10 @@ url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; + ironbar = { + url = "github:JakeStanger/ironbar"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, diff --git a/home/README.md b/home/README.md index 8932b10..a2371ab 100644 --- a/home/README.md +++ b/home/README.md @@ -10,6 +10,7 @@ name | description `git` | version control system `gtk` | themes `helix` | modal text editor +`ironbar` | wayland specific bar, written in Rust `lazygit` | terminal based git command system `lf` | terminal based file manager `librewolf` | a hardened firefox fork, and my browser of choice @@ -18,7 +19,6 @@ name | description `nushell` | my shell of choice `rofi` | application launcher `starship` | shell prompt -`waybar` | wayland-specific bar `wayland` | has my hyprland config, along with session variables for wayland `wezterm` | my terminal of choice `zathura` | pdf viewer diff --git a/home/ironbar/default.nix b/home/ironbar/default.nix new file mode 100644 index 0000000..c6849eb --- /dev/null +++ b/home/ironbar/default.nix @@ -0,0 +1,71 @@ +{ + pkgs, + lib, + ... +}: let + compileSCSS = name: source: "${pkgs.runCommandLocal name {} '' + mkdir -p $out + ${lib.getExe pkgs.sassc} -t expanded '${source}' > $out/${name}.css + ''}/${name}.css"; +in { + programs.ironbar = { + enable = true; + systemd = true; + style = builtins.readFile (compileSCSS "style" ./style.scss); + config = let + nixlogo = { + type = "custom"; + bar = [ + { + type = "image"; + src = "https://files.artturin.com/files/nixoscolorful.svg"; + size = 24; + } + ]; + }; + pfp = { + type = "custom"; + bar = [ + { + type = "image"; + src = "https://img.notohh.dev/JoYRnUdM.png"; + size = 24; + } + ]; + }; + uptime = { + type = "sys_info"; + format = ["{uptime}"]; + }; + focused = { + type = "focused"; + show_icon = true; + icon_size = 24; + truncate = { + mode = "end"; + length = 12; + }; + }; + sys-info = { + type = "sys_info"; + format = [ + "{cpu_percent}% 󰍛 " + "{memory_percent}%  " + "{net_up:enp2s0}  {net_down:enp2s0}" + ]; + }; + tray = {type = "tray";}; + clock = {type = "clock";}; + in { + monitors = { + "DP-3" = { + position = "top"; + anchor_to_edges = true; + start = [nixlogo]; + center = [focused]; + end = [sys-info clock]; + }; + }; + }; + }; +} diff --git a/home/ironbar/style.scss b/home/ironbar/style.scss new file mode 100644 index 0000000..57f0094 --- /dev/null +++ b/home/ironbar/style.scss @@ -0,0 +1,98 @@ + +$rosewater: #f5e0dc; +$flamingo: #f2cdcd; +$pink: #f5c2e7; +$mauve: #cba6f7; +$red: #f38ba8; +$maroon: #eba0ac; +$peach: #fab387; +$yellow: #f9e2af; +$green: #a6e3a1; +$teal: #94e2d5; +$sky: #89dceb; +$sapphire: #74c7ec; +$blue: #89b4fa; +$lavender: #b4befe; + +$text: #cdd6f4; +$subtext1: #bac2de; +$subtext0: #a6adc8; +$overlay2: #9399b2; +$overlay1: #7f849c; +$overlay0: #6c7086; + +$surface2: #585b70; +$surface1: #45475a; +$surface0: #313244; + +$base: #1e1e2e; +$mantle: #181825; +$crust: #11111b; + +* { + all: unset; + font-family: jost; + font-size: 13px; + font-weight: bold; + color: $text; +} + +#bar { + /* padding-top: 0.6rem; */ + padding-left: 1.4rem; + padding-right: 1.4rem; +} + +#bar { + #start { + background-color: $base; + border-radius: 8px; + border: 3px solid $sky; + padding-left: 0.5rem; + padding-right: 0.5rem; + } +} + +#bar { + #center { + background-color: $base; + border-radius: 18px; + border: 3px solid $pink; + padding-left: 1rem; + padding-right: 1rem; + } +} + +#bar { + #end { + background-color: $base; + border-radius: 8px; + border: 3px solid $sky; + padding-left: 0.5rem; + padding-right: 0.5rem; + } +} + +.sys-info { + padding: 0.8rem; +} + +.clock { + padding-left: 0.8rem; +} + +.popup-clock { + .calendar { + background-color: $base; + border-radius: 8px; + border: 3px solid $sky; + padding-left: 0.2rem; + padding-right: 0.2rem; + .header { + border: none; + } + } + .calendar:selected { + background-color: $overlay1; + } +} \ No newline at end of file diff --git a/home/waybar/assets/nixos.png b/home/waybar/assets/nixos.png deleted file mode 100644 index acbaad4..0000000 Binary files a/home/waybar/assets/nixos.png and /dev/null differ diff --git a/home/waybar/default.nix b/home/waybar/default.nix deleted file mode 100644 index e7175be..0000000 --- a/home/waybar/default.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - inputs, - pkgs, - lib, - ... -}: let - compileSCSS = name: source: "${pkgs.runCommandLocal name {} '' - mkdir -p $out - ${lib.getExe pkgs.sassc} -t expanded '${source}' > $out/${name}.css - ''}/${name}.css"; -in { - programs.waybar = { - enable = true; - package = inputs.hyprland.packages.${pkgs.system}.waybar-hyprland; - settings = { - mainBar = { - output = "DP-3"; - layer = "top"; - position = "top"; - height = 35; - width = 1880; - spacing = 10; - margin-top = 8; - modules-left = [ - "image/nixos" - "user" - "wlr/workspaces" - ]; - modules-center = [ - "hyprland/window" - ]; - modules-right = [ - "cpu" - "memory" - "clock" - "tray" - "custom/wlogout" - ]; - "image/nixos" = { - path = "/home/notoh/snowflake/home/waybar/assets/nixos.png"; - size = 24; - }; - "user" = { - format = "{user} up {work_d} days | {work_H} hrs | {work_M} min ↑"; - interval = 60; - icon = false; - }; - "hyprland/window" = { - format = "{}"; - seperate-outputs = true; - max-length = 35; - }; - "wlr/workspaces" = { - format = "{icon}"; - on-click = "activate"; - all-outputs = true; - format-icons = { - "1" = ""; - "2" = ""; - "3" = ""; - "4" = ""; - "5" = ""; - }; - }; - "cpu" = { - format = "{usage}% "; - tooltip = "false"; - interval = "2"; - }; - "memory" = { - format = "{}% "; - interval = "15"; - }; - "clock" = { - tooltip-format = "{:%Y %B}\n{calendar}"; - format-alt = "{:%Y-%m-%d}"; - }; - "tray" = { - spacing = 0; - }; - "custom/wlogout" = { - format = ""; - interval = "once"; - on-click = "wlogout -c 5 -r 5"; - tooltip = "false"; - }; - }; - }; - style = builtins.readFile (compileSCSS "waybar-style" ./style.scss); - }; -} diff --git a/home/waybar/style.scss b/home/waybar/style.scss deleted file mode 100644 index d8036a0..0000000 --- a/home/waybar/style.scss +++ /dev/null @@ -1,146 +0,0 @@ -/* catppuccin mocha variables */ - -$rosewater: #f5e0dc; -$flamingo: #f2cdcd; -$pink: #f5c2e7; -$mauve: #cba6f7; -$red: #f38ba8; -$maroon: #eba0ac; -$peach: #fab387; -$yellow: #f9e2af; -$green: #a6e3a1; -$teal: #94e2d5; -$sky: #89dceb; -$sapphire: #74c7ec; -$blue: #89b4fa; -$lavender: #b4befe; - -$text: #cdd6f4; -$subtext1: #bac2de; -$subtext0: #a6adc8; -$overlay2: #9399b2; -$overlay1: #7f849c; -$overlay0: #6c7086; - -$surface2: #585b70; -$surface1: #45475a; -$surface0: #313244; - -$base: #1e1e2e; -$mantle: #181825; -$crust: #11111b; - -/* init main bar config */ - -* { - all: unset; - font-family: FontAwesome, jost; - font-size: 13px; - font-weight: bold; - color: $text; -} - -window#waybar { - background-color: transparent; -} - -#user, -#workspaces, -#window, -#cpu, -#memory, -#clock, -#tray, -#custom-wlogout { - border-radius: 8px; - background: $base; - padding: 0.5rem; -} - -tooltip { - background-color: transparent; - border: none; -} - -tooltip label { - color: $text; - background-color: $base; - padding: 0.5rem; - border-radius: 8px; - border: 3px solid $overlay1; -} - -image { - background: $base; - border-radius: 8px; - padding-left: 0.5rem; - padding-right: 0.5rem; -} - -#user { - border: 3px solid $pink; -} - -/* workspaces */ - -#workspaces { - button { - min-width: 28px; - } - button.active { - border-bottom: 1px solid $red; - } - border: 3px solid $red; -} - -/* end workspaces */ - -#window { - border-radius: 16px; - border: 3px solid $peach; -} - -#cpu { - border: 3px solid $red; -} - -#memory { - border: 3px solid $mauve; -} - -#clock { - border: 3px solid $maroon; -} - -/* tray */ - -#tray { - border: 3px solid $overlay1; - menu { - background: $base; - border-radius: 8px; - border: 3px solid $overlay1; - padding: 1.0rem; - } -} - -#tray.passive { - border-bottom: 2px solid $base; -} - -#tray.active { - border-bottom: 2px solid $green; -} - -#tray.needs-attention { - border-bottom: 2px solid $red; -} - -/* end tray */ - -/* custom modules */ - -#custom-wlogout { - padding-left: 0.9rem; - padding-right: 0.9rem; -} diff --git a/home/wayland/hyprland/config.nix b/home/wayland/hyprland/config.nix index 0cfe6de..f848ca7 100644 --- a/home/wayland/hyprland/config.nix +++ b/home/wayland/hyprland/config.nix @@ -90,9 +90,6 @@ sensitivity = -0.5 } - - exec-once = waybar & dunst - exec-once = swww init exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP diff --git a/hosts/tsuki/home.nix b/hosts/tsuki/home.nix index ea5756c..7d6d099 100755 --- a/hosts/tsuki/home.nix +++ b/hosts/tsuki/home.nix @@ -9,7 +9,7 @@ ../../home/lf ../../home/zellij ../../home/rofi - ../../home/waybar + ../../home/ironbar ../../home/wayland/hyprland ../../modules/swayidle.nix ]; diff --git a/modules/nix.nix b/modules/nix.nix index 6349e6c..4a3caad 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -26,10 +26,12 @@ substituters = [ "https://hyprland.cachix.org" "https://cache.nixos.org" + "https://jakestanger.cachix.org" ]; trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "jakestanger.cachix.org-1:VWJE7AWNe5/KOEvCQRxoE8UsI2Xs2nHULJ7TEjYm7mM=" ]; }; };