From 1ab7f02535f687421333874711832f999566ec51 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Tue, 20 Dec 2022 15:02:57 -0500 Subject: [PATCH] .bashrc: Add logic to automatically start sway --- bash/.bashrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bash/.bashrc b/bash/.bashrc index 7e647f1..e19befe 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -8,6 +8,12 @@ alias ls='ls --color=auto' PS1='[\u@\h \W]\$ ' +# Default config +export MACHINE_START_SWAY=false # Whether to start Sway from bash + +# Source machine-specific config +[[ -f ~/.machine_config ]] && source ~/.machine_config + # Execute tmux in Alacritty if [[ "$TERM" == "alacritty" || "$TERM_PROGRAM" == "WezTerm" ]]; then exec tmux @@ -113,3 +119,4 @@ export SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh # Desktop stuff (Sway) export QT_QPA_PLATFORMTHEME=qt5ct export GTK_THEME=Gruvbox-Material-Dark-HIDPI +$MACHINE_START_SWAY && [[ -z "$DISPLAY" && $(tty) == /dev/tty1 ]] && exec sway