diff options
author | listout <listout@protonmail.com> | 2022-08-05 00:38:09 +0530 |
---|---|---|
committer | listout <listout@protonmail.com> | 2022-09-01 16:26:33 +0530 |
commit | 5371db3a704142baf2cc82fb96e2fb94537fc243 (patch) | |
tree | 1699a7837ba0fbe52f0101291e2b0c10b1aded5e /.config/polybar | |
parent | d992ce3e00915fad72e8733c845032ceb44e9052 (diff) |
polybar/launch.sh: launch the bars conditionally
Signed-off-by: listout <listout@protonmail.com>
Diffstat (limited to '.config/polybar')
-rwxr-xr-x | .config/polybar/launch.sh | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh index 60fbe39..2f797e1 100755 --- a/.config/polybar/launch.sh +++ b/.config/polybar/launch.sh @@ -1,14 +1,31 @@ #!/usr/bin/env bash +# AMD specific system temperature 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 + +# Get wireless interface export DEFAULT_NETWORK_INTERFACE=$(ip route | grep '^default' | awk '{print $5}' | head -n1) + +# Kill all instances of polybar killall -q polybar -echo "---" | tee -a /tmp/polybar1.log -polybar mybar 2>&1 | tee -a /tmp/polybar1.log & disown -polybar mybar_external 2>&1 | tee -a /tmp/polybar_ext.log & disown -echo "Bar launched" +log_file=/tmp/.polybar.err + +#Launch Polybar on every monitor, using default config location ~/.config/polybar/config +for m in $(polybar --list-monitors | cut -d":" -f1); do + # put a different bar on the laptop monitor (because it has a higher resolution) + if [ "$m" = "eDP" ] || [ "$m" = "eDP-1" ]; then + bar_type="laptop" + else + bar_type="external" + fi + MONITOR=$m polybar -r $bar_type 2>&1 | tee -a /tmp/.polybar.$m.err & disown +done + +#polybar mybar 2>&1 | tee -a /tmp/polybar1.log & disown +#polybar mybar_external 2>&1 | tee -a /tmp/polybar_ext.log & disown +#echo "Bar launched" |