dotfiles/hyprland/scripts/launch_waybar.sh
2023-11-27 23:31:36 +01:00

28 lines
775 B
Bash
Executable File

#!/bin/bash
getDisplay () {
local DESK
# DOCK
DESK="$(~/.config/hypr/scripts/displaybyname.sh Samsung Electric Company S34J55x H4LT100404)"
[[ -n "$DESK" ]] && echo $DESK && return
# FSI
DESK="$(~/.config/hypr/scripts/displaybyname.sh LG Electronics 24EB23 609NTFAF4483)"
[[ -n "$DESK" ]] && echo $DESK && return
# Technofabrik
DESK="$(~/.config/hypr/scripts/displaybyname.sh Dell Inc. DELL U2713HM GK0KD27S476L)"
[[ -n "$DESK" ]] && echo $DESK && return
# Fallback
echo "eDP-1"
}
if [[ -z "$PRIMARY_DISPLAY" ]]; then
PRIMARY_DISPLAY="$(getDisplay)"
fi
export PRIMARY_DISPLAY
envsubst < ~/.config/waybar/config > /tmp/waybar
pkill waybar
waybar -c /tmp/waybar $@ &!