From baf0a4a6f0f284d3fe5d581a34350a8c3f1a14e3 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 29 Nov 2023 15:22:48 +0300 Subject: [PATCH] Readd waybar This reverts commit 404f6b266f4fc68bebba8b5550573eb8c088b689. --- .gitignore | 1 + machines/enka/default.nix | 1 + machines/enka/greetd/default.nix | 2 + machines/enka/hyprland/default.nix | 2 + machines/enka/waybar/default.nix | 157 +++++++++++++++++++++++++++++ 5 files changed, 163 insertions(+) create mode 100644 machines/enka/waybar/default.nix diff --git a/.gitignore b/.gitignore index 4421d48..1aa0388 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ !machines/enka/qt/ !machines/enka/steam/ !machines/enka/steck/ +!machines/enka/waybar/ !themes/ diff --git a/machines/enka/default.nix b/machines/enka/default.nix index 51694f8..919956d 100644 --- a/machines/enka/default.nix +++ b/machines/enka/default.nix @@ -37,6 +37,7 @@ ./python ./steam ./steck + ./waybar ./fonts.nix ./localisation.nix diff --git a/machines/enka/greetd/default.nix b/machines/enka/greetd/default.nix index f92a6b6..ff92f45 100644 --- a/machines/enka/greetd/default.nix +++ b/machines/enka/greetd/default.nix @@ -19,6 +19,8 @@ let workspace = 1, default: true, gapsout: 0, gapsin: 0, border: false, decorate: false + exec-once = systemctl --user stop waybar.service + exec-once = [workspace 1; fullscreen; noanim] ${pkgs.greetd.gtkgreet}/bin/gtkgreet --layer-shell --command Hyprland; ${hyprlandBin}}/bin/hyprctl dispatch exit exec-once = ${hyprlandBin}/bin/hyprctl dispatch focuswindow gtkgreet diff --git a/machines/enka/hyprland/default.nix b/machines/enka/hyprland/default.nix index ce6f053..983c2a6 100644 --- a/machines/enka/hyprland/default.nix +++ b/machines/enka/hyprland/default.nix @@ -90,6 +90,8 @@ bind = SUPER, D, exec, discord bind = SUPER, C, exec, hyprpicker --autocopy + bind = SUPER, B, exec, pkill --signal SIGUSR1 waybar + bind = SUPER, SPACE, exec, pkill fuzzel; fuzzel bind = SUPER, V, exec, pkill fuzzel; cliphist list | fuzzel --dmenu | cliphist decode | wl-copy diff --git a/machines/enka/waybar/default.nix b/machines/enka/waybar/default.nix new file mode 100644 index 0000000..4ac685b --- /dev/null +++ b/machines/enka/waybar/default.nix @@ -0,0 +1,157 @@ +{ upkgs, homeConfiguration, enabled, ... }: + +homeConfiguration "nixos" { + programs.waybar = enabled { + systemd = enabled {}; + + settings = [{ + layer = "top"; + height = 30; + + margin-right = 10; + margin-left = 10; + margin-top = 10; + + modules-left = [ + "hyprland/workspaces" + ]; + + "hyprland/workspaces" = { + format = "{icon}"; + format-icons.default = ""; + format-icons.active = ""; + + persistent-workspaces."*" = 5; + }; + + modules-center = [ + "hyprland/window" + ]; + + "hyprland/window" = { + seperate-outputs = true; + + rewrite."(.*) - Discord" = "󰙯 $1"; + rewrite."(.*) — Mozilla Firefox" = "󰖟 $1"; + rewrite."(.*) — nu" = " $1"; + }; + + modules-right = [ + "tray" + "pulseaudio" + "backlight" + "cpu" + "memory" + "network" + "battery" + "clock" + ]; + + pulseaudio = { + format = "{format_source} {icon} {volume}%"; + format-bluetooth = "{format_source} {icon}󰂯 {volume}%"; + format-bluetooth-muted = "{format_source} 󰝟 {icon}󰂯"; + format-muted = "{format_source} 󰝟"; + format-source = "󰍬"; + format-source-muted = "󰍭"; + + format-icons.headphone = "󰋋"; + format-icons.headset = "󰋋"; + format-icons.default = [ + "󰕿" + "󰖀" + "󰕾" + ]; + }; + + backlight = { + format = "{icon} {percent}%"; + format-icons = [ + "" + "" + "" + "" + "" + "" + "" + "" + "" + ]; + }; + + cpu.format = " {usage}%"; + memory.format = " {}%"; + + network = { + format-disconnected = "󰤮"; + format-ethernet = "󰈀 {ipaddr}/{cidr}"; + format-linked = " {ifname} (No IP)"; + format-wifi = "{essid}  {signalStrength}%"; + }; + + battery = { + format = "{icon} {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󰂄 {capacity}%"; + + format-icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + + states.warning = 30; + states.critical = 15; + }; + + clock = { + tooltip-format = "{:%Y %B}\n{calendar}"; + }; + }]; + + style = with upkgs.theme.withHashtag; '' + * { + border: none; + border-radius: 0; + font-family: "OpenSans"; + } + + #waybar { + background: ${base00}; + color: ${base05}; + } + + #waybar:hover { + border: 3px; + border-color: ${base0A}; + } + + #workspace-1 { + color: ${base08}; + } + + #workspace-2 { + color: ${base09}; + } + + #workspace-3 { + color: ${base0A}; + } + + #workspace-4 { + color: ${base0B}; + } + + #workspace-5 { + color: ${base0C}; + } + ''; + }; +}