diff --git a/home/natto/config/hypr/hyprland.conf b/home/natto/config/hypr/hyprland.conf index 6553752..cda6d24 100644 --- a/home/natto/config/hypr/hyprland.conf +++ b/home/natto/config/hypr/hyprland.conf @@ -1,4 +1,5 @@ monitor=,preferred,auto,1 + input { kb_layout = us kb_variant = colemak_dh @@ -154,3 +155,5 @@ bind=$mainMod SHIFT, 7, movetoworkspacesilent, 7 bind=$mainMod SHIFT, 8, movetoworkspacesilent, 8 bind=$mainMod SHIFT, 9, movetoworkspacesilent, 9 bind=$mainMod SHIFT, 0, movetoworkspacesilent, 10 + +exec-once=eww open bar diff --git a/home/natto/eww/README.org b/home/natto/eww/README.org new file mode 100644 index 0000000..da9097d --- /dev/null +++ b/home/natto/eww/README.org @@ -0,0 +1,4 @@ +#+OPTIONS: toc:nil +Inspired by ++ [[https://github.com/saimoomedits/eww-widgets/tree/cfb2523a4e37ed2979e964998d9a4c37232b2975][saimoomedits]] ++ [[https://github.com/fufexan/dotfiles/tree/db777ae5a76db34608dd486ed9238e9129252bbc/home/programs/eww][fufexan]] diff --git a/home/natto/eww/bar/bar.yuck b/home/natto/eww/bar/bar.yuck index f45234e..ad20553 100644 --- a/home/natto/eww/bar/bar.yuck +++ b/home/natto/eww/bar/bar.yuck @@ -1,5 +1,5 @@ (include "bar/music.yuck") -(include "bar/workspaces.yuck") +(include "bar/hyprworkspaces.yuck") (include "bar/system.yuck") (defwidget bar [] diff --git a/home/natto/eww/bar/hyprworkspaces b/home/natto/eww/bar/hyprworkspaces index 70306c0..94acd28 100755 --- a/home/natto/eww/bar/hyprworkspaces +++ b/home/natto/eww/bar/hyprworkspaces @@ -18,7 +18,7 @@ workspaces() { list_workspaces workspaces -hyprctl dispatch workspace $current +hyprctl dispatch workspace $current || true socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do case ${event%>>*} in diff --git a/home/natto/eww/bar/workspaces.yuck b/home/natto/eww/bar/hyprworkspaces.yuck similarity index 87% rename from home/natto/eww/bar/workspaces.yuck rename to home/natto/eww/bar/hyprworkspaces.yuck index e4b18ad..97decde 100644 --- a/home/natto/eww/bar/workspaces.yuck +++ b/home/natto/eww/bar/hyprworkspaces.yuck @@ -10,5 +10,4 @@ (button :class "${ws == workspace.current ? 'workspace-active' : 'workspace-inactive'}" :onclick "hyprctl dispatch workspace ${ws}" - {ws <= 10 ? numerals[ws - 1] : ws })) - ))) + {ws <= 10 ? numerals[ws - 1] : ws }))))) diff --git a/home/natto/eww/bar/system.yuck b/home/natto/eww/bar/system.yuck index 45efe90..a91bc17 100644 --- a/home/natto/eww/bar/system.yuck +++ b/home/natto/eww/bar/system.yuck @@ -101,9 +101,6 @@ (system_bright) (system_temp))) -(defpoll system_cpu_freq :interval "2s" :initial "0" - "cat /proc/cpuinfo | awk '/cpu MHz/ { sum += $4; n++} END { if (n != 0) print sum / n; }'") - (defwidget system_metric [value class tooltip] (box :orientation "h" @@ -126,8 +123,8 @@ :space-evenly false (system_metric :value {EWW_CPU.avg} - :tooltip "CPU Usage: ${round(EWW_CPU.avg, 2)}%${system_cpu_freq == '0' ? '' : ' -CPU Freq: ${system_cpu_freq} MHz'}" + :tooltip "CPU Usage: ${round(EWW_CPU.avg, 2)}% +CPU Freq: ${EWW_CPU.cores[0].freq} MHz}" :class "cpu") (system_metric :value {EWW_RAM.used_mem_perc} @@ -141,7 +138,7 @@ Free %: ${round(100 - EWW_RAM.used_mem_perc, 2)}%" :class "battery") (system_metric :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)} - :tooltip "Free Disk: ${round(EWW_DISK['/'].free / 1024 / 1024, 2)} GB + :tooltip "Free Disk: ${round(EWW_DISK['/'].free / 1024 / 1024 / 1024, 2)} GB Free Disk %: ${round(EWW_DISK['/'].free / EWW_DISK['/'].total * 100, 2)}%" :class "disk")))) diff --git a/home/natto/eww/default.nix b/home/natto/eww/default.nix index 621a4c1..ab9de14 100644 --- a/home/natto/eww/default.nix +++ b/home/natto/eww/default.nix @@ -16,6 +16,7 @@ systemd.user.services.eww = { Unit = { Description = "EWW Daemon"; + PartOf = ["graphical-session.target"]; }; Service = let @@ -25,8 +26,8 @@ ] ++ (import ./bar pkgs); in { - Environment = "PATH=${lib.makeBinPath deps}"; Type = "simple"; + Environment = "PATH=${lib.makeBinPath deps}"; Restart = "on-failure"; ExecStart = "${config.programs.eww.package}/bin/eww daemon --no-daemonize"; };