From bf5e7e96365331d6ae2e4011d9eba123e6e4c46a Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Wed, 28 Jun 2023 06:14:30 +0000 Subject: [PATCH] Add initial ironbar --- flake.lock | 24 +++++++++++++++++ flake.nix | 6 +++++ modules/devenv/flake.nix | 6 +++++ modules/hyprland/hyprland.conf | 1 + modules/ironbar/config.corn | 13 ++++++++++ modules/ironbar/default.nix | 16 ++++++++++++ modules/ironbar/style.css | 47 ++++++++++++++++++++++++++++++++++ modules/system.nix | 3 +++ modules/user/general.nix | 4 +++ 9 files changed, 120 insertions(+) create mode 100644 modules/ironbar/config.corn create mode 100644 modules/ironbar/default.nix create mode 100644 modules/ironbar/style.css diff --git a/flake.lock b/flake.lock index 6fdc4f2..5e5e8f5 100644 --- a/flake.lock +++ b/flake.lock @@ -147,6 +147,29 @@ "type": "github" } }, + "ironbar": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": [ + "rust-overlay" + ] + }, + "locked": { + "lastModified": 1687796165, + "narHash": "sha256-DyPw8sIAQh5GzUbn0zyQrzpOYOF//jDUtAKLLMC8rrM=", + "owner": "JakeStanger", + "repo": "ironbar", + "rev": "44313bfc75d1a8449f2ffb3d0731df167b80f8de", + "type": "github" + }, + "original": { + "owner": "JakeStanger", + "repo": "ironbar", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1687502512, @@ -201,6 +224,7 @@ "hyprland": "hyprland", "hyprland-hy3": "hyprland-hy3", "hyprpaper": "hyprpaper", + "ironbar": "ironbar", "nixpkgs": "nixpkgs", "nur": "nur", "rust-overlay": "rust-overlay", diff --git a/flake.nix b/flake.nix index 95df3d2..7d4c789 100755 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + ironbar = { + url = "github:JakeStanger/ironbar"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.rust-overlay.follows = "rust-overlay"; + }; + nur.url = "github:nix-community/NUR"; # devenv diff --git a/modules/devenv/flake.nix b/modules/devenv/flake.nix index df11816..e767092 100644 --- a/modules/devenv/flake.nix +++ b/modules/devenv/flake.nix @@ -31,6 +31,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + ironbar = { + url = "github:JakeStanger/ironbar"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.rust-overlay.follows = "rust-overlay"; + }; + nur.url = "github:nix-community/NUR"; # devenv diff --git a/modules/hyprland/hyprland.conf b/modules/hyprland/hyprland.conf index 8057717..0fde6df 100644 --- a/modules/hyprland/hyprland.conf +++ b/modules/hyprland/hyprland.conf @@ -75,6 +75,7 @@ plugin { monitor = , preferred, auto, 1 layerrule = blur, wofi +layerrule = blur, ironbar windowrulev2 = float, class:^(opensnitch_ui)$ windowrulev2 = dimaround, class:^(opensnitch_ui)$ diff --git a/modules/ironbar/config.corn b/modules/ironbar/config.corn new file mode 100644 index 0000000..1eb1e95 --- /dev/null +++ b/modules/ironbar/config.corn @@ -0,0 +1,13 @@ +{ + position = "left" + + margin = { + top = 3 + bottom = 3 + right = 5 + } + + start = [ + { type = "workspaces" } + ] +} diff --git a/modules/ironbar/default.nix b/modules/ironbar/default.nix new file mode 100644 index 0000000..7c5438a --- /dev/null +++ b/modules/ironbar/default.nix @@ -0,0 +1,16 @@ +{ system, inputs, config, lib, impurity, ... }: { + home-manager.users.${config.main-user} = { + imports = [ inputs.ironbar.homeManagerModules.default ]; + + programs.ironbar = { + enable = true; + package = inputs.ironbar.packages.${system}.default; + }; + + xdg.configFile = { + "ironbar/config.json".enable = false; + "ironbar/config.corn".source = (impurity.link ./config.corn); + "ironbar/style.css".source = (impurity.link ./style.css); + }; + }; +} diff --git a/modules/ironbar/style.css b/modules/ironbar/style.css new file mode 100644 index 0000000..b1c0caf --- /dev/null +++ b/modules/ironbar/style.css @@ -0,0 +1,47 @@ +* { + background: transparent; + border: none; + padding: 0; +} + +.background { + background-color: rgba(0x00, 0x10, 0x17, 0.4); + + border-width: 2px; + border-style: solid; + border-left-width: 0; + border-radius: 10px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + border-color: rgba(0x59, 0x59, 0x59, 0.7); +} + +#bar { + margin: 7px; + margin-left: 0; +} + +.popup { + margin-left: 0; +} + +.workspaces > .item { + padding: 4px 0; + border-radius: 0; + border-left-width: 4px; + border-style: solid; + border-color: transparent; + padding-right: 4px; +} + +.workspaces > .item.focused { + border-color: rgba(0x59, 0x59, 0x59, 0.5); + background-color: rgba(0xff, 0xff, 0xff, 0.1); + border-top-right-radius: 5px; + border-bottom-right-radius: 5px; +} + +.clock { + border-radius: 0; + box-shadow: none; +} diff --git a/modules/system.nix b/modules/system.nix index f0a0b2c..13804ce 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -14,6 +14,9 @@ # power management services.tlp.enable = true; + # battery status in ironbar + services.upower.enable = true; + environment.systemPackages = with pkgs; [ git vim diff --git a/modules/user/general.nix b/modules/user/general.nix index b129ae9..297c5ab 100644 --- a/modules/user/general.nix +++ b/modules/user/general.nix @@ -1,4 +1,8 @@ { system, inputs, pkgs, config, ... }: { + imports = [ + ../ironbar + ]; + system.extraDependencies = with pkgs; [ ungoogled-chromium ]; fonts = {