From 4afe5d48cb06cdc12dfcb909663d6fdd4f103329 Mon Sep 17 00:00:00 2001 From: FelixKratz Date: Fri, 13 Aug 2021 23:55:43 +0200 Subject: [PATCH 1/2] cpu graph plugins --- plugins/cpu_sys.sh | 8 ++++++++ plugins/cpu_user.sh | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100755 plugins/cpu_sys.sh create mode 100755 plugins/cpu_user.sh diff --git a/plugins/cpu_sys.sh b/plugins/cpu_sys.sh new file mode 100755 index 0000000..cce3aa4 --- /dev/null +++ b/plugins/cpu_sys.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +CORE_COUNT=$(sysctl -n machdep.cpu.thread_count) +CPU_SYS=$(ps -eo pcpu,user | grep -v $(whoami) | sed "s/[^ 0-9\.]//g" | awk "{sum+=\$1} END {print sum/(100.0 * $CORE_COUNT)}") +sketchybar -m push cpu_sys 0 $CPU_SYS + + + diff --git a/plugins/cpu_user.sh b/plugins/cpu_user.sh new file mode 100755 index 0000000..cc48b38 --- /dev/null +++ b/plugins/cpu_user.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +CORE_COUNT=$(sysctl -n machdep.cpu.thread_count) +CPU_USER=$(ps -eo pcpu,user | grep $(whoami) | sed "s/[^ 0-9\.]//g" | awk "{sum+=\$1} END {print sum/(100.0 * $CORE_COUNT)}") +sketchybar -m push cpu_user 0 $CPU_USER + From f0a7bb878e42ca6392bf0a536ad067d5c6492a5f Mon Sep 17 00:00:00 2001 From: FelixKratz Date: Sat, 14 Aug 2021 01:10:40 +0200 Subject: [PATCH 2/2] new graphing rc --- sketchybarrc | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/sketchybarrc b/sketchybarrc index 7ad8f66..d542fb3 100755 --- a/sketchybarrc +++ b/sketchybarrc @@ -121,12 +121,44 @@ sketchybar -m set githubIndicator icon_padding_left 10 #sketchybar -m set calendarIndicator label_padding_left 4 #sketchybar -m set calendarIndicator icon_padding_left 10 -sketchybar -m add component cpu_graph cpu right -sketchybar -m set cpu associated_space 1 -sketchybar -m set cpu icon_font "Hack Nerd Font:Bold:17.0" -sketchybar -m set cpu icon  -sketchybar -m set cpu icon_padding_left 4 +sketchybar -m add component graph cpu_user right 99 nospace +sketchybar -m set cpu_user script "/Users/felix/.config/sketchybar/plugins/cpu_user.sh" +sketchybar -m set cpu_user graph_color 0xffffffff +sketchybar -m set cpu_user update_freq 1 +sketchybar -m set cpu_user associated_space 1 +sketchybar -m set cpu_user icon_font "Hack Nerd Font:Bold:17.0" +sketchybar -m set cpu_user icon  +sketchybar -m set cpu_user icon_padding_left 4 + +sketchybar -m add component graph cpu_sys right 99 +sketchybar -m set cpu_sys update_freq 1 +sketchybar -m set cpu_sys graph_color 0xff48aa2a +sketchybar -m set cpu_sys script "/Users/felix/.config/sketchybar/plugins/cpu_sys.sh" +sketchybar -m set cpu_sys associated_space 1 +sketchybar -m set cpu_sys icon_font "Hack Nerd Font:Bold:17.0" +sketchybar -m set cpu_sys icon  +sketchybar -m set cpu_sys icon_padding_left 4 + +#sketchybar -m add component graph network_down center 99 nospace +#sketchybar -m set network_down associated_space 3 +#sketchybar -m set network_down update_freq 1 +#sketchybar -m set network_down graph_color 0xffffffff +#sketchybar -m set network_down script "/Users/felix/.config/sketchybar/plugins/network_down.sh" +#sketchybar -m set network_down associated_space 1 +#sketchybar -m set network_down icon_font "Hack Nerd Font:Bold:17.0" +#sketchybar -m set network_down icon  +#sketchybar -m set network_down icon_padding_left 4 +# +#sketchybar -m add component graph network_up center 99 nospace +#sketchybar -m set network_up associated_space 3 +#sketchybar -m set network_up update_freq 1 +#sketchybar -m set network_up graph_color 0xffffffff +#sketchybar -m set network_up script "/Users/felix/.config/sketchybar/plugins/network_up.sh" +#sketchybar -m set network_up associated_space 1 +#sketchybar -m set network_up icon_font "Hack Nerd Font:Bold:17.0" +#sketchybar -m set network_up icon  +#sketchybar -m set network_up icon_padding_left 4 # Graph layout still a bit wonky #sketchybar -m add component mem_graph mem left #sketchybar -m set mem icon_font "Hack Nerd Font:Bold:17.0" @@ -148,6 +180,7 @@ sketchybar -m set spotifyIndicator script "/Users/felix/.config/sketchybar/plugi sketchybar -m add item topproc right sketchybar -m set topproc associated_space 1 sketchybar -m set topproc icon_padding_left 10 +sketchybar -m set topproc label_padding_right 5 sketchybar -m set topproc script "/Users/felix/.config/sketchybar/plugins/topproc.sh" sketchybar -m set topproc update_freq 15 sketchybar -m update