Move colors and machinevars into modules
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user