Files
omarchy/bin/omarchy-tui-install
Ofir Miller 7e1c88b932 update to use $TERMINAL instead of alacitty (#1648)
* update to use $TERMINAL instead of alacitty

* revert

* move env to hyprconfig

* Only set if we have alacritty

* Add launcher for wifi settings so it can be used in mako config

* Set system terminal in config/uwsm/env to ensure its available everywhere

* Ensure that $TERMINAL is available after update

* Didn't work to have the TERMINAL env in Hyprland

* Configure terminal settings against a full set of options

* Make About usable with any terminal

* One more alacritty-specific setting

* Use the new wifi launcher bin

* Only require the update/relaunch if TERMINAL isn't already set in config/uwsm/env

* More alacritty usage converted to $TERMINAL

* Use new launcher

* Change scrolltouchpad input rule to apply to all terminals

* Its a singular match

* Take current font from waybar, in case we don't have alacritty

* Only set font for alacritty if its being used

* Get ready to be terminal agnostic on the refresh of config too

* Use new launcher

* Note the last reliance we have on alacritty

* Make theme setting for terminals generic and include kitty

* Set font_family for kitty as well

* Quiet grep

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
2025-09-16 14:32:40 +02:00

58 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
if [ "$#" -ne 4 ]; then
echo -e "\e[32mLet's create a TUI shortcut you can start with the app launcher.\n\e[0m"
APP_NAME=$(gum input --prompt "Name> " --placeholder "My TUI")
APP_EXEC=$(gum input --prompt "Launch Command> " --placeholder "lazydocker or bash -c 'dust; read -n 1 -s'")
WINDOW_STYLE=$(gum choose --header "Window style" float tile)
ICON_URL=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG!)")
else
APP_NAME="$1"
APP_EXEC="$2"
WINDOW_STYLE="$3"
ICON_URL="$4"
fi
if [[ -z "$APP_NAME" || -z "$APP_EXEC" || -z "$ICON_URL" ]]; then
echo "You must set app name, app command, and icon URL!"
exit 1
fi
ICON_DIR="$HOME/.local/share/applications/icons"
DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop"
if [[ ! "$ICON_URL" =~ ^https?:// ]] && [ -f "$ICON_URL" ]; then
ICON_PATH="$ICON_URL"
else
ICON_PATH="$ICON_DIR/$APP_NAME.png"
mkdir -p "$ICON_DIR"
if ! curl -sL -o "$ICON_PATH" "$ICON_URL"; then
echo "Error: Failed to download icon."
exit 1
fi
fi
if [[ $WINDOW_STYLE == "float" ]]; then
APP_CLASS="TUI.float"
else
APP_CLASS="TUI.tile"
fi
cat >"$DESKTOP_FILE" <<EOF
[Desktop Entry]
Version=1.0
Name=$APP_NAME
Comment=$APP_NAME
Exec=$TERMINAL --class $APP_CLASS -e $APP_EXEC
Terminal=false
Type=Application
Icon=$ICON_PATH
StartupNotify=true
EOF
chmod +x "$DESKTOP_FILE"
if [ "$#" -ne 4 ]; then
echo -e "You can now find $APP_NAME using the app launcher (SUPER + SPACE)\n"
fi