aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/eww/yuck.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-27 01:55:13 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 03:50:30 +0530
commit9a6f21b65da927fb064773bd83e92151c50b6823 (patch)
tree897de5d11ba347529e0f16fe554eac0d5d908fd1 /modules/desktop/eww/yuck.nix
parentf3407d3d21c29eb4a59732d02f8f309b113fa480 (diff)
downloadhome-manager-config-9a6f21b65da927fb064773bd83e92151c50b6823.tar.gz
home-manager-config-9a6f21b65da927fb064773bd83e92151c50b6823.zip
desktop: added some of basic system information in the system section
- added date, time, memory used (percent), cpu usage (percent), network status (icons for up or down)
Diffstat (limited to 'modules/desktop/eww/yuck.nix')
-rw-r--r--modules/desktop/eww/yuck.nix155
1 files changed, 94 insertions, 61 deletions
diff --git a/modules/desktop/eww/yuck.nix b/modules/desktop/eww/yuck.nix
index d522d9b..03de4bf 100644
--- a/modules/desktop/eww/yuck.nix
+++ b/modules/desktop/eww/yuck.nix
@@ -8,71 +8,91 @@
config = lib.mkIf config.desktop.enable {
programs.eww.yuckConfig =
let
- workspaces =
- let
- pythonEnv = pkgs.python3.withPackages (ps: [ ps.pygobject3 ]);
- in
- pkgs.stdenv.mkDerivation {
- pname = "eww-workspaces";
- version = "0.1.0";
- src = ./workspaces.py;
- dontUnpack = true;
- meta.mainProgram = "eww-workspaces";
-
- nativeBuildInputs = [
- pkgs.wrapGAppsHook3
- pkgs.gobject-introspection
- ];
- buildInputs = [ pkgs.gtk3 ];
-
- installPhase = ''
- mkdir -p $out/bin
- install -m755 $src $out/bin/eww-workspaces
- patchShebangs $out/bin/eww-workspaces
- '';
-
- # wrapGAppsHook3 wraps every executable in $out/bin automatically,
- # setting GI_TYPELIB_PATH etc. from buildInputs' closure.
- preFixup = ''
- gappsWrapperArgs+=(--prefix PATH : "${pythonEnv}/bin")
- '';
- };
-
- activate-windows =
- let
- pythonEnv = pkgs.python3.withPackages (ps: [ ps.pygobject3 ]);
- in
- pkgs.stdenv.mkDerivation {
- pname = "eww-activate-windows";
- version = "0.1.0";
- src = ./activate-windows.py;
- dontUnpack = true;
- meta.mainProgram = "eww-activate-windows";
-
- nativeBuildInputs = [
- pkgs.wrapGAppsHook3
- pkgs.gobject-introspection
- ];
- buildInputs = [ pkgs.gtk3 ];
-
- installPhase = ''
- mkdir -p $out/bin
- install -m755 $src $out/bin/eww-activate-windows
- patchShebangs $out/bin/eww-activate-windows
- '';
-
- # wrapGAppsHook3 wraps every executable in $out/bin automatically,
- # setting GI_TYPELIB_PATH etc. from buildInputs' closure.
- preFixup = ''
- gappsWrapperArgs+=(--prefix PATH : "${pythonEnv}/bin")
- '';
- };
+ pythonEnv = pkgs.python3.withPackages (ps: [ ps.pygobject3 ]);
+ system-stats = pkgs.stdenv.mkDerivation {
+ pname = "eww-system-stats";
+ version = "0.1.0";
+ src = ./system-stats.py;
+ dontUnpack = true;
+ meta.mainProgram = "eww-system-stats";
+
+ nativeBuildInputs = [
+ pkgs.wrapGAppsHook3
+ pkgs.gobject-introspection
+ ];
+ buildInputs = [ pkgs.gtk3 ];
+
+ installPhase = ''
+ mkdir -p $out/bin
+ install -m755 $src $out/bin/eww-system-stats
+ patchShebangs $out/bin/eww-system-stats
+ '';
+
+ # wrapGAppsHook3 wraps every executable in $out/bin automatically,
+ # setting GI_TYPELIB_PATH etc. from buildInputs' closure.
+ preFixup = ''
+ gappsWrapperArgs+=(--prefix PATH : "${pythonEnv}/bin")
+ '';
+ };
+
+ workspaces = pkgs.stdenv.mkDerivation {
+ pname = "eww-workspaces";
+ version = "0.1.0";
+ src = ./workspaces.py;
+ dontUnpack = true;
+ meta.mainProgram = "eww-workspaces";
+
+ nativeBuildInputs = [
+ pkgs.wrapGAppsHook3
+ pkgs.gobject-introspection
+ ];
+ buildInputs = [ pkgs.gtk3 ];
+
+ installPhase = ''
+ mkdir -p $out/bin
+ install -m755 $src $out/bin/eww-workspaces
+ patchShebangs $out/bin/eww-workspaces
+ '';
+
+ # wrapGAppsHook3 wraps every executable in $out/bin automatically,
+ # setting GI_TYPELIB_PATH etc. from buildInputs' closure.
+ preFixup = ''
+ gappsWrapperArgs+=(--prefix PATH : "${pythonEnv}/bin")
+ '';
+ };
+
+ activate-windows = pkgs.stdenv.mkDerivation {
+ pname = "eww-activate-windows";
+ version = "0.1.0";
+ src = ./activate-windows.py;
+ dontUnpack = true;
+ meta.mainProgram = "eww-activate-windows";
+
+ nativeBuildInputs = [
+ pkgs.wrapGAppsHook3
+ pkgs.gobject-introspection
+ ];
+ buildInputs = [ pkgs.gtk3 ];
+
+ installPhase = ''
+ mkdir -p $out/bin
+ install -m755 $src $out/bin/eww-activate-windows
+ patchShebangs $out/bin/eww-activate-windows
+ '';
+
+ # wrapGAppsHook3 wraps every executable in $out/bin automatically,
+ # setting GI_TYPELIB_PATH etc. from buildInputs' closure.
+ preFixup = ''
+ gappsWrapperArgs+=(--prefix PATH : "${pythonEnv}/bin")
+ '';
+ };
in
''
(defpoll time :interval "10s" "date '+%H:%M'")
(defpoll date :interval "60s" "date '+%d/%m'")
(deflisten workspaces :initial "[]" "${lib.getExe workspaces}")
(deflisten active-windows :initial "[]" "${lib.getExe activate-windows}")
+ (deflisten system_stats :initial "{\"cpu\":0,\"ram\":0,\"net\":\"down\"}" "${lib.getExe system-stats}")
(defwindow bar
:monitor 0
@@ -123,8 +143,21 @@
(defwidget system-widget []
(box :orientation "v" :space-evenly false :spacing 6 :halign "fill" :class "system"
- (label :class "system-item" :text time)
- (label :class "system-item" :text date)))
+ (box :orientation "v" :class "system-item" :space-evenly false :spacing 4
+ (label :class "system-icon" :text "''${system_stats.net == "up" ? "󰤨 " : "󰤭 "}")
+ (label :class "system-label" :text ""))
+ (box :orientation "v" :class "system-item" :space-evenly false :spacing 4
+ (label :class "system-icon" :text " ")
+ (label :class "system-label" :text "''${system_stats.cpu}%"))
+ (box :orientation "v" :class "system-item" :space-evenly false :spacing 4
+ (label :class "system-icon" :text " ")
+ (label :class "system-label" :text "''${system_stats.ram}%"))
+ (box :orientation "v" :class "system-item" :space-evenly false :spacing 4
+ (label :class "system-icon" :text "󰥔 ")
+ (label :class "system-label small" :text time))
+ (box :orientation "v" :class "system-item" :space-evenly false :spacing 4
+ (label :class "system-icon" :text "")
+ (label :class "system-label small" :text date))))
'';
};
}