Move colors and machinevars into modules

This commit is contained in:
2022-06-21 01:47:36 +02:00
parent 2eae0e5ebf
commit 79a995e19e
27 changed files with 456 additions and 275 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
{ lib, pkgs, colorTheme, ... }:
{ pkgs, lib, config, ... }:
{
programs.alacritty = {
enable = true;
@@ -22,10 +22,10 @@
primaryColors = [ "foreground" "background" ];
in
{
primary = getAttrs primaryColors colorTheme.default;
primary = getAttrs primaryColors config.colors.defaultColorSet;
normal = let
removePrimaryColorAttrs = n: v: !(any (pc: n ? pc) primaryColors);
in filterAttrs removePrimaryColorAttrs colorTheme.default;
in filterAttrs removePrimaryColorAttrs config.colors.defaultColorSet;
};
background_opacity = 1.0;
+26 -3
View File
@@ -1,13 +1,36 @@
{ pkgs, colorTheme, ... }: let
{ pkgs, config, ... }: let
inherit (pkgs) lib;
in {
programs.xmobar = let
networkCard = "wlp2s0f0u7u4";
disks = [
"/"
"/data"
"/data/disks/data2"
];
mpd_status_script = pkgs.writeShellScript "mpd-status" ''
MPD_STATUS=$(${pkgs.mpc}/bin/mpc 2>/dev/null | sed -n '2{p;q}' | cut -d ' ' -f1)
case "$MPD_STATUS" in
"[playing]")
echo "<fn=2><fc=#00ff00></fc></fn>"
# echo "[<fn=2><fc=#00ff00></fc></fn>]"
exit 0
;;
"[paused]")
echo "<fn=2><fc=#ff0000></fc></fn>"
# echo "[<fn=1><fc=#ff0000></fc></fn>]"
exit 0
;;
*)
echo "<fn=2><fc=#AA0000></fc></fn>"
# echo "[<fn=1><fc=#AA0000></fc></fn>]"
exit 0
;;
esac
'';
in {
enable = true;
extraConfig = ''
@@ -22,7 +45,7 @@ in {
]
, borderColor = "black"
, border = TopB
, bgColor = "#272822"
, bgColor = "${config.colors.defaultColorSet.background}"
, fgColor = "grey"
, alpha = 255
, position = Static { xpos = 0 , ypos = 0, width = 1920, height = 40 }
@@ -48,7 +71,7 @@ in {
Run Memory ["-t","<usedratio>%"] 10,
Run Swap ["-t", "<usedratio>%"] 100,
Run Date "%a %_d %b - %H:%M - W%W" "date" 10,
Run Com "${./scripts/mpd_status.sh}" [] "mpc" 10,
Run Com "${mpd_status_script}" [] "mpc" 10,
-- Run Com "${./scripts/wireless.sh}" [] "wi" 100,
Run Com "${./scripts/volume.py}" [] "vol" 10,
Run UnsafeStdinReader,