From 19115a9b67fca4a8212eb51784c608ce868ce5bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=A4nner?= Date: Sat, 9 Mar 2024 22:05:29 +0100 Subject: [PATCH] 131 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * --- modules/home-manager/mpd.nix | 4 +-- modules/home-manager/sway.nix | 63 ++++++++++++++++++++++++++++++++++- modules/nixos/rebuild.nix | 2 +- 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/modules/home-manager/mpd.nix b/modules/home-manager/mpd.nix index 55d6d12..f5067ee 100644 --- a/modules/home-manager/mpd.nix +++ b/modules/home-manager/mpd.nix @@ -8,8 +8,8 @@ musicDirectory = "/home/max/Music/"; network.startWhenNeeded = true; extraConfig = '' - restore_paused = yes - auto_update = yes + restore_paused = "yes" + auto_update = "yes" ''; }; services.mpd-mpris.enable = true; diff --git a/modules/home-manager/sway.nix b/modules/home-manager/sway.nix index 45042bb..5d29db0 100644 --- a/modules/home-manager/sway.nix +++ b/modules/home-manager/sway.nix @@ -92,7 +92,56 @@ position = "top"; height = 26; modules-left = ["sway/workspaces" "sway/mode"]; - modules-right = ["sway/language" "clock" "battery"]; + modules-center = ["sway/window"]; + modules-right = ["mpd" "tray" "sway/language" "clock" "backlight" "battery" "network"]; + + "sway/workspaces" = { + disable-scroll = true; + all-outputs = false; + format = "{icon} {name}"; + format-icons = { + "main" = "󰈹"; + "term" = ""; + "msg" = "󰷹"; + "music" = "󰫔"; + "urgent" = ""; + "focused" = ""; + "default" = ""; + }; + }; + + "mpd" = { + format = "{stateIcon}{consumeIcon}{randomIcon}{repeatIcon}{singleIcon} {title} ({elapsedTime:%M:%S}/{totalTime:%M%S}) {volume}"; + format-stopped = "{stateIcon}{randomIcon}{repeatIcon}{singleIcon} Stopped {volume}"; + format-disconnected = ""; + unkown-tag = "N/A"; + interval = 2; + consume-icons = { + on = "󰮯"; + off = ""; + }; + random-icons = { + on = ""; + off = ""; + }; + repeat-icons = { + on = "󰑖"; + off = ""; + }; + single-icons = { + on = "󰑘"; + off = ""; + }; + state-icons = { + paused = "󰏤"; + playing = "󰐊"; + }; + max-length = 50; + }; + + "tray" = { + spacing = 10; + }; "sway/language" = { format = "{shortDescription}"; @@ -103,6 +152,18 @@ interval = 60; format = "{:%a %d.%m %I:%M}"; }; + + "backlight" = { + format = "{percent}% {icon}"; + format-icons = ["󰹐" "󱩎" "󱩏" "󱩐" "󱩑" "󱩒" "󱩓" "󱩔" "󱩕" "󱩖" "󰛨"]; + }; + + "network" = { + format-wifi = "{essid} ({signalStrength}%) 󰖩"; + format-ethernet = "{ipaddr}/{cidr} 󰈀"; + tooltip-format = "{ifname} via {gwaddr} 󰌘"; + format-disconnected = "󰌙"; + }; }; }; style = '' diff --git a/modules/nixos/rebuild.nix b/modules/nixos/rebuild.nix index 4e67aad..fde9df8 100644 --- a/modules/nixos/rebuild.nix +++ b/modules/nixos/rebuild.nix @@ -25,7 +25,7 @@ echo "NixOS Rebuilding..." # Rebuild, output simplified errors, log trackebacks - ${pkgs.sudo}/bin/sudo nixos-rebuild switch &>nixos-switch.log || (${pkgs.coreutils}/bin/cat nixos-switch.log | ${pkgs.gnugrep}/bin/grep --color error && false) + sudo nixos-rebuild switch &>nixos-switch.log || (${pkgs.coreutils}/bin/cat nixos-switch.log | ${pkgs.gnugrep}/bin/grep --color error && false) # Get current generation metadata current=$(nixos-rebuild list-generations | ${pkgs.gnugrep}/bin/grep current)