eww replacement of waybar
This commit is contained in:
21
eww/scripts/launch.sh
Normal file
21
eww/scripts/launch.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
EWW="eww -c $HOME/.config/eww"
|
||||
$EWW kill 2>/dev/null
|
||||
sleep 0.5
|
||||
|
||||
declare -A BAR_MAP=(
|
||||
["DP-2"]="bar-dp2"
|
||||
["HDMI-A-1"]="bar-hdmi"
|
||||
)
|
||||
|
||||
while IFS= read -r line; do
|
||||
id=$(echo "$line" | awk '{print $1}')
|
||||
name=$(echo "$line" | awk '{print $2}')
|
||||
bar_name="${BAR_MAP[$name]}"
|
||||
if [[ -z "$bar_name" ]]; then
|
||||
echo "Warning: no bar mapped for monitor '$name'"
|
||||
continue
|
||||
fi
|
||||
echo "Opening $bar_name on $name (index $id)"
|
||||
$EWW open "$bar_name"
|
||||
done < <(hyprctl monitors -j | jq -r '.[] | "\(.id) \(.name)"')
|
||||
Reference in New Issue
Block a user