diff options
| -rwxr-xr-x | config/.bar.sh | 39 | ||||
| -rw-r--r-- | config/dotfiles.nix | 1 | ||||
| -rw-r--r-- | machines/x/configuration.nix | 1 | ||||
| -rw-r--r-- | machines/x/home.nix | 3 | ||||
| -rw-r--r-- | modules/wm_utils.nix | 4 | ||||
| -rw-r--r-- | packages/dwl.nix | 2 | ||||
| -rw-r--r-- | packages/dwlb.nix | 2 | 
7 files changed, 46 insertions, 6 deletions
| diff --git a/config/.bar.sh b/config/.bar.sh new file mode 100755 index 0000000..2b23972 --- /dev/null +++ b/config/.bar.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +wifi() { +  iwgetid -r +} + +battery() { +  c=$(cat /sys/class/power_supply/BAT1/capacity) + +  if [[ $c > 85 ]]; then +    echo "  $c" +  elif [[ $c > 70 ]]; then +    echo "  $c" +  elif [[ $c > 50 ]]; then +    echo "  $c" +  elif [[ $c > 30 ]]; then +    echo "  $c" +  else +    echo "  $c" +  fi +} + +charging() { +  if [[ "$(cat /sys/class/power_supply/BAT1/status)" == "Charging" ]]; then +    echo "+" +  fi +} + +calendar() { +  date +'%a, %d %b %Y |   %H:%M' +} + +volume() { +  pamixer --get-volume +} + +while [[ true ]]; do +  dwlb -status all "| ^lm(alacritty -e nmtui-connect)  $(wifi)^lm() |   $(volume)% | $(battery)%$(charging) |   $(calendar) | λ" +  sleep 1 +done diff --git a/config/dotfiles.nix b/config/dotfiles.nix index 1a89f9b..72564d2 100644 --- a/config/dotfiles.nix +++ b/config/dotfiles.nix @@ -4,5 +4,6 @@    home.file = {      ".tmux.conf".source = ./.tmux.conf;      ".fdignore".source = ./.fdignore; +    ".bar.sh".source = ./.bar.sh;    };  } diff --git a/machines/x/configuration.nix b/machines/x/configuration.nix index 10af0bc..f736043 100644 --- a/machines/x/configuration.nix +++ b/machines/x/configuration.nix @@ -12,6 +12,7 @@      "polkit.nix"      "compromyse.nix"      "login.nix" +    "wm_utils.nix"      "virtualization.nix"      "nvidia.nix"    ]); diff --git a/machines/x/home.nix b/machines/x/home.nix index 9d0a4ab..fbd2ab9 100644 --- a/machines/x/home.nix +++ b/machines/x/home.nix @@ -31,8 +31,7 @@ in {      obs-studio      pavucontrol -    brillo -    playerctl +    brightnessctl      pamixer      wbg diff --git a/modules/wm_utils.nix b/modules/wm_utils.nix index 7ddaca6..b111a20 100644 --- a/modules/wm_utils.nix +++ b/modules/wm_utils.nix @@ -1,13 +1,13 @@  { pkgs, ... }:  {    environment.systemPackages = with pkgs; [ -    networkmanagerapplet -      polkit_gnome      libnotify      libappindicator      inotify-tools + +    wirelesstools    ];  } diff --git a/packages/dwl.nix b/packages/dwl.nix index a3c46ca..76b10cb 100644 --- a/packages/dwl.nix +++ b/packages/dwl.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: {      owner = "compromyse";      repo = "dwl";      rev = "master"; -    hash = "sha256-C2wB/vCWr3LPvY0JpG6bzlw9fr0yPHccD4HTD+lH0Ac="; +    hash = "sha256-eApUgB4DMdotIGLrxq9OvqC5cKn+w1lTV0dStDYGm34=";    };    nativeBuildInputs = [ diff --git a/packages/dwlb.nix b/packages/dwlb.nix index 08dc7c6..60c8786 100644 --- a/packages/dwlb.nix +++ b/packages/dwlb.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation (finalAttrs: {      owner = "compromyse";      repo = "dwlb";      rev = "master"; -    hash = "sha256-cz3yqughpLdFZY3vIXvkKGVoC4ZrTzZQhaJWQ8XB3kQ="; +    hash = "sha256-aXBny0OK4RiNwTYdmvDMMXgx4EIc5stUxov/nO7kTAg=";    };    nativeBuildInputs = [ | 
