From 68bcc9a79be66c844f108387343a17f6eadc39c8 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 6 Oct 2024 15:19:56 -0700 Subject: waybar: rename shared modules to common modules --- .../fortune/desktop/waybar/common-modules.nix | 227 +++++++++++++++++++++ .../fortune/desktop/waybar/default-modules.nix | 227 --------------------- .../kansai/fortune/desktop/waybar/default.nix | 8 +- 3 files changed, 231 insertions(+), 231 deletions(-) create mode 100644 home/ebisu/kansai/fortune/desktop/waybar/common-modules.nix delete mode 100644 home/ebisu/kansai/fortune/desktop/waybar/default-modules.nix diff --git a/home/ebisu/kansai/fortune/desktop/waybar/common-modules.nix b/home/ebisu/kansai/fortune/desktop/waybar/common-modules.nix new file mode 100644 index 0000000..3d7d10b --- /dev/null +++ b/home/ebisu/kansai/fortune/desktop/waybar/common-modules.nix @@ -0,0 +1,227 @@ +{ + pkgs, + secrets, + ... +}: +{ + layer = "top"; + position = "top"; + margin-left = 8; + margin-right = 8; + height = 40; + + bluetooth = { + format = ""; + on-click = "${pkgs.blueberry}/bin/blueberry"; + }; + + clock = { + locale = "ja_JP.utf8"; + interval = 5; + tooltip-format = "{calendar}"; + # format = "{:%m月 %d日 %H:%M:%S}"; + format = "{:L%m月 %d日 %H:%M}"; + format-alt = "{:L%G年%b %d日 %A}"; + }; + + # For when clock doesn't work + "custom/clock" = { + exec = "date '+%m月 %d日 %H:%M'"; + tooltip = false; + interval = 5; + }; + + cpu = { + interval = 5; + format = " {usage}% ({load})"; + + states = { + warning = 70; + critical = 90; + }; + + on-click = "${pkgs.kitty}/bin/kitty -e '${pkgs.bottom}/bin/btm'"; + }; + + memory = { + interval = 5; + format = " {}%"; + format-alt = " {used:0.1f}/{total:0.1f}ギガ"; + + # I might remove these. I have 64GB of RAM .... + states = { + warning = 70; + critical = 90; + }; + }; + + network = { + interval = 1; + # format-wifi = " {bandwidthUpBytes} {bandwidthDownBytes}", + # format-ethernet = " {bandwidthUpBytes} {bandwidthDownBytes}", + format = " {bandwidthUpBytes}  {bandwidthDownBytes}"; + format-disconnected = "⚠ Disconnected"; + tooltip-format = "{ifname}: {ipaddr}"; + on-click = "${pkgs.kitty}/bin/kitty -e 'nmtui'"; + }; + + "hyprland/mode" = { + format = "{}"; + tooltip = false; + }; + + "hyprland/window" = { + format = "{}"; + max-length = 120; + separate-outputs = true; + icon = false; + + rewrite = { + "(.*) - Thorium" = "󰖟 $1"; + "(.*) - NVIM" = " $1"; + "ChatGPT" = " ChatGPT"; + "~(.*)" = " ~$1"; + "…(.*)" = " …$1"; + "zsh" = " ~"; + "fish" = " ~"; + "kitty" = " ~"; + "Volume Control" = " Volume Control"; + "Bluetooth" = " Bluetooth"; + "JamesDSP for Linux" = "󰺢 JamesDSP"; + }; + }; + + pulseaudio = { + scroll-step = 1; + format = "{icon} {volume}%"; + # format-bluetooth = "{volume}% {icon}  {format_source}"; + # format-bluetooth-muted = " {icon}  {format_source}"; + format-muted = "󰸈"; + + format-icons = { + headphone = "󰋋"; + hands-free = "וֹ"; + headset = "󱡏"; + phone = ""; + portable = ""; + car = ""; + + default = [ "" ]; + }; + + on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle"; + on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol"; + on-scroll-up = "pactl set-sink-volume @DEFAULT_SINK@ +2%"; + on-scroll-down = "pactl set-sink-volume @DEFAULT_SINK@ -2%"; + ignored-sinks = secrets.waybar.ignored_sinks; + }; + + tray = { + spacing = 10; + show-passive-items = true; + }; + + "image#album-art" = { + path = "/tmp/mediaplayer_art"; + size = 22.5; # (18 + (18 / 4)) + interval = 5; + on-click = "${pkgs.playerctl}/bin/playerctl play-pause"; + }; + + "custom/media" = { + format = "{icon} {}"; + return-type = "json"; + max-length = 40; + + format-icons = { + spotify = " "; + default = "󰗃 "; + }; + + escape = true; + exec = "${pkgs.mediaplayer}/bin/mediaplayer.py 2> /dev/null"; + on-click = "${pkgs.playerctl}/bin/playerctl play-pause"; + on-scroll-up = "${pkgs.playerctl}/bin/playerctl next"; + on-scroll-down = "${pkgs.playerctl}/bin/playerctl previous"; + }; + + cava = { + framerate = 280; + autosens = 1; + sensitivity = 3; + bars = 26; + lower_cutoff_freq = 50; + higher_cutoff_freq = 10000; + method = "pipewire"; + source = "auto"; + stereo = true; + reverse = true; + bar_delimiter = 0; + monstercat = false; + waves = false; + hide_on_silence = true; + noise_reduction = 0.77; + input_delay = 0; + on-click = "${pkgs.playerctl}/bin/playerctl play-pause"; + + # actions = { + # on-click-right = "mode"; + # }; + + # format-icons = ["░", "▒", "▓", "█", "█", "█", "█", "█"] + # format-icons = ["⎺", "⎻", "⎼", "⎽", "⎼", "⎻", "⎺", "⎹"] + # format-icons = ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"] + format-icons = [ + "⠁" + "⠃" + "⠇" + "⠋" + "⠛" + "⠟" + "⠿" + "⣿" + ]; + # format-icons = ["◰", "◳", "◲", "◱", "▘", "▝", "▖", "▗"] + # format-icons = ["▖", "▗", "▘", "▝", "▚", "▞", "▛", "▟"] + # format-icons = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█", "▉", "▊"] + # format-icons = ["⎯", "⎰", "⎱", "⎲", "⎳", "⎴", "⎵", "⎶"] + # format-icons = ["⎺", "⎻", "⎼", "⎽", "⎾", "⎿", "⏀", "⏁"] + # format-icons = ["♪", "♫", "♬", "♭", "♮", "♯", "♩", "♪"] + # format-icons = ["→", "⇉", "⇒", "⇉", "→", "⇉", "⇒", "⇉"] + # format-icons = ["·", ":", "⁙", "⁘", "⁙", ":", "·", "•"] + # format-icons = ["○", "◔", "◑", "◕", "●", "◍", "◎", "◉"] + # format-icons = ["△", "▲", "▴", "▸", "▶", "▹", "►", "▻"] + # format-icons = ["◇", "◈", "◉", "◍", "◎", "◯", "⦿", "◑"] + # format-icons = ["-", "–", "—", "––", "–––", "——", "———", "——––"] + # format-icons = ["-", "=", "≡", "≣", "≠", "≢", "≜", "≝"] + # format-icons = ["✓", "✔", "✕", "✖", "✗", "✘", "✙", "✚"] + # format-icons = ["✩", "✪", "✫", "✬", "✭", "✮", "✯", "✰"] + }; + + "custom/gpu" = { + exec = "nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader | sed 's/ %/%/'"; + interval = 5; + format = " {}"; + on-click = "${pkgs.kitty}/bin/kitty -e '${pkgs.nvtopPackages.nvidia}/bin/nvtop'"; + }; + + modules-left = [ + "hyprland/workspaces" + "hyprland/window" + "custom/media" + "image#album-art" + ]; + + modules-center = [ "clock" ]; + + modules-right = [ + "cava" + # "network" + "tray" + "cpu" + "custom/gpu" + "memory" + "bluetooth" + "pulseaudio" + ]; +} diff --git a/home/ebisu/kansai/fortune/desktop/waybar/default-modules.nix b/home/ebisu/kansai/fortune/desktop/waybar/default-modules.nix deleted file mode 100644 index 3d7d10b..0000000 --- a/home/ebisu/kansai/fortune/desktop/waybar/default-modules.nix +++ /dev/null @@ -1,227 +0,0 @@ -{ - pkgs, - secrets, - ... -}: -{ - layer = "top"; - position = "top"; - margin-left = 8; - margin-right = 8; - height = 40; - - bluetooth = { - format = ""; - on-click = "${pkgs.blueberry}/bin/blueberry"; - }; - - clock = { - locale = "ja_JP.utf8"; - interval = 5; - tooltip-format = "{calendar}"; - # format = "{:%m月 %d日 %H:%M:%S}"; - format = "{:L%m月 %d日 %H:%M}"; - format-alt = "{:L%G年%b %d日 %A}"; - }; - - # For when clock doesn't work - "custom/clock" = { - exec = "date '+%m月 %d日 %H:%M'"; - tooltip = false; - interval = 5; - }; - - cpu = { - interval = 5; - format = " {usage}% ({load})"; - - states = { - warning = 70; - critical = 90; - }; - - on-click = "${pkgs.kitty}/bin/kitty -e '${pkgs.bottom}/bin/btm'"; - }; - - memory = { - interval = 5; - format = " {}%"; - format-alt = " {used:0.1f}/{total:0.1f}ギガ"; - - # I might remove these. I have 64GB of RAM .... - states = { - warning = 70; - critical = 90; - }; - }; - - network = { - interval = 1; - # format-wifi = " {bandwidthUpBytes} {bandwidthDownBytes}", - # format-ethernet = " {bandwidthUpBytes} {bandwidthDownBytes}", - format = " {bandwidthUpBytes}  {bandwidthDownBytes}"; - format-disconnected = "⚠ Disconnected"; - tooltip-format = "{ifname}: {ipaddr}"; - on-click = "${pkgs.kitty}/bin/kitty -e 'nmtui'"; - }; - - "hyprland/mode" = { - format = "{}"; - tooltip = false; - }; - - "hyprland/window" = { - format = "{}"; - max-length = 120; - separate-outputs = true; - icon = false; - - rewrite = { - "(.*) - Thorium" = "󰖟 $1"; - "(.*) - NVIM" = " $1"; - "ChatGPT" = " ChatGPT"; - "~(.*)" = " ~$1"; - "…(.*)" = " …$1"; - "zsh" = " ~"; - "fish" = " ~"; - "kitty" = " ~"; - "Volume Control" = " Volume Control"; - "Bluetooth" = " Bluetooth"; - "JamesDSP for Linux" = "󰺢 JamesDSP"; - }; - }; - - pulseaudio = { - scroll-step = 1; - format = "{icon} {volume}%"; - # format-bluetooth = "{volume}% {icon}  {format_source}"; - # format-bluetooth-muted = " {icon}  {format_source}"; - format-muted = "󰸈"; - - format-icons = { - headphone = "󰋋"; - hands-free = "וֹ"; - headset = "󱡏"; - phone = ""; - portable = ""; - car = ""; - - default = [ "" ]; - }; - - on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle"; - on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol"; - on-scroll-up = "pactl set-sink-volume @DEFAULT_SINK@ +2%"; - on-scroll-down = "pactl set-sink-volume @DEFAULT_SINK@ -2%"; - ignored-sinks = secrets.waybar.ignored_sinks; - }; - - tray = { - spacing = 10; - show-passive-items = true; - }; - - "image#album-art" = { - path = "/tmp/mediaplayer_art"; - size = 22.5; # (18 + (18 / 4)) - interval = 5; - on-click = "${pkgs.playerctl}/bin/playerctl play-pause"; - }; - - "custom/media" = { - format = "{icon} {}"; - return-type = "json"; - max-length = 40; - - format-icons = { - spotify = " "; - default = "󰗃 "; - }; - - escape = true; - exec = "${pkgs.mediaplayer}/bin/mediaplayer.py 2> /dev/null"; - on-click = "${pkgs.playerctl}/bin/playerctl play-pause"; - on-scroll-up = "${pkgs.playerctl}/bin/playerctl next"; - on-scroll-down = "${pkgs.playerctl}/bin/playerctl previous"; - }; - - cava = { - framerate = 280; - autosens = 1; - sensitivity = 3; - bars = 26; - lower_cutoff_freq = 50; - higher_cutoff_freq = 10000; - method = "pipewire"; - source = "auto"; - stereo = true; - reverse = true; - bar_delimiter = 0; - monstercat = false; - waves = false; - hide_on_silence = true; - noise_reduction = 0.77; - input_delay = 0; - on-click = "${pkgs.playerctl}/bin/playerctl play-pause"; - - # actions = { - # on-click-right = "mode"; - # }; - - # format-icons = ["░", "▒", "▓", "█", "█", "█", "█", "█"] - # format-icons = ["⎺", "⎻", "⎼", "⎽", "⎼", "⎻", "⎺", "⎹"] - # format-icons = ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"] - format-icons = [ - "⠁" - "⠃" - "⠇" - "⠋" - "⠛" - "⠟" - "⠿" - "⣿" - ]; - # format-icons = ["◰", "◳", "◲", "◱", "▘", "▝", "▖", "▗"] - # format-icons = ["▖", "▗", "▘", "▝", "▚", "▞", "▛", "▟"] - # format-icons = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█", "▉", "▊"] - # format-icons = ["⎯", "⎰", "⎱", "⎲", "⎳", "⎴", "⎵", "⎶"] - # format-icons = ["⎺", "⎻", "⎼", "⎽", "⎾", "⎿", "⏀", "⏁"] - # format-icons = ["♪", "♫", "♬", "♭", "♮", "♯", "♩", "♪"] - # format-icons = ["→", "⇉", "⇒", "⇉", "→", "⇉", "⇒", "⇉"] - # format-icons = ["·", ":", "⁙", "⁘", "⁙", ":", "·", "•"] - # format-icons = ["○", "◔", "◑", "◕", "●", "◍", "◎", "◉"] - # format-icons = ["△", "▲", "▴", "▸", "▶", "▹", "►", "▻"] - # format-icons = ["◇", "◈", "◉", "◍", "◎", "◯", "⦿", "◑"] - # format-icons = ["-", "–", "—", "––", "–––", "——", "———", "——––"] - # format-icons = ["-", "=", "≡", "≣", "≠", "≢", "≜", "≝"] - # format-icons = ["✓", "✔", "✕", "✖", "✗", "✘", "✙", "✚"] - # format-icons = ["✩", "✪", "✫", "✬", "✭", "✮", "✯", "✰"] - }; - - "custom/gpu" = { - exec = "nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader | sed 's/ %/%/'"; - interval = 5; - format = " {}"; - on-click = "${pkgs.kitty}/bin/kitty -e '${pkgs.nvtopPackages.nvidia}/bin/nvtop'"; - }; - - modules-left = [ - "hyprland/workspaces" - "hyprland/window" - "custom/media" - "image#album-art" - ]; - - modules-center = [ "clock" ]; - - modules-right = [ - "cava" - # "network" - "tray" - "cpu" - "custom/gpu" - "memory" - "bluetooth" - "pulseaudio" - ]; -} diff --git a/home/ebisu/kansai/fortune/desktop/waybar/default.nix b/home/ebisu/kansai/fortune/desktop/waybar/default.nix index f31bef5..877669c 100644 --- a/home/ebisu/kansai/fortune/desktop/waybar/default.nix +++ b/home/ebisu/kansai/fortune/desktop/waybar/default.nix @@ -37,7 +37,7 @@ in settings = let - defaultModules = import ./default-modules.nix { inherit pkgs secrets; }; + commonModules = import ./common-modules.nix { inherit pkgs secrets; }; hyprland-workspaces-base = { disable-scroll = true; @@ -48,7 +48,7 @@ in in [ ( - defaultModules + commonModules // { output = "HDMI-A-2"; "hyprland/workspaces" = hyprland-workspaces-base // { @@ -68,7 +68,7 @@ in } ) ( - defaultModules + commonModules // { output = "DP-2"; "hyprland/workspaces" = hyprland-workspaces-base // { @@ -88,7 +88,7 @@ in } ) ( - defaultModules + commonModules // { output = "DP-1"; "hyprland/workspaces" = hyprland-workspaces-base // { -- cgit v1.2.3