Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing to loop and adding focus #394

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions bin/omakub-sub/font-size.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
choice=$(gum choose {7..14} "<< Back" --height 11 --header "Choose your terminal font size")
FONT_SIZE_PATH="$HOME/.config/alacritty/font-size.toml"
choice=$(sed -n "s/^size = \(.*\)$/\1/p" $FONT_SIZE_PATH)

if [[ $choice =~ ^[0-9]+$ ]]; then
sed -i "s/^size = .*$/size = $choice/g" ~/.config/alacritty/font-size.toml
source $OMAKUB_PATH/bin/omakub-sub/font-size.sh
else
source $OMAKUB_PATH/bin/omakub-sub/font.sh
fi
# loop while various font sizes are selected; focus on current font size
while [[ $choice =~ ^[0-9]+$ ]]; do
sed -i "s/^size = .*$/size = $choice/g" $FONT_SIZE_PATH
choice=$(gum choose --selected "$choice" {7..14} "<< Back" --height 11 --header "Choose your terminal font size")
done

source $OMAKUB_PATH/bin/omakub-sub/font.sh
9 changes: 7 additions & 2 deletions bin/omakub-sub/uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
UNINSTALLER=$(gum file $OMAKUB_PATH/uninstall --height 26)
[ -n "$UNINSTALLER" ] && gum confirm "Run uninstaller?" && source $UNINSTALLER && gum spin --spinner globe --title "Uninstall completed!" -- sleep 3
CHOICES=($(find $OMAKUB_PATH/uninstall -type f -exec basename {} \; | sed 's/app-//;s/\.sh$//' | sort))
CHOICES+=("<< Back")

choice=$(gum choose "${CHOICES[@]}" --height 29 --header "Uninstall application")
app_user_wishes_to_uninstall=$(find $OMAKUB_PATH/uninstall -type f -name *"$choice".sh)

[ -n "$app_user_wishes_to_uninstall" ] && gum confirm "Run uninstaller for $choice?" && source $app_user_wishes_to_uninstall && gum spin --spinner globe --title "Uninstall completed!" -- sleep 3
clear
source $OMAKUB_PATH/bin/omakub