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
|
@ -21,6 +21,7 @@ set -euo pipefail
|
|||
# Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
SCRIPTS_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/hyprland-monitord"
|
||||
INIT_SCRIPT="$SCRIPTS_DIR/init.sh"
|
||||
ADD_SCRIPT="$SCRIPTS_DIR/added.sh"
|
||||
REMOVE_SCRIPT="$SCRIPTS_DIR/removed.sh"
|
||||
|
||||
|
@ -100,6 +101,12 @@ handle_remove() {
|
|||
|
||||
>&2 echo "Listening for monitor IPC events"
|
||||
|
||||
if [ -f "$INIT_SCRIPT" ]; then
|
||||
"$INIT_SCRIPT"
|
||||
else
|
||||
>&2 echo "Init script file not found ($INIT_SCRIPT)"
|
||||
fi
|
||||
|
||||
hyprland_ipc "monitoraddedv2" | while read -r line; do
|
||||
handle_add "$line"
|
||||
done &
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue