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

@@ -2,7 +2,7 @@
Name=Neovim Name=Neovim
GenericName=Text Editor GenericName=Text Editor
Comment=Edit text files Comment=Edit text files
Exec=alacritty --class=nvim --title=nvim -e nvim -- %F Exec=$TERMINAL --class=nvim --title=nvim -e nvim -- %F
Terminal=false Terminal=false
Type=Application Type=Application
Keywords=Text;editor; Keywords=Text;editor;

View File

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

View File

@@ -1,3 +1,3 @@
#!/bin/bash #!/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 [[ -n "$font_name" && "$font_name" != "CNCLD" ]]; then
if fc-list | grep -iq "$font_name"; 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/waybar/style.css
sed -i "s/font-family: .*/font-family: '$font_name';/g" ~/.config/swayosd/style.css sed -i "s/font-family: .*/font-family: '$font_name';/g" ~/.config/swayosd/style.css
xmlstarlet ed -L \ 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 #!/bin/bash
cmd="$*" 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 fi
# Exit early if screensave is already running # 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 # Allow screensaver to be turned off but also force started
if [[ -f ~/.local/state/omarchy/toggles/screensaver-off ]] && [[ $1 != "force" ]]; then 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 for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
hyprctl dispatch focusmonitor $m hyprctl dispatch focusmonitor $m
# FIXME: Find a way to make this generic where we it can work for kitty + ghostty
hyprctl dispatch exec -- \ hyprctl dispatch exec -- \
alacritty --class Screensaver \ alacritty --class Screensaver \
--config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml \ --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 fi
# Avoid running screensaver when locked # Avoid running screensaver when locked
pkill -f "alacritty --class Screensaver" pkill -f "$TERMINAL --class Screensaver"

View File

@@ -37,7 +37,7 @@ menu() {
} }
terminal() { terminal() {
alacritty --class Omarchy -e "$@" $TERMINAL --class Omarchy -e "$@"
} }
present_terminal() { present_terminal() {
@@ -46,7 +46,7 @@ present_terminal() {
edit_in_nvim() { edit_in_nvim() {
notify-send "Editing config file" "$1" notify-send "Editing config file" "$1"
alacritty -e nvim "$1" $TERMINAL -e nvim "$1"
} }
install() { install() {
@@ -174,10 +174,10 @@ show_setup_menu() {
options="$options\n󰱔 DNS\n Config\n󰈷 Fingerprint\n Fido2" options="$options\n󰱔 DNS\n Config\n󰈷 Fingerprint\n Fido2"
case $(menu "Setup" "$options") in case $(menu "Setup" "$options") in
*Audio*) alacritty --class=Wiremix -e wiremix ;; *Audio*) $TERMINAL --class=Wiremix -e wiremix ;;
*Wifi*) *Wifi*)
rfkill unblock wifi rfkill unblock wifi
alacritty --class=Impala -e impala omarchy-launch-wifi
;; ;;
*Bluetooth*) *Bluetooth*)
rfkill unblock bluetooth rfkill unblock bluetooth
@@ -445,7 +445,7 @@ go_to_menu() {
*remove*) show_remove_menu ;; *remove*) show_remove_menu ;;
*update*) show_update_menu ;; *update*) show_update_menu ;;
*learn*) show_learn_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 ;; *system*) show_system_menu ;;
esac esac
} }

View File

@@ -24,7 +24,6 @@ ln -nsf "$THEME_PATH" "$CURRENT_THEME_DIR"
omarchy-theme-bg-next omarchy-theme-bg-next
# Restart components to apply new theme # Restart components to apply new theme
touch ~/.config/alacritty/alacritty.toml
omarchy-restart-waybar omarchy-restart-waybar
omarchy-restart-swayosd omarchy-restart-swayosd
hyprctl reload hyprctl reload
@@ -32,6 +31,7 @@ pkill -SIGUSR2 btop
makoctl reload makoctl reload
# Change gnome, browser, vscode themes # Change gnome, browser, vscode themes
omarchy-theme-set-terminal
omarchy-theme-set-gnome omarchy-theme-set-gnome
omarchy-theme-set-eza omarchy-theme-set-eza
omarchy-theme-set-browser 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 Version=1.0
Name=$APP_NAME Name=$APP_NAME
Comment=$APP_NAME Comment=$APP_NAME
Exec=alacritty --class $APP_CLASS -e $APP_EXEC Exec=$TERMINAL --class $APP_CLASS -e $APP_EXEC
Terminal=false Terminal=false
Type=Application Type=Application
Icon=$ICON_PATH Icon=$ICON_PATH

