mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-09 20:47:48 +00:00
Allow changing Omarchy branches from the menu
This commit is contained in:
@@ -383,8 +383,9 @@ show_remove_menu() {
|
||||
}
|
||||
|
||||
show_update_menu() {
|
||||
case $(menu "Update" " Omarchy\n Config\n Extra Themes\n Process\n Hardware\n Password\n Timezone") in
|
||||
case $(menu "Update" " Omarchy\n Branch\n Config\n Extra Themes\n Process\n Hardware\n Password\n Timezone") in
|
||||
*Omarchy*) present_terminal omarchy-update ;;
|
||||
*Branch*) show_update_branch_menu ;;
|
||||
*Config*) show_update_config_menu ;;
|
||||
*Themes*) present_terminal omarchy-theme-update ;;
|
||||
*Process*) show_update_process_menu ;;
|
||||
@@ -395,6 +396,13 @@ show_update_menu() {
|
||||
esac
|
||||
}
|
||||
|
||||
show_update_branch_menu() {
|
||||
case $(menu "Branch" "master\ndev" "" "$(omarchy-version-branch)") in
|
||||
*master*) omarchy-update-branch master ;;
|
||||
*dev*) omarchy-update-branch dev ;;
|
||||
*) show_update_menu ;;
|
||||
esac
|
||||
}
|
||||
show_update_process_menu() {
|
||||
case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n Walker\n Waybar") in
|
||||
*Hypridle*) omarchy-restart-hypridle ;;
|
||||
|
||||
20
bin/omarchy-update-branch
Executable file
20
bin/omarchy-update-branch
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if (($# == 0)); then
|
||||
echo "Usage: omarchy-verion-branch-set [master|dev]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
new_branch="$1"
|
||||
|
||||
# Snapshot before switching branch
|
||||
omarchy-snapshot create || [ $? -eq 127 ]
|
||||
|
||||
# Checkout the new branch
|
||||
git -C $OMARCHY_PATH checkout $new_branch --autostash
|
||||
git -C $OMARCHY_PATH diff --check || git -C $OMARCHY_PATH reset --merge
|
||||
|
||||
# Update the system from the new branch
|
||||
omarchy-update-perform
|
||||
Reference in New Issue
Block a user