Pull the font-menu into omarchy-menu
This commit is contained in:
parent
58fbda80ef
commit
bade5b0d34
3
bin/omarchy-font-list
Executable file
3
bin/omarchy-font-list
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
fc-list :spacing=100 -f "%{family[0]}\n" | grep -v -i -E 'emoji|signwriting' | sort -u
|
@ -1,16 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
~/.local/share/omarchy/bin/omarchy-show-logo
|
|
||||||
|
|
||||||
font=$(
|
|
||||||
fc-list :spacing=100 -f "%{family[0]}\n" |
|
|
||||||
grep -v -i -E 'emoji|signwriting' |
|
|
||||||
sort -u |
|
|
||||||
gum choose --header "Choose terminal font"
|
|
||||||
)
|
|
||||||
|
|
||||||
if [[ -n "$font" ]]; then
|
|
||||||
sed -i "s/family = \".*\"/family = \"$font\"/g" ~/.config/alacritty/alacritty.toml
|
|
||||||
fi
|
|
||||||
|
|
||||||
~/.local/share/omarchy/bin/omarchy-show-done
|
|
14
bin/omarchy-font-set
Executable file
14
bin/omarchy-font-set
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
font_name="$1"
|
||||||
|
|
||||||
|
if [[ -n "$font_name" && "$font_name" != "CNCLD" ]]; then
|
||||||
|
if fc-list | grep -iq "$font_name"; then
|
||||||
|
sed -i "s/family = \".*\"/family = \"$font_name\"/g" ~/.config/alacritty/alacritty.toml
|
||||||
|
else
|
||||||
|
echo "Font '$font_name' not found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Usage: omarchy-font-set <font-name>"
|
||||||
|
fi
|
@ -3,7 +3,7 @@
|
|||||||
OMARCHY_BIN_PATH=~/.local/share/omarchy/bin
|
OMARCHY_BIN_PATH=~/.local/share/omarchy/bin
|
||||||
|
|
||||||
menu() {
|
menu() {
|
||||||
echo -e "$2" | walker --dmenu --theme dmenu_250 -p "$1…"
|
echo -e "$2" | walker --dmenu --theme dmenu_250 -p "$1…" $3
|
||||||
}
|
}
|
||||||
|
|
||||||
terminal() {
|
terminal() {
|
||||||
@ -23,6 +23,10 @@ install_and_launch() {
|
|||||||
present_terminal "echo 'Installing $1...'; yay -Sy --noconfirm $2 && gtk-launch $3"
|
present_terminal "echo 'Installing $1...'; yay -Sy --noconfirm $2 && gtk-launch $3"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_font() {
|
||||||
|
present_terminal "echo 'Installing $1...'; yay -Sy --noconfirm $2 && ~/.local/share/omarchy/bin/omarchy-font-set "$3""
|
||||||
|
}
|
||||||
|
|
||||||
show_learn_menu() {
|
show_learn_menu() {
|
||||||
case $(menu "Learn" " Keybindings\n Omarchy\n Hyprland\n Arch\n Neovim\n Bash") in
|
case $(menu "Learn" " Keybindings\n Omarchy\n Hyprland\n Arch\n Neovim\n Bash") in
|
||||||
*Keybindings*) $OMARCHY_BIN_PATH/omarchy-menu-keybindings ;;
|
*Keybindings*) $OMARCHY_BIN_PATH/omarchy-menu-keybindings ;;
|
||||||
@ -38,7 +42,7 @@ show_learn_menu() {
|
|||||||
show_style_menu() {
|
show_style_menu() {
|
||||||
case $(menu "Style" " Theme\n Font\n Background") in
|
case $(menu "Style" " Theme\n Font\n Background") in
|
||||||
*Theme*) show_theme_menu ;;
|
*Theme*) show_theme_menu ;;
|
||||||
*Font*) terminal $OMARCHY_BIN_PATH/omarchy-font-menu ;;
|
*Font*) show_font_menu ;;
|
||||||
*Background*) $OMARCHY_BIN_PATH/omarchy-theme-bg-next ;;
|
*Background*) $OMARCHY_BIN_PATH/omarchy-theme-bg-next ;;
|
||||||
*) show_main_menu ;;
|
*) show_main_menu ;;
|
||||||
esac
|
esac
|
||||||
@ -53,6 +57,15 @@ show_theme_menu() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show_font_menu() {
|
||||||
|
theme=$(menu "Font" "$($OMARCHY_BIN_PATH/omarchy-font-list)" "-w 350")
|
||||||
|
if [[ "$theme" == "CNCLD" || -z "$theme" ]]; then
|
||||||
|
show_main_menu
|
||||||
|
else
|
||||||
|
$OMARCHY_BIN_PATH/omarchy-font-set "$theme"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
show_capture_menu() {
|
show_capture_menu() {
|
||||||
case $(menu "Capture" " Screenshot\n Screenrecord\n Color") in
|
case $(menu "Capture" " Screenshot\n Screenrecord\n Color") in
|
||||||
*Screenshot*) show_screenshot_menu ;;
|
*Screenshot*) show_screenshot_menu ;;
|
||||||
@ -146,6 +159,17 @@ show_install_editor_menu() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show_install_font_menu() {
|
||||||
|
case $(menu "Install" " Meslo LG Mono") in
|
||||||
|
*Meslo*) install_font "VSCode" "visual-studio-code-bin" "code" ;;
|
||||||
|
*Fira*) install_and_launch "Fira Code" "ttf-firacode-nerd" "FiraCode Nerd Font" ;;
|
||||||
|
*Victor*) install_font "Victor Code" "ttf-victor-mono-nerd" "VictorMono Nerd Font" ;;
|
||||||
|
*Victor*) install_and_launch "Zed" "zed" "dev.zed.Zed" ;;
|
||||||
|
*Bitstream*) install_and_launch "Zed" "zed" "dev.zed.Zed" ;;
|
||||||
|
*) show_install_menu ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
show_remove_menu() {
|
show_remove_menu() {
|
||||||
case $(menu "Remove" " Package\n Web App\n Theme\n Fingerprint\n Fido2") in
|
case $(menu "Remove" " Package\n Web App\n Theme\n Fingerprint\n Fido2") in
|
||||||
*Package*) terminal $OMARCHY_BIN_PATH/omarchy-pkg-remove ;;
|
*Package*) terminal $OMARCHY_BIN_PATH/omarchy-pkg-remove ;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user