View File

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

View File

@@ -1,5 +1,5 @@
# Application bindings # Application bindings
$terminal = uwsm app -- alacritty $terminal = uwsm app -- $TERMINAL
$browser = omarchy-launch-browser $browser = omarchy-launch-browser
bindd = SUPER, return, Terminal, exec, $terminal --working-directory="$(omarchy-cmd-terminal-cwd)" bindd = SUPER, return, Terminal, exec, $terminal --working-directory="$(omarchy-cmd-terminal-cwd)"

View File

@@ -1,3 +1,2 @@
# Extra env variables # Extra env variables
# Note: You must relaunch Hyprland after changing envs (use Super+Esc, then Relaunch)
# env = MY_GLOBAL_ENV,setting # env = MY_GLOBAL_ENV,setting

View File

@@ -28,7 +28,7 @@ input {
} }
# Scroll faster in the terminal # Scroll faster in the terminal
windowrule = scrolltouchpad 1.5, class:Alacritty windowrule = scrolltouchpad 1.5, tag:terminal
# Enable touchpad gestures for changing workspaces # Enable touchpad gestures for changing workspaces
# See https://wiki.hyprland.org/Configuring/Gestures/ # See https://wiki.hyprland.org/Configuring/Gestures/

View File

@@ -1,7 +1,11 @@
# Changes require a relaunch of Hyprland to take effect.
# Ensure Omarchy bins are in the path
export OMARCHY_PATH=$HOME/.local/share/omarchy export OMARCHY_PATH=$HOME/.local/share/omarchy
export PATH=$OMARCHY_PATH/bin/:$PATH export PATH=$OMARCHY_PATH/bin/:$PATH
# Set terminal used by all default commands
export TERMINAL=alacritty export TERMINAL=alacritty
if command -v mise &> /dev/null; then # Activate mise if present on the system
eval "$(mise activate bash)" omarchy-cmd-present mise && eval "$(mise activate bash)"
fi

View File

