diff --git a/applications/foot-server.desktop b/applications/foot-server.desktop new file mode 100644 index 00000000..0ab86d65 --- /dev/null +++ b/applications/foot-server.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Foot Server +NoDisplay=true diff --git a/applications/foot.desktop b/applications/foot.desktop new file mode 100644 index 00000000..b9f6676a --- /dev/null +++ b/applications/foot.desktop @@ -0,0 +1,21 @@ +[Desktop Entry] +Type=Application +TryExec=foot +Exec=foot +Icon=foot +Terminal=false +Categories=System;TerminalEmulator; +Name=Foot +GenericName=Terminal +Comment=A fast, lightweight and minimalistic Wayland terminal emulator +StartupNotify=true +StartupWMClass=foot +Actions=New; +X-TerminalArgExec=-e +X-TerminalArgAppId=--app-id= +X-TerminalArgTitle=--title= +X-TerminalArgDir=--working-directory= + +[Desktop Action New] +Name=New Terminal +Exec=foot diff --git a/applications/footclient.desktop b/applications/footclient.desktop new file mode 100644 index 00000000..e4590087 --- /dev/null +++ b/applications/footclient.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Foot Client +NoDisplay=true diff --git a/bin/omarchy-font-set b/bin/omarchy-font-set index 2327d341..44bb9833 100755 --- a/bin/omarchy-font-set +++ b/bin/omarchy-font-set @@ -22,6 +22,10 @@ if [[ -n $font_name ]]; then pkill -SIGUSR2 ghostty fi + if [[ -f ~/.config/foot/foot.ini ]]; then + sed -i "s/^font=.*/font=$font_name:size=9/g" ~/.config/foot/foot.ini + fi + sed -i "s/font_family = .*/font_family = $font_name/g" ~/.config/hypr/hyprlock.conf 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 @@ -37,6 +41,10 @@ if [[ -n $font_name ]]; then notify-send -u low " You must restart Ghostty to see font change" fi + if pgrep -x foot; then + notify-send -u low " You must restart Foot to see font change" + fi + omarchy-hook font-set "$font_name" else echo "Font '$font_name' not found." diff --git a/bin/omarchy-install-terminal b/bin/omarchy-install-terminal index 146e4167..15a869d1 100755 --- a/bin/omarchy-install-terminal +++ b/bin/omarchy-install-terminal @@ -1,11 +1,11 @@ #!/bin/bash # omarchy:summary=Install one of the approved terminals and set it as the default for Omarchy (Super + Return etc). -# omarchy:args= +# omarchy:args= # omarchy:requires-sudo=true if (($# == 0)); then - echo "Usage: omarchy-install-terminal [alacritty|ghostty|kitty]" + echo "Usage: omarchy-install-terminal [alacritty|foot|ghostty|kitty]" exit 1 fi @@ -14,6 +14,7 @@ package="$1" # Map package name to desktop entry ID case "$package" in alacritty) desktop_id="Alacritty.desktop" ;; +foot) desktop_id="foot.desktop" ;; ghostty) desktop_id="com.mitchellh.ghostty.desktop" ;; kitty) desktop_id="kitty.desktop" ;; *) @@ -26,10 +27,15 @@ echo "Installing $package..." # Install package if omarchy-pkg-add $package; then - # Copy custom desktop entry for alacritty with X-TerminalArg* keys - if [[ $package == "alacritty" ]]; then + # Copy custom desktop entries with X-TerminalArg* keys + if [[ $package == "alacritty" || $package == "foot" ]]; then mkdir -p ~/.local/share/applications - cp $OMARCHY_PATH/applications/Alacritty.desktop ~/.local/share/applications/ + cp "$OMARCHY_PATH/applications/$desktop_id" ~/.local/share/applications/ + fi + + # Copy default config for optional terminals when missing + if [[ ! -e ~/.config/$package ]]; then + cp -Rpf "$OMARCHY_PATH/config/$package" ~/.config/ fi # Update xdg-terminals.list to prioritize the proper terminal diff --git a/bin/omarchy-launch-screensaver b/bin/omarchy-launch-screensaver index e3593ba5..0cd64a70 100755 --- a/bin/omarchy-launch-screensaver +++ b/bin/omarchy-launch-screensaver @@ -37,6 +37,12 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do --font-size=18 \ -e omarchy-screensaver ;; + *foot*) + hyprctl dispatch exec -- \ + foot --app-id=org.omarchy.screensaver \ + --config="$OMARCHY_PATH/default/foot/screensaver.ini" \ + -e omarchy-screensaver + ;; *kitty*) hyprctl dispatch exec -- \ kitty --class=org.omarchy.screensaver \ @@ -45,7 +51,7 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do -e omarchy-screensaver ;; *) - notify-send -u low "✋ Screensaver only runs in Alacritty, Ghostty, or Kitty" + notify-send -u low "✋ Screensaver only runs in Alacritty, Foot, Ghostty, or Kitty" ;; esac done diff --git a/bin/omarchy-menu b/bin/omarchy-menu index cf871ab5..abe01a5e 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -394,8 +394,9 @@ show_install_editor_menu() { } show_install_terminal_menu() { - case $(menu "Install" " Alacritty\n Ghostty\n Kitty") in + case $(menu "Install" " Alacritty\n Foot\n Ghostty\n Kitty") in *Alacritty*) install_terminal "alacritty" ;; + *Foot*) install_terminal "foot" ;; *Ghostty*) install_terminal "ghostty" ;; *Kitty*) install_terminal "kitty" ;; *) show_install_menu ;; diff --git a/bin/omarchy-theme-set b/bin/omarchy-theme-set index 9b664af0..555e6e40 100755 --- a/bin/omarchy-theme-set +++ b/bin/omarchy-theme-set @@ -62,6 +62,7 @@ omarchy-restart-mako omarchy-restart-helix # Change app-specific themes +omarchy-theme-set-foot omarchy-theme-set-gnome omarchy-theme-set-browser omarchy-theme-set-vscode diff --git a/bin/omarchy-theme-set-foot b/bin/omarchy-theme-set-foot new file mode 100755 index 00000000..eb11f9c4 --- /dev/null +++ b/bin/omarchy-theme-set-foot @@ -0,0 +1,27 @@ +#!/bin/bash + +# omarchy:summary=Apply current Omarchy theme colors to running Foot terminals + +foot_theme=~/.config/omarchy/current/theme/foot.ini + +if [[ ! -f $foot_theme ]] || ! pgrep -x foot >/dev/null; then + exit 0 +fi + +foot_osc=$(awk -F= ' + function color(value) { return "#" value } + /^foreground=/ { printf "\033]10;%s\007", color($2) } + /^background=/ { printf "\033]11;%s\007", color($2) } + /^cursor=/ { split($2, parts, " "); printf "\033]12;%s\007", color(parts[2]) } + /^selection-background=/ { printf "\033]17;%s\007", color($2) } + /^selection-foreground=/ { printf "\033]19;%s\007", color($2) } + /^regular[0-7]=/ { split($1, parts, "regular"); printf "\033]4;%d;%s\007", parts[2], color($2) } + /^bright[0-7]=/ { split($1, parts, "bright"); printf "\033]4;%d;%s\007", parts[2] + 8, color($2) } +' "$foot_theme") + +for foot_pid in $(pgrep -x foot); do + for child_pid in $(pgrep -P "$foot_pid"); do + tty=$(readlink "/proc/$child_pid/fd/1" 2>/dev/null) + [[ $tty == /dev/pts/* ]] && printf '%b' "$foot_osc" >"$tty" + done +done diff --git a/config/foot/foot.ini b/config/foot/foot.ini new file mode 100644 index 00000000..9cbd91ec --- /dev/null +++ b/config/foot/foot.ini @@ -0,0 +1,19 @@ +[main] +include=~/.config/omarchy/current/theme/foot.ini +term=xterm-256color +font=JetBrainsMono Nerd Font:size=9 +pad=14x14 +initial-window-mode=windowed +workers=0 + +[scrollback] +lines=10000 + +[cursor] +style=block +blink=no + +[key-bindings] +clipboard-copy=Control+Insert +primary-paste=none +clipboard-paste=Shift+Insert diff --git a/config/hypr/input.conf b/config/hypr/input.conf index 36fb4403..ad15ddaf 100644 --- a/config/hypr/input.conf +++ b/config/hypr/input.conf @@ -41,7 +41,7 @@ input { } # Scroll nicely in the terminal -windowrule = match:class (Alacritty|kitty), scroll_touchpad 1.5 +windowrule = match:class (Alacritty|kitty|foot), scroll_touchpad 1.5 windowrule = match:class com.mitchellh.ghostty, scroll_touchpad 0.2 # Enable touchpad gestures for changing workspaces diff --git a/default/foot/screensaver.ini b/default/foot/screensaver.ini new file mode 100644 index 00000000..7130d069 --- /dev/null +++ b/default/foot/screensaver.ini @@ -0,0 +1,7 @@ +[main] +font=JetBrainsMono Nerd Font:size=18 +pad=0x0 + +[colors-dark] +background=000000 +foreground=ffffff diff --git a/default/hypr/apps/system.conf b/default/hypr/apps/system.conf index 443fb069..6f82aa35 100644 --- a/default/hypr/apps/system.conf +++ b/default/hypr/apps/system.conf @@ -3,7 +3,7 @@ windowrule = float on, match:tag floating-window windowrule = center on, match:tag floating-window windowrule = size 875 600, match:tag floating-window -windowrule = tag +floating-window, match:class (org.omarchy.bluetui|org.omarchy.impala|org.omarchy.wiremix|org.omarchy.btop|org.omarchy.terminal|org.omarchy.bash|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Omarchy|About|TUI.float|imv|mpv) +windowrule = tag +floating-window, match:class (org.omarchy.bluetui|org.omarchy.impala|org.omarchy.wiremix|org.omarchy.btop|org.omarchy.terminal|org.omarchy.bash|org.codeberg.dnkl.foot|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Omarchy|About|TUI.float|imv|mpv) windowrule = tag +floating-window, match:class (xdg-desktop-portal-gtk|sublime_text|DesktopEditors|org.gnome.Nautilus), match:title ^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*) windowrule = float on, match:class org.gnome.Calculator diff --git a/default/hypr/apps/terminals.conf b/default/hypr/apps/terminals.conf index ead08dde..b4940720 100644 --- a/default/hypr/apps/terminals.conf +++ b/default/hypr/apps/terminals.conf @@ -1,4 +1,4 @@ # Define terminal tag to style them uniformly -windowrule = tag +terminal, match:class (Alacritty|kitty|com.mitchellh.ghostty) +windowrule = tag +terminal, match:class (Alacritty|kitty|com.mitchellh.ghostty|foot) windowrule = tag -default-opacity, match:tag terminal windowrule = opacity 0.97 0.9, match:tag terminal diff --git a/default/omarchy-skill/SKILL.md b/default/omarchy-skill/SKILL.md index db09dcd4..5f9d5a7e 100644 --- a/default/omarchy-skill/SKILL.md +++ b/default/omarchy-skill/SKILL.md @@ -3,7 +3,7 @@ name: omarchy description: > REQUIRED for end-user customization of Linux desktop, window manager, or system config. Use when editing ~/.config/hypr/, ~/.config/waybar/, ~/.config/walker/, - ~/.config/alacritty/, ~/.config/kitty/, ~/.config/ghostty/, ~/.config/mako/, + ~/.config/alacritty/, ~/.config/foot/, ~/.config/kitty/, ~/.config/ghostty/, ~/.config/mako/, or ~/.config/omarchy/. Triggers: Hyprland, window rules, animations, keybindings, monitors, gaps, borders, blur, opacity, waybar, walker, terminal config, themes, wallpaper, night light, idle, lock screen, screenshots, layer rules, workspace @@ -24,7 +24,7 @@ It is not for contributing to Omarchy source code. - Editing ANY file in `~/.config/hypr/` (window rules, animations, keybindings, monitors, etc.) - Editing ANY file in `~/.config/waybar/`, `~/.config/walker/`, `~/.config/mako/` -- Editing terminal configs (alacritty, kitty, ghostty) +- Editing terminal configs (alacritty, foot, kitty, ghostty) - Editing ANY file in `~/.config/omarchy/` - Window behavior, animations, opacity, blur, gaps, borders - Layer rules, workspace settings, display/monitor configuration @@ -78,7 +78,7 @@ Omarchy is built on: | **Hyprland** | Wayland compositor/WM | `~/.config/hypr/` | | **Waybar** | Status bar | `~/.config/waybar/` | | **Walker** | App launcher | `~/.config/walker/` | -| **Alacritty/Kitty/Ghostty** | Terminals | `~/.config//` | +| **Alacritty/Foot/Kitty/Ghostty** | Terminals | `~/.config//` | | **Mako** | Notifications | `~/.config/mako/` | | **SwayOSD** | On-screen display | `~/.config/swayosd/` | @@ -163,6 +163,7 @@ Run `omarchy --help` for the full list. The most common groups: ``` ~/.config/alacritty/alacritty.toml +~/.config/foot/foot.ini ~/.config/kitty/kitty.conf ~/.config/ghostty/config ``` diff --git a/default/themed/foot.ini.tpl b/default/themed/foot.ini.tpl new file mode 100644 index 00000000..c56dc610 --- /dev/null +++ b/default/themed/foot.ini.tpl @@ -0,0 +1,25 @@ +[colors-dark] +foreground={{ foreground_strip }} +background={{ background_strip }} +selection-foreground={{ selection_foreground_strip }} +selection-background={{ selection_background_strip }} + +cursor={{ background_strip }} {{ cursor_strip }} + +regular0={{ color0_strip }} +regular1={{ color1_strip }} +regular2={{ color2_strip }} +regular3={{ color3_strip }} +regular4={{ color4_strip }} +regular5={{ color5_strip }} +regular6={{ color6_strip }} +regular7={{ color7_strip }} + +bright0={{ color8_strip }} +bright1={{ color9_strip }} +bright2={{ color10_strip }} +bright3={{ color11_strip }} +bright4={{ color12_strip }} +bright5={{ color13_strip }} +bright6={{ color14_strip }} +bright7={{ color15_strip }} diff --git a/migrations/1778008689.sh b/migrations/1778008689.sh new file mode 100644 index 00000000..dbe97743 --- /dev/null +++ b/migrations/1778008689.sh @@ -0,0 +1,45 @@ +echo "Add Foot terminal config and theme support" + +if [[ ! -f ~/.config/foot/foot.ini ]]; then + mkdir -p ~/.config/foot + cp -Rpf "$OMARCHY_PATH/config/foot/foot.ini" ~/.config/foot/foot.ini +elif ! grep -q "^primary-paste=none" ~/.config/foot/foot.ini; then + sed -i '/^clipboard-copy=Control+Insert/a primary-paste=none' ~/.config/foot/foot.ini +fi + +if [[ -f ~/.config/omarchy/current/theme/foot.ini ]]; then + sed -i 's/^\[colors\]$/[colors-dark]/' ~/.config/omarchy/current/theme/foot.ini +fi + +if [[ ! -f ~/.config/omarchy/current/theme/foot.ini && -f ~/.config/omarchy/current/theme/colors.toml ]]; then + sed_script=$(mktemp) + + while IFS='=' read -r key value; do + key="${key//[\"\' ]/}" + [[ $key && $key != \#* ]] || continue + value="${value#*[\"\']}" + value="${value%%[\"\']*}" + + printf 's|{{ %s }}|%s|g\n' "$key" "$value" + printf 's|{{ %s_strip }}|%s|g\n' "$key" "${value#\#}" + done <~/.config/omarchy/current/theme/colors.toml >"$sed_script" + + sed -f "$sed_script" "$OMARCHY_PATH/default/themed/foot.ini.tpl" >~/.config/omarchy/current/theme/foot.ini + rm "$sed_script" +fi + +if omarchy-cmd-present foot; then + mkdir -p ~/.local/share/applications + rm -f ~/.local/share/applications/org.codeberg.dnkl.foot.desktop + cp -Rpf "$OMARCHY_PATH/applications/foot.desktop" ~/.local/share/applications/ + cp -Rpf "$OMARCHY_PATH/applications/footclient.desktop" ~/.local/share/applications/ + cp -Rpf "$OMARCHY_PATH/applications/foot-server.desktop" ~/.local/share/applications/ +fi + +if [[ -f ~/.config/hypr/input.conf ]]; then + sed -Ei 's/match:class \(Alacritty\|kitty\)/match:class (Alacritty|kitty|foot)/' ~/.config/hypr/input.conf +fi + +if [[ -f ~/.config/hypr/apps/terminals.conf ]]; then + sed -Ei 's/match:class \(Alacritty\|kitty\|com\.mitchellh\.ghostty\)/match:class (Alacritty|kitty|com.mitchellh.ghostty|foot)/' ~/.config/hypr/apps/terminals.conf +fi