Move to .d directories for hooks instead of a single file
Easier to manage especially with separate installs
This commit is contained in:
@@ -22,6 +22,7 @@ fi
|
|||||||
if [[ -d $HOOK_DIR ]]; then
|
if [[ -d $HOOK_DIR ]]; then
|
||||||
for hook in "$HOOK_DIR"/*; do
|
for hook in "$HOOK_DIR"/*; do
|
||||||
[[ -f $hook ]] || continue
|
[[ -f $hook ]] || continue
|
||||||
|
[[ $hook == *.sample ]] && continue
|
||||||
bash "$hook" "$@"
|
bash "$hook" "$@"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# This hook is called with the current battery percentage when the low battery
|
# This hook is called with the current battery percentage when the low battery
|
||||||
# notification is sent. To put it into use, remove .sample from the name.
|
# notification is sent. To put it into use, remove .sample from this file name.
|
||||||
|
|
||||||
SOUND_FILE="/usr/share/sounds/freedesktop/stereo/dialog-warning.oga"
|
SOUND_FILE="/usr/share/sounds/freedesktop/stereo/dialog-warning.oga"
|
||||||
|
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# This hook is called with the snake-cased name of the font that has just been set.
|
# This hook is called with the snake-cased name of the font that has just been set.
|
||||||
# To put it into use, remove .sample from the name.
|
# To put it into use, remove .sample from this file name.
|
||||||
|
|
||||||
# Example: Show the name of the theme that was just set.
|
# Example: Show the name of the font that was just set.
|
||||||
# notify-send -u low "New font" "Your new font is $1"
|
# notify-send -u low "New font" "Your new font is $1"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# This hook is called after an Omarchy system update has been performed.
|
# This hook is called after an Omarchy system update has been performed.
|
||||||
# To put it into use, remove .sample from the name.
|
# To put it into use, remove .sample from this file name.
|
||||||
|
|
||||||
# Example: Show notification after the system has been updated.
|
# Example: Show notification after the system has been updated.
|
||||||
# notify-send -u low "Update Performed" "Your system is now up to date"
|
# notify-send -u low "Update Performed" "Your system is now up to date"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# This hook is called with the snake-cased name of the theme that has just been set.
|
# This hook is called with the snake-cased name of the theme that has just been set.
|
||||||
# To put it into use, remove .sample from the name.
|
# To put it into use, remove .sample from this file name.
|
||||||
|
|
||||||
# Example: Show the name of the theme that was just set.
|
# Example: Show the name of the theme that was just set.
|
||||||
# notify-send -u low "New theme" "Your new theme is $1"
|
# notify-send -u low "New theme" "Your new theme is $1"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
echo "Add sample low battery notification hook"
|
echo "Add sample low battery notification hook"
|
||||||
|
|
||||||
mkdir -p ~/.config/omarchy/hooks
|
mkdir -p ~/.config/omarchy/hooks/battery-low.d
|
||||||
|
|
||||||
if [[ ! -f ~/.config/omarchy/hooks/battery-low.sample ]]; then
|
if [[ ! -f ~/.config/omarchy/hooks/battery-low.d/play-warning-sound.sample ]]; then
|
||||||
cp "$OMARCHY_PATH/config/omarchy/hooks/battery-low.sample" ~/.config/omarchy/hooks/battery-low.sample
|
cp "$OMARCHY_PATH/config/omarchy/hooks/battery-low.d/play-warning-sound.sample" ~/.config/omarchy/hooks/battery-low.d/play-warning-sound.sample
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user