@@ -55,7 +55,7 @@
"cpu": { "cpu": {
"interval": 5, "interval": 5,
"format": "󰍛", "format": "󰍛",
"on-click": "alacritty -e btop" "on-click": "$TERMINAL -e btop"
}, },
"clock": { "clock": {
"format": "{:L%A %H:%M}", "format": "{:L%A %H:%M}",
@@ -74,7 +74,7 @@
"tooltip-format-disconnected": "Disconnected", "tooltip-format-disconnected": "Disconnected",
"interval": 3, "interval": 3,
"spacing": 1, "spacing": 1,
"on-click": "alacritty --class=Impala -e impala" "on-click": "omarchy-launch-wifi"
}, },
"battery": { "battery": {
"format": "{capacity}% {icon}", "format": "{capacity}% {icon}",
@@ -104,7 +104,7 @@
}, },
"pulseaudio": { "pulseaudio": {
"format": "{icon}", "format": "{icon}",
"on-click": "alacritty --class=Wiremix -e wiremix", "on-click": "$TERMINAL --class=Wiremix -e wiremix",
"on-click-right": "pamixer -t", "on-click-right": "pamixer -t",
"tooltip-format": "Playing at {volume}%", "tooltip-format": "Playing at {volume}%",
"scroll-step": 5, "scroll-step": 5,

View File

@@ -4,10 +4,11 @@ source = ~/.local/share/omarchy/default/hypr/apps/bitwarden.conf
source = ~/.local/share/omarchy/default/hypr/apps/browser.conf source = ~/.local/share/omarchy/default/hypr/apps/browser.conf
source = ~/.local/share/omarchy/default/hypr/apps/hyprshot.conf source = ~/.local/share/omarchy/default/hypr/apps/hyprshot.conf
source = ~/.local/share/omarchy/default/hypr/apps/jetbrains.conf source = ~/.local/share/omarchy/default/hypr/apps/jetbrains.conf
source = ~/.local/share/omarchy/default/hypr/apps/localsend.conf
source = ~/.local/share/omarchy/default/hypr/apps/pip.conf source = ~/.local/share/omarchy/default/hypr/apps/pip.conf
source = ~/.local/share/omarchy/default/hypr/apps/qemu.conf source = ~/.local/share/omarchy/default/hypr/apps/qemu.conf
source = ~/.local/share/omarchy/default/hypr/apps/retroarch.conf source = ~/.local/share/omarchy/default/hypr/apps/retroarch.conf
source = ~/.local/share/omarchy/default/hypr/apps/steam.conf source = ~/.local/share/omarchy/default/hypr/apps/steam.conf
source = ~/.local/share/omarchy/default/hypr/apps/system.conf source = ~/.local/share/omarchy/default/hypr/apps/system.conf
source = ~/.local/share/omarchy/default/hypr/apps/terminals.conf
source = ~/.local/share/omarchy/default/hypr/apps/walker.conf source = ~/.local/share/omarchy/default/hypr/apps/walker.conf
source = ~/.local/share/omarchy/default/hypr/apps/localsend.conf

View File

@@ -0,0 +1,2 @@
# Define terminal tag to style them uniformly
windowrule = tag +terminal, class:(Alacritty|kitty|ghostty)

View File

@@ -16,7 +16,7 @@ invisible=false
default-timeout=0 default-timeout=0
[summary~="Setup Wi-Fi"] [summary~="Setup Wi-Fi"]
on-button-left=exec sh -c 'omarchy-notification-dismiss "Setup Wi-Fi"; alacritty --class=Impala -e impala' on-button-left=exec sh -c 'omarchy-notification-dismiss "Setup Wi-Fi"; omarchy-launch-wifi'
[summary~="Update System"] [summary~="Update System"]
on-button-left=exec sh -c 'omarchy-notification-dismiss "Update System"; omarchy-launch-floating-terminal-with-presentation omarchy-update' on-button-left=exec sh -c 'omarchy-notification-dismiss "Update System"; omarchy-launch-floating-terminal-with-presentation omarchy-update'

View File

@@ -1,3 +1,5 @@
echo "Remove opacity from alacritty.toml so Hyprland can control fully" echo "Remove opacity from alacritty.toml so Hyprland can control fully"
sed -i '/opacity = 0.98/d' ~/.config/alacritty/alacritty.toml if [[ -f ~/.config/alacritty/alacritty.toml ]]; then
sed -i '/opacity = 0.98/d' ~/.config/alacritty/alacritty.toml
fi

10
migrations/1758019332.sh Normal file
View File

@@ -0,0 +1,10 @@
echo "Ensure $TERMINAL is set in uwsm env so entire system can rely on it"
if ! grep -q "export TERMINAL" ~/.config/uwsm/env; then
omarchy-refresh-config uwsm/env
omarchy-state set relaunch-required
fi
if grep -q "scrolltouchpad 1.5, class:Alacritty" ~/.config/hypr/input.conf; then
sed -i 's/windowrule = scrolltouchpad 1\.5, class:Alacritty/windowrule = scrolltouchpad 1.5, tag:terminal/' ~/.config/hypr/input.conf
fi

View File

@@ -3,4 +3,4 @@ general {
} }
# Kanagawa backdrop is too strong for detault opacity # Kanagawa backdrop is too strong for detault opacity
windowrule = opacity 0.98 0.95, class:Alacritty windowrule = opacity 0.98 0.95, tag:terminal