Add tsui to Tailscale installer (#604)

This commit is contained in:
Ryan Hughes 2025-08-22 22:22:29 +02:00 committed by GitHub
parent 85f9fb486e
commit b8bd1d1d6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 112 additions and 12 deletions

View File

@ -1,8 +1,13 @@
#!/bin/bash
curl -fsSL https://tailscale.com/install.sh | sh
curl -fsSL https://neuralink.com/tsui/install.sh | bash
echo -e "\nStarting Tailscale..."
sudo tailscale up --accept-routes
omarchy-webapp-install "Tailscale" "https://login.tailscale.com/admin/machines" https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/tailscale-light.png
echo -e "\nAdd tsui to sudoers..."
echo "$USER ALL=(ALL) NOPASSWD: $(which tsui)" | sudo tee /etc/sudoers.d/tsui
omarchy-tui-install "Tailscale" "sudo tsui" float https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/tailscale-light.png
omarchy-webapp-install "Tailscale Admin Console" "https://login.tailscale.com/admin/machines" https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/tailscale-light.png

View File

@ -172,9 +172,10 @@ show_setup_config_menu() {
}
show_install_menu() {
case $(menu "Install" "󰣇 Package\n Web App\n Service\n Style\n󰵮 Development\n Editor\n󱚤 AI\n Gaming") in
case $(menu "Install" "󰣇 Package\n Web App\n TUI\n Service\n Style\n󰵮 Development\n Editor\n󱚤 AI\n Gaming") in
*Package*) terminal omarchy-pkg-install ;;
*Web*) present_terminal omarchy-webapp-install ;;
*TUI*) present_terminal omarchy-tui-install ;;
*Service*) show_install_service_menu ;;
*Style*) show_install_style_menu ;;
*Development*) show_install_development_menu ;;
@ -289,9 +290,10 @@ show_install_elixir_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 TUI\n󰸌 Theme\n󰈷 Fingerprint\n Fido2") in
*Package*) terminal omarchy-pkg-remove ;;
*Web*) present_terminal omarchy-webapp-remove ;;
*TUI*) present_terminal omarchy-tui-remove ;;
*Theme*) present_terminal omarchy-theme-remove ;;
*Fingerprint*) present_terminal "omarchy-setup-fingerprint --remove" ;;
*Fido2*) present_terminal "omarchy-setup-fido2 --remove" ;;

54
bin/omarchy-tui-install Executable file
View File

@ -0,0 +1,54 @@
#!/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"
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."
return 1
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=alacritty --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

36
bin/omarchy-tui-remove Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
ICON_DIR="$HOME/.local/share/applications/icons"
DESKTOP_DIR="$HOME/.local/share/applications/"
if [ "$#" -ne 1 ]; then
# Find all web apps
while IFS= read -r -d '' file; do
if grep -q '^Exec=.*alacritty.*-e' "$file"; then
TUIS+=("$(basename "${file%.desktop}")")
fi
done < <(find "$DESKTOP_DIR" -name '*.desktop' -print0)
if ((${#TUIS[@]})); then
IFS=$'\n' SORTED_TUIS=($(sort <<<"${TUIS[*]}"))
unset IFS
APP_NAME=$(gum choose --header "Select TUI to remove..." "${SORTED_TUIS[@]}")
else
echo "No TUIs to remove."
exit 1
fi
else
APP_NAME="$1"
fi
if [[ -z "$APP_NAME" ]]; then
echo "You must provide TUI name."
exit 1
fi
rm "$DESKTOP_DIR/$APP_NAME.desktop"
rm "$ICON_DIR/$APP_NAME.png"
if [ "$#" -ne 1 ]; then
echo -e "Removed $APP_NAME\n"
fi

View File

@ -1,13 +1,10 @@
# Float and center settings and previews
windowrule = float, class:^(blueberry.py|Impala|Wiremix|org.gnome.NautilusPreviewer|Omarchy|About)$
windowrule = center, class:^(blueberry.py|Impala|Wiremix|org.gnome.NautilusPreviewer|Omarchy|About)$
windowrule = size 800 600, class:^(blueberry.py|Impala|Wiremix|org.gnome.NautilusPreviewer|com.gabm.satty|Omarchy|About)$
# Floating windows
windowrule = float, tag:floating-window
windowrule = center, tag:floating-window
windowrule = size 800 600, tag:floating-window
# Float and center file pickers
windowrule = tag +picker, class:(xdg-desktop-portal-gtk|sublime_text)
windowrule = float, tag:picker, title:^(Open.*Files?|Save.*Files?|All Files|Save)
windowrule = center, tag:picker, title:^(Open.*Files?|Save.*Files?|All Files|Save)
windowrule = size 800 600, tag:picker
windowrule = tag +floating-window, class:(blueberry.py|Impala|Wiremix|org.gnome.NautilusPreviewer|com.gabm.satty|Omarchy|About|TUI.float)
windowrule = tag +floating-window, class:(xdg-desktop-portal-gtk|sublime_text), title:^(Open.*Files?|Save.*Files?|All Files|Save)
# Fullscreen screensaver
windowrule = fullscreen, class:Screensaver

View File

@ -96,6 +96,7 @@ source $OMARCHY_INSTALL/desktop/printer.sh
# Apps
source $OMARCHY_INSTALL/apps/webapps.sh
source $OMARCHY_INSTALL/apps/tuis.sh
source $OMARCHY_INSTALL/apps/xtras.sh
source $OMARCHY_INSTALL/apps/mimetypes.sh

5
install/apps/tuis.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
if [ -z "$OMARCHY_BARE" ]; then
omarchy-tui-install "Disk Usage" "bash -c 'dust; read -n 1 -s'" float https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/qdirstat.png
fi