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>
This commit is contained in:
Ofir Miller
2025-09-16 15:32:40 +03:00
committed by GitHub
parent c8fa96f382
commit 7e1c88b932
25 changed files with 68 additions and 28 deletions

View File

@@ -7,7 +7,7 @@ screensaver_in_focus() {
exit_screensaver() {
hyprctl keyword cursor:invisible false
pkill -x tte 2>/dev/null
pkill -f "alacritty --class Screensaver" 2>/dev/null
pkill -f "$TERMINAL --class Screensaver" 2>/dev/null
exit 0
}

View File

@@ -1,3 +1,3 @@
#!/bin/bash
grep -oP 'family\s*=\s*"\K[^"]+' ~/.config/alacritty/alacritty.toml | head -n1
grep -oP 'font-family:\s*["'\'']?\K[^;"'\'']+' ~/.config/waybar/style.css | head -n1

View File

@@ -4,7 +4,15 @@ 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
if [[ -f ~/.config/alacritty/alacritty.toml ]]; then
sed -i "s/family = \".*\"/family = \"$font_name\"/g" ~/.config/alacritty/alacritty.toml
fi
if [[ -f ~/.config/kitty/kitty.conf ]]; then
sed -i "s/^font_family .*/font_family $font_name/g" ~/.config/kitty/kitty.conf
pkill -USR1 kitty
fi
sed -i "s/font-family: .*/font-family: '$font_name';/g" ~/.config/waybar/style.css
sed -i "s/font-family: .*/font-family: '$font_name';/g" ~/.config/swayosd/style.css
xmlstarlet ed -L \

3
bin/omarchy-launch-about Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
exec setsid uwsm app -- "$TERMINAL" --class=Omarchy -o font.size=9 -e bash -c 'fastfetch; read -n 1 -s'

View File

@@ -1,4 +1,4 @@
#!/bin/bash
cmd="$*"
setsid alacritty --class Omarchy -e bash -c "omarchy-show-logo; $cmd; omarchy-show-done"
exec setsid uwsm app -- "$TERMINAL" --class=Omarchy -e bash -c "omarchy-show-logo; $cmd; omarchy-show-done"

View File

@@ -6,7 +6,7 @@ if ! command -v tte &>/dev/null; then
fi
# Exit early if screensave is already running
pgrep -f "alacritty --class Screensaver" && exit 0
pgrep -f "$TERMINAL --class Screensaver" && exit 0
# Allow screensaver to be turned off but also force started
if [[ -f ~/.local/state/omarchy/toggles/screensaver-off ]] && [[ $1 != "force" ]]; then
@@ -17,6 +17,8 @@ focused=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')
for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
hyprctl dispatch focusmonitor $m
# FIXME: Find a way to make this generic where we it can work for kitty + ghostty
hyprctl dispatch exec -- \
alacritty --class Screensaver \
--config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml \

3
bin/omarchy-launch-wifi Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
exec setsid uwsm app -- "$TERMINAL" --class=Impala -e impala "$@"

View File

@@ -9,4 +9,4 @@ if pgrep -x "1password" >/dev/null; then
fi
# Avoid running screensaver when locked
pkill -f "alacritty --class Screensaver"
pkill -f "$TERMINAL --class Screensaver"

View File

@@ -37,7 +37,7 @@ menu() {
}
terminal() {
alacritty --class Omarchy -e "$@"
$TERMINAL --class Omarchy -e "$@"
}
present_terminal() {
@@ -46,7 +46,7 @@ present_terminal() {
edit_in_nvim() {
notify-send "Editing config file" "$1"
alacritty -e nvim "$1"
$TERMINAL -e nvim "$1"
}
install() {
@@ -174,10 +174,10 @@ show_setup_menu() {
options="$options\n󰱔 DNS\n Config\n󰈷 Fingerprint\n Fido2"
case $(menu "Setup" "$options") in
*Audio*) alacritty --class=Wiremix -e wiremix ;;
*Audio*) $TERMINAL --class=Wiremix -e wiremix ;;
*Wifi*)
rfkill unblock wifi
alacritty --class=Impala -e impala
omarchy-launch-wifi
;;
*Bluetooth*)
rfkill unblock bluetooth
@@ -445,7 +445,7 @@ go_to_menu() {
*remove*) show_remove_menu ;;
*update*) show_update_menu ;;
*learn*) show_learn_menu ;;
*about*) alacritty --class Omarchy -o font.size=9 -e bash -c 'fastfetch; read -n 1 -s' ;;
*about*) omarchy-launch-about ;;
*system*) show_system_menu ;;
esac
}

View File

@@ -24,7 +24,6 @@ ln -nsf "$THEME_PATH" "$CURRENT_THEME_DIR"
omarchy-theme-bg-next
# Restart components to apply new theme
touch ~/.config/alacritty/alacritty.toml
omarchy-restart-waybar
omarchy-restart-swayosd
hyprctl reload
@@ -32,6 +31,7 @@ pkill -SIGUSR2 btop
makoctl reload
# Change gnome, browser, vscode themes
omarchy-theme-set-terminal
omarchy-theme-set-gnome
omarchy-theme-set-eza
omarchy-theme-set-browser

6
bin/omarchy-theme-set-terminal Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
case "$TERMINAL" in
"alacritty") touch ~/.config/alacritty/alacritty.toml ;;
"kitty") pkill -USR1 kitty ;;
esac

View File

@@ -43,7 +43,7 @@ cat >"$DESKTOP_FILE" <<EOF
Version=1.0
Name=$APP_NAME
Comment=$APP_NAME
Exec=alacritty --class $APP_CLASS -e $APP_EXEC
Exec=$TERMINAL --class $APP_CLASS -e $APP_EXEC
Terminal=false
Type=Application
Icon=$ICON_PATH

View File

@@ -6,7 +6,7 @@ DESKTOP_DIR="$HOME/.local/share/applications/"
if [ "$#" -eq 0 ]; then
# Find all TUIs
while IFS= read -r -d '' file; do
if grep -q '^Exec=.*alacritty.*-e' "$file"; then
if grep -q '^Exec=.*$TERMINAL.*-e' "$file"; then
TUIS+=("$(basename "${file%.desktop}")")
fi
done < <(find "$DESKTOP_DIR" -name '*.desktop' -print0)