Hyprland-dotfiles/eww/ml4w-sidebar/launch.sh

33 lines
1.1 KiB
Bash
Raw Normal View History

2024-04-20 11:57:31 -04:00
#!/bin/bash
FILE="$HOME/.cache/ml4w_sidebar"
CFG="$HOME/dotfiles/eww/ml4w-sidebar"
EWW=`which eww`
if [[ ! `pidof eww` ]]; then
${EWW} daemon
sleep 0.5
fi
2024-05-01 06:18:47 -04:00
if [ -f $HOME/dotfiles/.settings/eww-monitor.sh ] && [ $(cat $HOME/dotfiles/.settings/eww-monitor.sh) != "auto" ] ;then
echo ":: Using monitor id from $HOME/dotfiles/.settings/eww-monitor.sh"
sc=$(cat $HOME/dotfiles/.settings/eww-monitor.sh)
else
echo ":: Autodetect current focused monitor."
sc=$(python $HOME/dotfiles/hypr/scripts/active-monitor.py)
fi
2024-04-20 11:57:31 -04:00
if [[ ! -f "$FILE" ]]; then
touch "$FILE"
2024-04-28 04:41:41 -04:00
echo ":: Opening on Monitor $sc"
${EWW} --config "$CFG" open ml4wlauncher --screen $sc
${EWW} --config "$CFG" open resources --screen $sc
${EWW} --config "$CFG" open logout --screen $sc
${EWW} --config "$CFG" open suspend --screen $sc
${EWW} --config "$CFG" open lock --screen $sc
${EWW} --config "$CFG" open reboot --screen $sc
${EWW} --config "$CFG" open shutdown --screen $sc
${EWW} --config "$CFG" open close --screen $sc
2024-04-20 11:57:31 -04:00
else
2024-04-22 08:46:08 -04:00
${EWW} --config "$CFG" close resources ml4wlauncher logout suspend lock reboot shutdown close
2024-04-28 04:41:41 -04:00
echo ":: Closing widgets"
2024-04-20 11:57:31 -04:00
rm "$FILE"
fi