about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--hosts/by-name/apzu/configuration.nix4
-rw-r--r--modules/by-name/ya/yambar/config/config.yml52
-rw-r--r--modules/by-name/ya/yambar/module.nix78
-rwxr-xr-xmodules/by-name/ya/yambar/scripts/disk.sh31
-rwxr-xr-xmodules/by-name/ya/yambar/scripts/mpd_song_name.sh31
-rwxr-xr-xmodules/by-name/ya/yambar/scripts/network.sh57
-rwxr-xr-xmodules/by-name/ya/yambar/scripts/sound-volume.sh30
-rw-r--r--modules/by-name/ya/yambar/settings/default.nix383
-rw-r--r--modules/common/default.nix1
9 files changed, 0 insertions, 667 deletions
diff --git a/hosts/by-name/apzu/configuration.nix b/hosts/by-name/apzu/configuration.nix
index 0f7ab875..6fc917d3 100644
--- a/hosts/by-name/apzu/configuration.nix
+++ b/hosts/by-name/apzu/configuration.nix
@@ -25,10 +25,6 @@
     ];
 
     programs = {
-      yambar = {
-        laptop = true;
-        backlight = "intel_backlight";
-      };
       river.init = {
         mappings = {
           layout = "dvorak-modified";
diff --git a/modules/by-name/ya/yambar/config/config.yml b/modules/by-name/ya/yambar/config/config.yml
deleted file mode 100644
index 14da18fd..00000000
--- a/modules/by-name/ya/yambar/config/config.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-
----
-# Config file for yambar
-# Note that this may be version-dependent, this file is written for v1.8.0
-
-bar:
-  right:
-   # - network:
-   #    name: wlp5s0
-   #    poll-interval: 10
-   #    content:
-   #      map:
-   #        on-click: /bin/sh -c "nmtui"
-   #        conditions:
-   #          ~carrier: {empty: {}}
-   #          carrier:
-   #            string: {text: "  {ssid} ", deco: *combutil}
-   # - network:
-   #    name: enp4s0
-   #    content:
-   #      map:
-   #        on-click: /bin/sh -c "nmtui"
-   #        conditions:
-   #          ~carrier:
-   #            string: {text: "  Eth failed ", deco: *combutil}
-   #          carrier: {empty: {}}
-   # - script:   # Grade average
-   #     path: grade_average_script
-   #     content:
-   #       string:
-   #         text: "   {grade} "
-   #         deco: *combmem
-   # - script:   # tray
-   #    path: /home/dt/.config/yambar/scripts/yambar-tray
-   #    content:
-   #      empty: {}
-   # - script:
-   #    path: /home/dt/.config/yambar/scripts/yambar-tray-width
-   #    poll-interval: 10
-   #    content:
-   #      string:
-   #         text: "{padding}"
-   #         deco: *combmem
diff --git a/modules/by-name/ya/yambar/module.nix b/modules/by-name/ya/yambar/module.nix
deleted file mode 100644
index 40edf978..00000000
--- a/modules/by-name/ya/yambar/module.nix
+++ /dev/null
@@ -1,78 +0,0 @@
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-{
-  config,
-  pkgs,
-  lib,
-  ...
-}: let
-  cfg = config.soispha.programs.yambar;
-
-  makeScript = {
-    name,
-    dependencies,
-    ...
-  }:
-    lib.getExe (pkgs.writeShellApplication {
-      inherit name;
-      text = builtins.readFile ./scripts/${name}.sh;
-      runtimeInputs = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;});
-    });
-
-  mkWrapper = bin: cmd:
-    pkgs.writeShellScript cmd ''
-      ${bin} ${cmd}
-    '';
-in {
-  options.soispha.programs.yambar = {
-    enable = lib.mkEnableOption "yambar";
-
-    laptop = lib.mkEnableOption "laptop specific settings";
-    backlight = lib.mkOption {
-      type = lib.types.str;
-      example = "intel_backlight";
-      description = "Which backlight to query for the screen brightness";
-    };
-  };
-
-  config = lib.mkIf cfg.enable {
-    home-manager.users.soispha = {
-      programs.yambar = {
-        enable = true;
-        settings = import ./settings {
-          inherit lib;
-          inherit (cfg) laptop;
-          laptopBacklightName = cfg.backlight;
-
-          scripts = {
-            mpd_song_name_script = makeScript {
-              dependencies = [pkgs.mpc];
-              name = "mpd_song_name";
-            };
-
-            volume_script = makeScript {
-              dependencies = with pkgs; [pulseaudio gawk coreutils];
-              name = "sound-volume";
-            };
-
-            cpu_script = mkWrapper (lib.getExe pkgs.yambar-modules) "cpu";
-
-            memory_script = mkWrapper (lib.getExe pkgs.yambar-modules) "memory";
-
-            disk_script = makeScript {
-              dependencies = with pkgs; [gawk btrfs-progs coreutils];
-              name = "disk";
-            };
-          };
-        };
-      };
-    };
-  };
-}
diff --git a/modules/by-name/ya/yambar/scripts/disk.sh b/modules/by-name/ya/yambar/scripts/disk.sh
deleted file mode 100755
index 4efe1384..00000000
--- a/modules/by-name/ya/yambar/scripts/disk.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /usr/bin/env dash
-
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
-
-# Main loop
-while true; do
-    # vars
-    used_space=$(btrfs filesystem usage /srv 2>/dev/null | awk '{if ( /Used:/ ) { print $2 } } ' | head -n1)
-    all_space=$(btrfs filesystem usage /srv 2>/dev/null | awk '{if ( /Device size:/ ) { print $3 } } ' | head -n1 | tr -d "GiB")
-
-    # Check space available (4) and percentage used (5)
-    spaceperc=$(echo "$(echo "$used_space" | tr -d "GiB")" "$all_space" | awk '{div=$1/$2;div *= 100; printf"%2d%%\n",div }')
-
-    echo "diskspace|string|$used_space"
-    echo "diskperc|string|$spaceperc"
-    echo ""
-    sleep 1
-done
-
-# vim: ft=sh
diff --git a/modules/by-name/ya/yambar/scripts/mpd_song_name.sh b/modules/by-name/ya/yambar/scripts/mpd_song_name.sh
deleted file mode 100755
index 5c288d1a..00000000
--- a/modules/by-name/ya/yambar/scripts/mpd_song_name.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env dash
-
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
-
-while true; do
-    state="$(mpc status '%state%')"
-
-    if [ "$state" = "playing" ]; then
-        song="$(mpc --format '[[%artist% - ]%title%]|[%file%]' current)"
-        echo "playing|bool|true"
-        echo "song|string|$song :: $(mpc status "%currenttime%/%totaltime%")"
-    else
-        echo "playing|bool|false"
-    fi
-    echo "" # commit
-
-    sleep 2
-done
-
-# vim: ft=sh
diff --git a/modules/by-name/ya/yambar/scripts/network.sh b/modules/by-name/ya/yambar/scripts/network.sh
deleted file mode 100755
index d642e6c7..00000000
--- a/modules/by-name/ya/yambar/scripts/network.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /usr/bin/env dash
-
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
-
-retest=120
-retest_if_con_fails=10
-backend=nmcli
-
-case "$backend" in
-"nmcli") # Test for connectivity with nmcli
-    while true; do
-        connection_status=$(nmcli networking connectivity)
-        if [ "$connection_status" = "full" ]; then
-            echo "internet|string|Connected"
-            echo ""
-            sleep $retest
-        else
-            echo "internet|string|Disconnected"
-            echo ""
-            sleep $retest_if_con_fails
-        fi
-    done
-    ;;
-"ping") # Test for connectivity with ping
-    ip_address='8.8.8.8'
-    ping_number=3
-
-    while true; do
-
-        ping_result=$(mktmp)
-        ping $ip_address -c $ping_number -q | awk 'BEGIN {FS="/"} END {print $5}' >"$ping_result"
-
-        if [ "$(wc -l <"$ping_result")" -eq 0 ]; then
-            echo "med|string|No connection"
-            echo ""
-            sleep $retest_if_con_fails
-        else
-            echo "med|string|$(cat "$ping_result") ms"
-            echo ""
-            sleep $retest
-        fi
-    done
-    ;;
-esac
-
-# vim: ft=sh
diff --git a/modules/by-name/ya/yambar/scripts/sound-volume.sh b/modules/by-name/ya/yambar/scripts/sound-volume.sh
deleted file mode 100755
index 9d9f7be8..00000000
--- a/modules/by-name/ya/yambar/scripts/sound-volume.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /usr/bin/env dash
-
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
-
-while true; do
-    volume="$(pactl get-sink-volume 0 | awk 'BEGIN { FS="/" } {gsub("%","",$2); gsub(" ","",$2)} {printf $2}')"
-
-    if [ "$volume" -eq 0 ]; then
-        echo "muted|bool|true"
-    else
-        echo "volume|string|$volume"
-        echo "muted|bool|false"
-    fi
-    echo ""
-
-    sleep 3
-done
-
-# vim: ft=sh
diff --git a/modules/by-name/ya/yambar/settings/default.nix b/modules/by-name/ya/yambar/settings/default.nix
deleted file mode 100644
index ebe17261..00000000
--- a/modules/by-name/ya/yambar/settings/default.nix
+++ /dev/null
@@ -1,383 +0,0 @@
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-# TODO: This should not do something depending on whether the host is a laptop or not. It
-# should instead match on monitor-width or scale factor. <2024-11-29>
-{
-  lib,
-  laptop ? false,
-  laptopBacklightName ? null,
-  scripts,
-}: let
-  mkUnderline = color: {
-    underline = {
-      inherit color;
-      size = 3;
-    };
-  };
-
-  shellExec = cmd: ''sh -c "${cmd}"'';
-
-  values = {
-    foreground = {
-      blue = "99d1dbff";
-      focus = "e78284ff";
-      green = "a6e3a1dd";
-      lavendar = "b4befedd";
-      mauve = "cba6f7dd";
-      none = "00000000";
-      normal = "c6ceefff";
-      peach = "fab387dd";
-      sapphire = "74c7ecdd";
-      teal = "94e2d5dd";
-    };
-    font = {
-      main = "Source Code Pro:pixelsize=${
-        builtins.toString (
-          if laptop
-          then 22
-          else 26
-        )
-      }";
-      aws = "Font Awesome 5 Free:style=solid:pixelsize=${
-        builtins.toString (
-          if laptop
-          then 20
-          else 23
-        )
-      }";
-    };
-    background = {
-      normal = "303446ff";
-      tag = "585b70ff";
-      tag2 = "45475aff";
-      urgent = "e78284ff";
-    };
-    backgroundBlock = {
-      normal = {background = {color = values.background.normal;};};
-      urgent = {background = {color = values.background.urgent;};};
-    };
-    underline = {
-      battery = mkUnderline values.foreground.sapphire;
-      clock = mkUnderline values.foreground.teal;
-      focused = mkUnderline values.foreground.focus;
-      resources = mkUnderline values.foreground.green;
-      title = mkUnderline values.background.tag;
-      urgent = mkUnderline values.foreground.blue;
-      utils = mkUnderline values.foreground.peach;
-      weather = mkUnderline values.foreground.lavendar;
-    };
-    combination = {
-      battery.stack = [
-        values.backgroundBlock.normal
-        values.underline.battery
-      ];
-      clock.stack = [
-        values.backgroundBlock.normal
-        values.underline.clock
-      ];
-      resources.stack = [
-        values.backgroundBlock.normal
-        values.underline.resources
-      ];
-      utils.stack = [
-        values.backgroundBlock.normal
-        values.underline.utils
-      ];
-      weather.stack = [
-        values.backgroundBlock.normal
-        values.underline.weather
-      ];
-    };
-  };
-in {
-  bar = {
-    background = values.foreground.none;
-    foreground = values.foreground.normal;
-
-    font = values.font.main;
-    height =
-      if laptop
-      then 25
-      else 45;
-    margin =
-      if laptop
-      then 5
-      else 10;
-    location = "top";
-    layer = "bottom";
-    spacing = 0;
-
-    border = {
-      margin = 0;
-      top-margin = 10;
-    };
-
-    left = [
-      {
-        river = let
-          tag_base_setting = {
-            map = let
-              normal = {
-                string = {
-                  margin = 10;
-                  text = "{id}";
-                };
-              };
-            in {
-              default = normal;
-              conditions = {
-                "state == focused" = {
-                  string = {
-                    deco = {
-                      stack = [
-                        {background = {color = values.background.tag;};}
-                        values.underline.focused
-                      ];
-                    };
-                    margin = 10;
-                    text = "{id}";
-                  };
-                };
-                "state == invisible" = {
-                  map = {
-                    conditions = {
-                      occupied = {
-                        string = {
-                          deco = {background = {color = values.background.tag2;};};
-                          margin = 10;
-                          text = "{id}";
-                        };
-                      };
-                      "~occupied" = normal;
-                    };
-                  };
-                };
-                "state == unfocused" = {
-                  string = {
-                    deco = {background = {color = values.background.tag2;};};
-                    margin = 10;
-                    text = "{id}";
-                  };
-                };
-                "state == urgent" = {
-                  string = {
-                    deco = {
-                      stack = [
-                        {background = {color = values.background.urgent;};}
-                        values.underline.urgent
-                      ];
-                    };
-                    margin = 10;
-                    text = "{id}";
-                  };
-                };
-              };
-            };
-          };
-        in {
-          content = {
-            map = {
-              conditions = {
-                "id == 1" = tag_base_setting;
-                "id == 2" = tag_base_setting;
-                "id == 3" = tag_base_setting;
-                "id == 4" = tag_base_setting;
-                "id == 5" = tag_base_setting;
-                "id == 6" = tag_base_setting;
-                "id == 7" = tag_base_setting;
-                "id == 8" = tag_base_setting;
-                "id == 9" = tag_base_setting;
-              };
-              on-click = {
-                left = shellExec "riverctl set-focused-tags $((1 << ({id} - 1)))";
-                middle = shellExec "riverctl toggle-view-tags $((1 << ({id} -1)))";
-                right = shellExec "riverctl toggle-focused-tags $((1 << ({id} -1)))";
-              };
-            };
-          };
-          title = {
-            map = {
-              conditions = {"title == \"\"" = {string = {text = "";};};};
-              default = {
-                string = {
-                  max = 35;
-                  deco = values.underline.title;
-                  left-margin = 12;
-                  right-margin = 12;
-                  text = "{title}";
-                };
-              };
-            };
-          };
-        };
-      }
-    ];
-
-    center = [
-      {
-        clock = {
-          date-format = "%d/%m/%y (%a)";
-          time-format = "%H:%M:%S %Z";
-          foreground = values.foreground.blue;
-          content = {
-            string = {
-              deco = values.combination.clock;
-              text = " {date} {time} ";
-            };
-          };
-        };
-      }
-    ];
-
-    right =
-      [
-        {
-          script = {
-            path = scripts.mpd_song_name_script;
-            content.map.conditions = {
-              playing = {
-                string = {
-                  deco = values.combination.weather;
-                  text = "{song} ";
-                };
-              };
-              "~playing" = {
-                string = {
-                  deco = values.combination.weather;
-                  text = "";
-                };
-              };
-            };
-          };
-        }
-        {
-          script = {
-            path = scripts.volume_script;
-            content.map = {
-              on-click = shellExec "pavucontrol";
-              conditions = {
-                muted = {
-                  string = {
-                    deco = values.backgroundBlock.urgent;
-                    text = " 󰝟 ";
-                  };
-                };
-                "~muted" = {
-                  string = {
-                    deco = values.combination.utils;
-                    text = "  {volume}% ";
-                  };
-                };
-              };
-            };
-          };
-        }
-        {
-          script = {
-            path = scripts.cpu_script;
-            content.string = {
-              deco = values.combination.resources;
-              text = "  {cpu}% ";
-            };
-          };
-        }
-        {
-          script = {
-            path = scripts.memory_script;
-            content.map.conditions = {
-              swapstate = {
-                string = {
-                  deco = values.combination.resources;
-                  text = "  {memperc}%({swapperc}%) ";
-                };
-              };
-              "~swapstate" = {
-                string = {
-                  deco = values.combination.resources;
-                  text = "  {memperc}% ";
-                };
-              };
-            };
-          };
-        }
-        {
-          script = {
-            path = scripts.disk_script;
-            content.string = {
-              deco = values.combination.resources;
-              text = " 󰋊 {diskspace}({diskperc})";
-            };
-          };
-        }
-      ]
-      ++ lib.optionals laptop [
-        {
-          backlight = {
-            name = laptopBacklightName;
-            content.string = {
-              text = "  {percent}% ";
-              deco = values.combination.utils;
-            };
-          };
-        }
-        {
-          battery = {
-            name = "BAT0";
-            poll-interval = 300;
-            content.list.items = [
-              {
-                ramp = {
-                  tag = "capacity";
-                  items = let
-                    stack = [
-                      values.backgroundBlock.normal
-                      values.underline.battery
-                    ];
-                  in [
-                    {
-                      string = {
-                        text = "  {capacity}%({estimate}) ";
-                        deco =
-                          values.backgroundBlock.urgent;
-                      };
-                    }
-                    {
-                      string = {
-                        text = "  {capacity}%({estimate}) ";
-                        deco.stack = stack;
-                      };
-                    }
-                    {
-                      string = {
-                        text = "  {capacity}%({estimate}) ";
-                        deco.stack = stack;
-                      };
-                    }
-                    {
-                      string = {
-                        text = "  {capacity}%({estimate}) ";
-                        deco.stack = stack;
-                      };
-                    }
-                    {
-                      string = {
-                        text = "  {capacity}%({estimate}) ";
-                        deco.stack = stack;
-                      };
-                    }
-                  ];
-                };
-              }
-            ];
-          };
-        }
-      ];
-  };
-}
diff --git a/modules/common/default.nix b/modules/common/default.nix
index ab5d055f..15b4c971 100644
--- a/modules/common/default.nix
+++ b/modules/common/default.nix
@@ -290,7 +290,6 @@
         projects = builtins.fromJSON (builtins.readFile ./projects.json);
       };
       nix-index.enable = true;
-      yambar.enable = false;
       yt.enable = true;
       zathura.enable = true;
       zsh.enable = true;