From 9b1f96ba8175a781771cacbcdb71a31987fbafc3 Mon Sep 17 00:00:00 2001 From: Smoorg Date: Tue, 9 Jun 2026 13:36:55 +0200 Subject: [PATCH] gemini & tmux setup separated into functions --- add_user.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/add_user.sh b/add_user.sh index d5bc041..0d91959 100755 --- a/add_user.sh +++ b/add_user.sh @@ -38,8 +38,9 @@ mkdir -p /home/$LOGIN/.config/weechat/ cp /root/helpers/irc.conf /home/$LOGIN/.config/weechat -mkdir -p /home/$LOGIN/.config/tmux -cat << EOF > /home/$LOGIN/.config/tmux/tmux.conf +setup_tmux () { + mkdir -p /home/"$LOGIN"/.config/tmux + cat << EOF > /home/"$LOGIN"/.config/tmux/tmux.conf set -g mouse on setw -g mode-keys vi bind -n F1 select-window -t 0 @@ -57,8 +58,23 @@ if-shell "tmux has-session -t main 2>/dev/null" "detach" \ set-hook -g client-attached "send-keys -t main:2 '/usr/local/bin/tylda-motd.sh' C-m" EOF +} -cat << EOF > /home/$LOGIN/.profile +setup_gemini () { + gmi="/home/$LOGIN/public_gemini/" + mkdir -p "$gmi" + ln -s "$gmi" "/srv/gemini/~$LOGIN" + + cat < "$gmi/index.gmi" +# $LOGIN +EOF +} + +setup_neomutt +setup_tmux +setup_gemini + +cat << EOF > "/home/$LOGIN/.profile" if [ -z "\$TMUX" ]; then exec tmux attach -t main || exec tmux new -s main fi @@ -74,16 +90,6 @@ echo "+cpu +memory" > "$CG_ROOT/cgroup.subtree_control" 2>/dev/null || true USER_CG="$CG_ROOT/$LOGIN" mkdir "$USER_CG" -# gemini -gmi="/home/$LOGIN/public_gemini/" -mkdir -p $gmi -ln -s $gmi /srv/gemini/~$LOGIN - -cat < $gmi/index.gmi -# $LOGIN -EOF -# end gemini - mkdir -p /home/$LOGIN/.ssh mkdir -p /home/$LOGIN/.gnupg touch /home/$LOGIN/public_html/.webring