Polybar launchscript more generalized and solved bug that made many GTK apps hanging for seconds or minutes

master
Meliurwen 3 years ago
parent 5591e8e950
commit e50a984f69
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 6
      polybar/.config/polybar/config
  2. 21
      polybar/.config/polybar/launch.sh
  3. 24
      x/.xinitrc

@ -151,14 +151,14 @@ ramp-volume-3 =
[module/wired-network]
type = internal/network
interface = enp0s25
interface = ${env:POLY_ENP}
format-connected = <label-connected>
label-connected =
[module/wireless-network]
type = internal/network
interface = wlp3s0
interface = ${env:POLY_WLP}
format-connected = <ramp-signal>
format-disconnected = <label-disconnected>
@ -187,7 +187,7 @@ animation-packetloss-framerate = 500
type = internal/temperature
interval = 5
thermal-zone = 0
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input
hwmon-path = ${env:POLY_HWMON:}
base-temperature = 40
warn-temperature = 80

@ -1,10 +1,10 @@
#!/bin/bash
#!/bin/sh
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
while pgrep -u "$(id -u)" -x polybar >/dev/null; do sleep 1; done
# Launch polybar
#polybar main -c $HOME/.config/polybar/config &
@ -12,10 +12,23 @@ while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# Set Monitors
#xrandr --output HDMI1 --auto --left-of LVDS1
POLY_IFACES="$(ip link show | awk '/^[0-9]+:/ {sub(/:/,"",$2); print $2}')"
for NET_IFACE in $POLY_IFACES ; do
echo "$NET_IFACE"
case $NET_IFACE in
wlp* ) POLY_WLP=$NET_IFACE ;;
enp* ) POLY_ENP=$NET_IFACE ;;
esac
done
HWMON_BASEDIR="$(find "/sys/devices/platform/coretemp.0/hwmon/" -maxdepth 1 -type d -name 'hwmon*' | tail -n +2 | head -1)"
POLY_HWMON="$HWMON_BASEDIR"/temp1_input
if type "xrandr"; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$m polybar main --reload -c $HOME/.config/polybar/config &
POLY_WLP=$POLY_WLP POLY_ENP=$POLY_ENP POLY_HWMON=$POLY_HWMON MONITOR=$m polybar main --reload -c "$HOME/.config/polybar/config" &
done
else
polybar main --reload -c $HOME/.config/polybar/config &
polybar main --reload -c "$HOME/.config/polybar/config" &
fi

@ -10,10 +10,26 @@
# startx $HOME/.xinitrc i3
# xinit -- $DISPLAY -nolisten tcp vt$XDG_VTNR
if [ -f $HOME/.Xresources ]; then
xrdb -merge $HOME/.Xresources
if [ -f "$HOME/.Xresources" ]; then
xrdb -merge "$HOME/.Xresources"
fi
# invoke local X session script
. $HOME/.xsession
# NOTE: this stinks a bit, and everything works without this... BUT there are
# some parameters set in this collection of scripts of which at the
# moment I don't have the time (and will) to grasp the secuirty
# consequences of removing them.
# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for i in /etc/X11/xinit/xinitrc.d/* ; do
if [ -x "$i" ]; then
. "$i"
fi
done
fi
# To avoid very solw startup of many GTK apps
# https://dbus.freedesktop.org/doc/dbus-update-activation-environment.1.html
#dbus-update-activation-environment --systemd DISPLAY
# invoke local X session script
. "$HOME/.xsession"

Loading…
Cancel
Save