mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-06 12:37:46 +00:00
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:
@@ -2,7 +2,7 @@
|
||||
Name=Neovim
|
||||
GenericName=Text Editor
|
||||
Comment=Edit text files
|
||||
Exec=alacritty --class=nvim --title=nvim -e nvim -- %F
|
||||
Exec=$TERMINAL --class=nvim --title=nvim -e nvim -- %F
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Keywords=Text;editor;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,7 +4,15 @@ font_name="$1"
|
||||
|
||||
if [[ -n "$font_name" && "$font_name" != "CNCLD" ]]; then
|
||||
if fc-list | grep -iq "$font_name"; then
|
||||
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
3
bin/omarchy-launch-about
Executable 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'
|
||||
@@ -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"
|
||||
|
||||
@@ -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
3
bin/omarchy-launch-wifi
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
exec setsid uwsm app -- "$TERMINAL" --class=Impala -e impala "$@"
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
6
bin/omarchy-theme-set-terminal
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
case "$TERMINAL" in
|
||||
"alacritty") touch ~/.config/alacritty/alacritty.toml ;;
|
||||
"kitty") pkill -USR1 kitty ;;
|
||||
esac
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Application bindings
|
||||
$terminal = uwsm app -- alacritty
|
||||
$terminal = uwsm app -- $TERMINAL
|
||||
$browser = omarchy-launch-browser
|
||||
|
||||
bindd = SUPER, return, Terminal, exec, $terminal --working-directory="$(omarchy-cmd-terminal-cwd)"
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
# Extra env variables
|
||||
# Note: You must relaunch Hyprland after changing envs (use Super+Esc, then Relaunch)
|
||||
# env = MY_GLOBAL_ENV,setting
|
||||
|
||||
@@ -28,7 +28,7 @@ input {
|
||||
}
|
||||
|
||||
# Scroll faster in the terminal
|
||||
windowrule = scrolltouchpad 1.5, class:Alacritty
|
||||
windowrule = scrolltouchpad 1.5, tag:terminal
|
||||
|
||||
# Enable touchpad gestures for changing workspaces
|
||||
# See https://wiki.hyprland.org/Configuring/Gestures/
|
||||
|
||||
@@ -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 PATH=$OMARCHY_PATH/bin/:$PATH
|
||||
|
||||
# Set terminal used by all default commands
|
||||
export TERMINAL=alacritty
|
||||
|
||||
if command -v mise &> /dev/null; then
|
||||
eval "$(mise activate bash)"
|
||||
fi
|
||||
# Activate mise if present on the system
|
||||
omarchy-cmd-present mise && eval "$(mise activate bash)"
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
"cpu": {
|
||||
"interval": 5,
|
||||
"format": "",
|
||||
"on-click": "alacritty -e btop"
|
||||
"on-click": "$TERMINAL -e btop"
|
||||
},
|
||||
"clock": {
|
||||
"format": "{:L%A %H:%M}",
|
||||
@@ -74,7 +74,7 @@
|
||||
"tooltip-format-disconnected": "Disconnected",
|
||||
"interval": 3,
|
||||
"spacing": 1,
|
||||
"on-click": "alacritty --class=Impala -e impala"
|
||||
"on-click": "omarchy-launch-wifi"
|
||||
},
|
||||
"battery": {
|
||||
"format": "{capacity}% {icon}",
|
||||
@@ -104,7 +104,7 @@
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{icon}",
|
||||
"on-click": "alacritty --class=Wiremix -e wiremix",
|
||||
"on-click": "$TERMINAL --class=Wiremix -e wiremix",
|
||||
"on-click-right": "pamixer -t",
|
||||
"tooltip-format": "Playing at {volume}%",
|
||||
"scroll-step": 5,
|
||||
|
||||
@@ -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/hyprshot.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/qemu.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/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/localsend.conf
|
||||
|
||||
2
default/hypr/apps/terminals.conf
Normal file
2
default/hypr/apps/terminals.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
# Define terminal tag to style them uniformly
|
||||
windowrule = tag +terminal, class:(Alacritty|kitty|ghostty)
|
||||
@@ -16,7 +16,7 @@ invisible=false
|
||||
default-timeout=0
|
||||
|
||||
[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"]
|
||||
on-button-left=exec sh -c 'omarchy-notification-dismiss "Update System"; omarchy-launch-floating-terminal-with-presentation omarchy-update'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
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
10
migrations/1758019332.sh
Normal 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
|
||||
@@ -3,4 +3,4 @@ general {
|
||||
}
|
||||
|
||||
# Kanagawa backdrop is too strong for detault opacity
|
||||
windowrule = opacity 0.98 0.95, class:Alacritty
|
||||
windowrule = opacity 0.98 0.95, tag:terminal
|
||||
|
||||
Reference in New Issue
Block a user