From c9345f91409494eaede8b0810b9eec435c7ae723 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Tue, 15 Jul 2025 22:01:47 +0200 Subject: [PATCH] Added profile script for start Sway session from tty --- profile/.profile.d/dotfiles.sh | 0 profile/.profile.d/editor.sh | 0 profile/.profile.d/ghcup.sh | 0 profile/.profile.d/go.sh | 0 profile/.profile.d/graalvm.sh | 0 profile/.profile.d/help.sh | 0 profile/.profile.d/homebrew.sh | 0 profile/.profile.d/java.sh | 0 profile/.profile.d/jmeter.sh | 0 profile/.profile.d/rust.sh | 0 profile/.profile.d/ssh-agent.sh | 3 ++- profile/.profile.d/sway-startup.sh | 9 +++++++++ profile/.profile.d/venv.sh | 0 13 files changed, 11 insertions(+), 1 deletion(-) mode change 100644 => 100755 profile/.profile.d/dotfiles.sh mode change 100644 => 100755 profile/.profile.d/editor.sh mode change 100644 => 100755 profile/.profile.d/ghcup.sh mode change 100644 => 100755 profile/.profile.d/go.sh mode change 100644 => 100755 profile/.profile.d/graalvm.sh mode change 100644 => 100755 profile/.profile.d/help.sh mode change 100644 => 100755 profile/.profile.d/homebrew.sh mode change 100644 => 100755 profile/.profile.d/java.sh mode change 100644 => 100755 profile/.profile.d/jmeter.sh mode change 100644 => 100755 profile/.profile.d/rust.sh mode change 100644 => 100755 profile/.profile.d/ssh-agent.sh create mode 100755 profile/.profile.d/sway-startup.sh mode change 100644 => 100755 profile/.profile.d/venv.sh diff --git a/profile/.profile.d/dotfiles.sh b/profile/.profile.d/dotfiles.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/editor.sh b/profile/.profile.d/editor.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/ghcup.sh b/profile/.profile.d/ghcup.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/go.sh b/profile/.profile.d/go.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/graalvm.sh b/profile/.profile.d/graalvm.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/help.sh b/profile/.profile.d/help.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/homebrew.sh b/profile/.profile.d/homebrew.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/java.sh b/profile/.profile.d/java.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/jmeter.sh b/profile/.profile.d/jmeter.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/rust.sh b/profile/.profile.d/rust.sh old mode 100644 new mode 100755 diff --git a/profile/.profile.d/ssh-agent.sh b/profile/.profile.d/ssh-agent.sh old mode 100644 new mode 100755 index 6b629a7..4185c43 --- a/profile/.profile.d/ssh-agent.sh +++ b/profile/.profile.d/ssh-agent.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#!/usr/bin/env zsh + # This script sets up ssh-agent and gpg-agent differently for WSL and Linux Mint. # On WSL, it uses keychain to start agents. # On Linux Mint (or other Linux), it assumes gnome-keyring manages agents automatically. diff --git a/profile/.profile.d/sway-startup.sh b/profile/.profile.d/sway-startup.sh new file mode 100755 index 0000000..a68fd33 --- /dev/null +++ b/profile/.profile.d/sway-startup.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then + if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then + exec sway + else + exec dbus-launch sway + fi +fi diff --git a/profile/.profile.d/venv.sh b/profile/.profile.d/venv.sh old mode 100644 new mode 100755