mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Add hooks for theme set, font set, and post update (#2527)
Ala git hooks
This commit is contained in:
committed by
GitHub
parent
63e3b3e32f
commit
24e76a3b90
@@ -28,6 +28,8 @@ if [[ -n "$font_name" && "$font_name" != "CNCLD" ]]; then
|
|||||||
omarchy-restart-waybar
|
omarchy-restart-waybar
|
||||||
omarchy-restart-swayosd
|
omarchy-restart-swayosd
|
||||||
omarchy-restart-walker
|
omarchy-restart-walker
|
||||||
|
|
||||||
|
omarchy-hook font-set "$font_name"
|
||||||
else
|
else
|
||||||
echo "Font '$font_name' not found."
|
echo "Font '$font_name' not found."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
14
bin/omarchy-hook
Executable file
14
bin/omarchy-hook
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ $# -lt 1 ]]; then
|
||||||
|
echo "Usage: omarchy-hook [name] [args...]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
HOOK=$1
|
||||||
|
HOOK_PATH="$HOME/.config/omarchy/hooks/$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [[ -f $HOOK_PATH ]]; then
|
||||||
|
bash "$HOOK_PATH" "$@"
|
||||||
|
fi
|
||||||
@@ -39,3 +39,6 @@ omarchy-theme-set-browser
|
|||||||
omarchy-theme-set-vscode
|
omarchy-theme-set-vscode
|
||||||
omarchy-theme-set-cursor
|
omarchy-theme-set-cursor
|
||||||
omarchy-theme-set-obsidian
|
omarchy-theme-set-obsidian
|
||||||
|
|
||||||
|
# Call hook on theme set
|
||||||
|
omarchy-hook theme-set "$THEME_NAME"
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ set -e
|
|||||||
omarchy-update-available-reset
|
omarchy-update-available-reset
|
||||||
omarchy-update-system-pkgs
|
omarchy-update-system-pkgs
|
||||||
omarchy-migrate
|
omarchy-migrate
|
||||||
|
omarchy-hook post-update
|
||||||
omarchy-update-restart
|
omarchy-update-restart
|
||||||
|
|||||||
7
config/omarchy/hooks/font-set.sample
Normal file
7
config/omarchy/hooks/font-set.sample
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# Example: Show the name of the theme that was just set.
|
||||||
|
# notify-send "New font" "Your new font is $1"
|
||||||
7
config/omarchy/hooks/post-update.sample
Normal file
7
config/omarchy/hooks/post-update.sample
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This hook is called after an Omarchy system update has been performed.
|
||||||
|
# To put it into use, remove .sample from the name.
|
||||||
|
|
||||||
|
# Example: Show notification after the system has been updated.
|
||||||
|
# notify-send "Update Performed" "Your system is now up to date"
|
||||||
7
config/omarchy/hooks/theme-set.sample
Normal file
7
config/omarchy/hooks/theme-set.sample
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# Example: Show the name of the theme that was just set.
|
||||||
|
# notify-send "New theme" "Your new theme is $1"
|
||||||
Reference in New Issue
Block a user