mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-06-29 12:10:42 +00:00
Add support for init script to hyprland-monitord
This commit is contained in:
parent
d9c71e2310
commit
867ba642c6
2 changed files with 29 additions and 0 deletions
22
home/.config/hyprland-monitord/init.sh
Executable file
22
home/.config/hyprland-monitord/init.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
MONITORS_AMT="$(hyprctl monitors -j | jq length)"
|
||||
|
||||
if [ "$MONITORS_AMT" -lt 1 ]; then
|
||||
>&2 echo "You seem to have 0 monitors..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$MONITORS_AMT" -eq 2 ]; then
|
||||
eww open bar1
|
||||
fi
|
||||
|
||||
if [ "$MONITORS_AMT" -eq 1 ]; then
|
||||
eww active-windows | grep "bar1" && eww close bar1
|
||||
fi
|
||||
|
||||
if [ "$MONITORS_AMT" -gt 2 ]; then
|
||||
>&2 echo "Unexpected monitor configuration (more than 2 monitors)"
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue