From 7ce9989379c3b805205ac6634ed48b44e2041843 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Tue, 21 Nov 2023 21:03:00 +0300 Subject: [PATCH] Make Nu set title to command and add waybar config options for some programs --- machines/enka/nushell/configuration.nu | 12 +++++++++- machines/enka/waybar/default.nix | 33 +++++++++++++++----------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/machines/enka/nushell/configuration.nu b/machines/enka/nushell/configuration.nu index 01b1dc8..a1b9f21 100644 --- a/machines/enka/nushell/configuration.nu +++ b/machines/enka/nushell/configuration.nu @@ -188,7 +188,17 @@ $env.config.hooks = { command_not_found: {} display_output: "if (term size).columns >= 100 { table --expand } else { table }" env_change: {} - pre_execution: [] + pre_execution: [ + { + let prompt = (commandline) | str trim + + if ($prompt | is-empty) { + return + } + + echo $"(ansi title)($prompt) - nu(char bel)" + } + ] pre_prompt: [] } diff --git a/machines/enka/waybar/default.nix b/machines/enka/waybar/default.nix index 40b13a8..c525d9f 100644 --- a/machines/enka/waybar/default.nix +++ b/machines/enka/waybar/default.nix @@ -26,7 +26,12 @@ homeConfiguration "nixos" { "hyprland/window" ]; - "hyprland/window".seperate-outputs = true; + "hyprland/window" = { + seperate-outputs = true; + + rewrite."(.*) — Mozilla Firefox" = "󰖟 $1"; + rewrite."(.*) - nu" = " $1"; + }; modules-right = [ "tray" @@ -40,10 +45,10 @@ homeConfiguration "nixos" { ]; pulseaudio = { - format = "{volume}% {icon} {format_source}"; - format-bluetooth = "{volume}% {icon}󰂯 {format_source}"; - format-bluetooth-muted = "󰝟 {icon}󰂯 {format_source}"; - format-muted = "󰝟 {format_source}"; + 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 = "󰍭"; @@ -57,7 +62,7 @@ homeConfiguration "nixos" { }; backlight = { - format = "{percent}% {icon}"; + format = "{icon} {percent}%"; format-icons = [ "" "" @@ -71,20 +76,20 @@ homeConfiguration "nixos" { ]; }; - cpu.format = "{usage}% "; - memory.format = "{}% "; + cpu.format = " {usage}%"; + memory.format = " {}%"; network = { format-disconnected = "󰤮"; - format-ethernet = "{ipaddr}/{cidr} 󰈀"; - format-linked = "{ifname} (No IP) "; - format-wifi = "{essid} {signalStrength}% "; + format-ethernet = "󰈀 {ipaddr}/{cidr}"; + format-linked = " {ifname} (No IP)"; + format-wifi = "{essid}  {signalStrength}%"; }; battery = { - format = "{capacity}% {icon}"; - format-charging = "{capacity}% 󰂄"; - format-plugged = "{capacity}% 󰂄"; + format = "{icon} {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󰂄 {capacity}%"; format-icons = [ "󰁺"