From e0f22f25cfe2171f2ee044d3ad23e6ca13e45e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Mon, 29 Sep 2025 22:55:30 +0200 Subject: [PATCH] alias: tni and tai as interactive versions of tn i ta, .profile: add startx as alternative to sx --- shell/.config/shellconfig/aliases.sh | 19 ++++++++++++++++++- shell/.profile | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/shell/.config/shellconfig/aliases.sh b/shell/.config/shellconfig/aliases.sh index 0245567..19e0827 100644 --- a/shell/.config/shellconfig/aliases.sh +++ b/shell/.config/shellconfig/aliases.sh @@ -16,7 +16,17 @@ tn() { if [ $# -eq 0 ]; then tmux new else - tmux new -s "$@" + tmux new -A -s "$@" + fi +} + +tni() { + DIR=$(zoxide query -l | vis-menu -p 'Dir:' -l 10) + if [ -n "$DIR" ]; then + NAME=$(echo | vis-menu -p 'Session name:' $(basename $DIR)) + if [ -n "$DIR" ]; then + tmux new -A -s "$NAME" -c "$DIR" + fi fi } @@ -28,6 +38,13 @@ ta() { fi } +tai() { + NAME=$(tmux ls | vis-menu -p 'Session:' -l 10 | cut -d: -f1) + if [ -n "$NAME" ]; then + tmux attach -t "$NAME" + fi +} + vf() { vis "+fzf-files auto-files '$1'" } diff --git a/shell/.profile b/shell/.profile index 06bbf53..de4fc30 100644 --- a/shell/.profile +++ b/shell/.profile @@ -35,5 +35,7 @@ if [[ -z "$DISPLAY" && -z "$WAYLAND_DISPLAY" && "$XDG_VTNR" -eq 1 ]]; then exec river elif which /usr/bin/sx > /dev/null; then exec /usr/bin/sx ~/.xsession + elif which /usr/bin/startx > /dev/null; then + exec /usr/bin/startx fi fi