by HaoZeke on 6/2/24, 10:55 PM with 30 comments
by chme on 6/3/24, 7:12 AM
Not knowing that foot is a terminal emulator, I assumed that foot is some kind of improved resource manager that allows for a general lesser resource usage.
by tupolef on 6/3/24, 4:26 AM
I do the same thing with URxvt as a systemd daemon, Tmux as a transient service with systemd-run from .bashrc, and a script in i3wm to run URxvtd client or hide/get the window.
The way I use to run Tmux from a transient service locally and in ssh with the same .bashrc is nice I think. Tmux will survive the terminal and even if I close my session and come back to it:
#!/usr/bin/env bash
# ~/.bashrc: sourced by bash(1) for non-login shells.
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return ;;
esac
chmod 700 ~/.bashrc.d
chmod 600 ~/.bashrc ~/.bashrc.d/*
# check if we are already in a Tmux session and not in ssh then open/attach the default one
if [[ ! "${TERM}" == "tmux"* ]] && [[ -z "${TMUX}" ]] && [[ -z "${SSH_CONNECTION}" ]] && command -v tmux 1> /dev/null; then
# attach or start the local default Tmux session
if systemctl --quiet $([[ $(id -u) != 0 ]]; echo "--user") is-active tmux-local-$(id -un).scope; then
tmux -L local-$(id -un) attach-session -t local-$(id -un) ; exit
fi
systemd-run -q --unit tmux-local-$(id -un) --scope $([[ $(id -u) != 0 ]] && echo "--user") tmux -L local-$(id -un) new-session -s local-$(id -un) ; exit
elif [[ -z "${TMUX}" ]] && [[ -n "${SSH_CONNECTION}" ]] && command -v tmux 1> /dev/null; then
# attach or start the ssh default Tmux session
if systemctl --quiet $([[ $(id -u) != 0 ]]; echo "--user") is-active tmux-ssh-$(id -un).scope; then
tmux -L ssh-$(id -un) attach-session -t ssh-$(id -un) ; exit
fi
systemd-run -q --unit tmux-ssh-$(id -un) --scope $([[ $(id -u) != 0 ]] && echo "--user") tmux -L ssh-$(id -un) new-session -s ssh-$(id -un) && exit || echo 'Tmux Systemd unit failed/exited'
fi
# if Tmux is not installed or if we are inside a Tmux session continue the sourcing
for file in ~/.bashrc.d/*.bashrc;
do
source "${file}"
done
by emmanueloga_ on 6/3/24, 1:17 AM
—
1: https://wiki.gentoo.org/wiki/Foot#Server_mode_configuration
by FrostKiwi on 6/3/24, 2:57 AM
I ended up dropping it for the same reason I dropped emacs server. There are rare edge cases which causes the server to hang and thus taking down not just one instance of your work, but all of it. Losing the resilience of multiple processes is not worth the RAM it saves, not on modern hardware.
by NewJazz on 6/3/24, 5:26 AM
by yjftsjthsd-h on 6/3/24, 2:55 AM
> Figure 1: Snapshot of memory consumption (from btop), clients take around 10x less memory
By all means use a server/clients approach if it reduces per-process memory, but it's probably not as bad as it looks, because AFAIK the actual executable only gets loaded once and then reused. So each process has its own data in RAM, but the executable/binary only gets loaded the once.
Also, if this is a problem maybe revisit your choice of terminal? It's annoyingly hard to get a total (or more likely I just don't know how to get it), but every number I can seem to find says alacritty is only using <2MB total on my box, so your 27M max on foot looks... weird. Like, I can run a full standalone terminal in the size of your client; I appreciate that it might have features that make it worthwhile, but consider the tradeoffs?
by MuffinFlavored on 6/3/24, 3:59 PM
https://codeberg.org/dnkl/foot
For those out of the loop
by paulcarroty on 6/3/24, 4:25 PM
by nurettin on 6/3/24, 4:40 AM
by sed3 on 6/3/24, 6:16 AM
Konsole can switch color theme with simple dbus message.
For the rest, I use tmux sessions and some scripts. When I restart computer, all terminal windows with remote ssh sessions get restored.
I do not need any modifications on server (except tmux or screen package).
by Zambyte on 6/3/24, 1:01 PM