summaryrefslogtreecommitdiff
path: root/.config/polybar
diff options
context:
space:
mode:
authorlistout <listout@protonmail.com>2022-01-17 23:18:23 +0530
committerlistout <listout@protonmail.com>2022-01-17 23:18:23 +0530
commit79aff35538076ee9486418749e880b11bccca255 (patch)
tree22a05d8e88a9f7b87be4c51ff547ed484cded508 /.config/polybar
parent3c8541df936dbdd350dd684a8dd37638b60e3b6e (diff)
use environment variable for temperature module
Diffstat (limited to '.config/polybar')
-rw-r--r--.config/polybar/config40
-rwxr-xr-x.config/polybar/launch.sh7
2 files changed, 26 insertions, 21 deletions
diff --git a/.config/polybar/config b/.config/polybar/config
index d4ea4ae..1700c1c 100644
--- a/.config/polybar/config
+++ b/.config/polybar/config
@@ -37,8 +37,8 @@ modules-center=bspwm
; COLORS ;
;--------;
-foreground = #1a1a24
-background = #2c2e3e
+foreground = #2a1a24
+background = #1a1a24
;---------------;
; MISCELLANEOUS ;
@@ -65,15 +65,15 @@ label-charging=%time% %percentage%
label-full=BAT0: %percentage%
label-full-foreground = #cddbf9
-label-full-background = #2c2e3e
+label-full-background = #1a1a24
label-full-padding = 2
label-charging-foreground = #cddbf9
-label-charging-background = #2c2e3e
+label-charging-background = #1a1a24
label-charging-padding = 2
label-discharging-foreground = #cddbf9
-label-discharging-background = #2c2e3e
+label-discharging-background = #1a1a24
label-discharging-padding = 2
format-discharging=<label-discharging>
@@ -90,25 +90,25 @@ time-alt=%I:%M:%S %A, %d %B %Y
format=<label>
label=%date% %time%
label-foreground = #cddbf9
-label-background = #2c2e3e
+label-background = #1a1a24
label-padding = 2
[module/temperature]
type=internal/temperature
interval=1.0
-hwmon-path=/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon3/temp1_input
+hwmon-path=${env:HWMON_PATH}
base-temperature=38
warn-temperature=70
format=<label>
format-warn=<label-warn>
-label=%temperature-c%
-label-warn= %temperature-c%
+label=TEMP: %temperature-c%
+label-warn=TEMP: %temperature-c%
label-foreground = #cddbf9
-label-background = #2c2e3e
+label-background = #1a1a24
label-padding = 2
label-warn-foreground = #cddbf9
-label-warn-background = #2c2e3e
+label-warn-background = #1a1a24
label-warn-padding = 2
[module/cpu]
@@ -118,7 +118,7 @@ format=<label>
label=CPU: %percentage%%
label-foreground = #cddbf9
-label-background = #2c2e3e
+label-background = #1a1a24
label-padding = 2
[module/memory]
@@ -128,7 +128,7 @@ format=<label>
label=Mem: %gb_used%
label-foreground = #cddbf9
-label-background = #2c2e3e
+label-background = #1a1a24
label-padding = 2
[module/pulseaudio]
@@ -140,11 +140,11 @@ label-muted=muted
click-right=pavucontrol
label-volume-foreground = #cddbf9
-label-volume-background = #2c2e3e
+label-volume-background = #1a1a24
label-volume-padding = 2
label-muted-foreground = #cddbf9
-label-muted-background = #2c2e3e
+label-muted-background = #1a1a24
label-muted-padding = 2
[module/bspwm]
@@ -158,11 +158,11 @@ label-empty=%name%
label-empty-padding=2
label-focused-foreground = #f6bbe7
-label-focused-background = #2c2e3e
+label-focused-background = #1a1a24
label-occupied-foreground = #a3ccad
-label-occupied-background = #2c2e3e
+label-occupied-background = #1a1a24
label-empty-foreground = #cddbf9
-label-empty-background = #2c2e3e
+label-empty-background = #1a1a24
[module/network]
type=internal/network
@@ -172,11 +172,11 @@ label-connected=%local_ip%
label-disconnected=""
label-connected-foreground = #cddbf9
-label-connected-background = #2c2e3e
+label-connected-background = #1a1a24
label-connected-padding = 2
label-disconnected-foreground = #cddbf9
-label-disconnected-background = #2c2e3e
+label-disconnected-background = #1a1a24
label-disconnected-padding = 2
; vim: set ft=dosini nomodeline:
diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh
index c4e683a..791b22d 100755
--- a/.config/polybar/launch.sh
+++ b/.config/polybar/launch.sh
@@ -1,7 +1,12 @@
#!/usr/bin/env bash
+for i in /sys/class/hwmon/hwmon*/temp*_input; do
+ if [ "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*}))" = "k10temp: Tctl" ]; then
+ export HWMON_PATH="$i"
+ fi
+done
killall -q polybar
echo "---" | tee -a /tmp/polybar1.log
polybar mybar 2>&1 | tee -a /tmp/polybar1.log & disown
- echo "Bar launched"
+echo "Bar launched"