Update Polybar

This commit is contained in:
Marco Thomas
2020-11-11 19:13:02 +01:00
parent ac1c15d128
commit 9b66bdd5f5
8 changed files with 57 additions and 7 deletions

View File

@@ -30,7 +30,7 @@ separator =
modules-left = i3 xwindow
modules-center = spotify
modules-right = network volume backlight battery date
modules-right = cpu temp memory network volume backlight battery date
tray-position = right
tray-padding = 1
@@ -46,7 +46,7 @@ wm-restack = i3
[bar/desktop]
inherit = bar/laptop
modules-right = update_yay volume date
modules-right = update_yay cpu temp memory volume date
[bar/desktop_second]
inherit = bar/desktop
@@ -199,7 +199,7 @@ tail = true
interval = 60
click-left = alacritty -e yay &
format-prefix = " "
format-prefix = " "
format-prefix-foreground = ${colors.accent-alt}
format-underline = ${colors.accent}
@@ -211,3 +211,29 @@ interval = 1
format-prefix = " "
format-prefix-foreground = ${colors.accent-alt}
format-underline = ${colors.accent}
[module/cpu]
type = custom/script
exec = ~/.config/polybar/scripts/cpu.sh
click-left = ~/.config/polybar/scripts/cpu.sh --popup
format-prefix = " "
format-prefix-foreground = ${colors.accent-alt}
format-underline = ${colors.accent}
[module/memory]
type = custom/script
exec = ~/.config/polybar/scripts/memory.sh
click-left = ~/.config/polybar/scripts/memory.sh --popup
format-prefix = " "
format-prefix-foreground = ${colors.accent-alt}
format-underline = ${colors.accent}
[module/temp]
type = custom/script
exec = ~/.config/polybar/scripts/temp.sh
format-prefix = " "
format-prefix-foreground = ${colors.accent-alt}
format-underline = ${colors.accent}

View File

@@ -0,0 +1,9 @@
#!/bin/sh
case "$1" in
--popup)
notify-send "CPU time (%)" "$(ps axch -o cmd:10,pcpu k -pcpu | head | awk '$0=$0"%"' )"
;;
*)
echo "$(grep 'cpu ' /proc/stat | awk '{cpu_usage=($2+$4)*100/($2+$4+$5)} END {printf "%0.2f%", cpu_usage}')"
;;
esac

View File

@@ -0,0 +1,9 @@
#!/bin/sh
case "$1" in
--popup)
notify-send "Memory (%)" "$(ps axch -o cmd:10,pmem k -pmem | head | awk '$0=$0"%"' )"
;;
*)
echo "$(free -h --si | awk '/^Mem:/ {print $3 "/" $2}')"
;;
esac

View File

@@ -0,0 +1,3 @@
#!/bin/sh
echo "$(sensors | grep Tctl | head -1 | awk '{print $2}')"