aboutsummaryrefslogtreecommitdiff
path: root/unix/sys/session_manager.sh
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2025-09-24 05:25:39 +0200
committersrdusr <trevorgray@srdusr.com>2025-09-24 05:25:39 +0200
commita1627ac743289e768b138f1a60753a62e0869cc4 (patch)
tree92ab373442943f621bb26b3b284bb1da90e2923a /unix/sys/session_manager.sh
parentfdb0eb921205c34fb6ff5728727a097767ffae5a (diff)
downloaddotfiles-a1627ac743289e768b138f1a60753a62e0869cc4.tar.gz
dotfiles-a1627ac743289e768b138f1a60753a62e0869cc4.zip
Update/Overhaul
Diffstat (limited to 'unix/sys/session_manager.sh')
-rwxr-xr-xunix/sys/session_manager.sh72
1 files changed, 0 insertions, 72 deletions
diff --git a/unix/sys/session_manager.sh b/unix/sys/session_manager.sh
deleted file mode 100755
index b6a6b03..0000000
--- a/unix/sys/session_manager.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/sh
-
-cd ~
-
-# Default session to be executed
-unset DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
-
-session=""
-
-# Function to display and start the selected session
-display() {
- # Default list of sessions in priority order
- default_sessions=("Hyprland" "bspwm" "sway")
-
- # Check conditions and set session command
- if [ "$DISPLAY" = "" ] && [ "$XDG_VTNR" -eq 1 ]; then
- if [ -f ~/.session ]; then
- session=$(cat ~/.session)
- rm ~/.session # Remove the session file after reading
- fi
-
- if [ "$session" != "" ]; then
- case "$session" in
- bspwm )
- export XDG_SESSION_TYPE="x11"
- session="startx /usr/bin/bspwm"
- ;;
- Hyprland | sway)
- session="dbus-launch --sh-syntax --exit-with-session $session"
- ;;
- *)
- echo "Session $session is not supported."
- session=""
- ;;
- esac
- else
- # Iterate through default sessions to find a suitable one
- for wm in "${default_sessions[@]}"; do
- if command -v "$wm" >/dev/null 2>&1; then
- case "$wm" in
- bspwm )
- export XDG_SESSION_TYPE="x11"
- session="startx /usr/bin/$wm"
- break
- ;;
- Hyprland | sway)
- session="dbus-launch --sh-syntax --exit-with-session $wm >/dev/null 2>&1 && exit"
- #show_animation.sh
- clear
- break
- ;;
- esac
- fi
- done
- fi
-
- # Execute the session command if session is set
- if [ "$session" != "" ]; then
- #echo "Starting session: $session"
- eval "$session"
- else
- echo "No suitable window manager found or conditions not met."
- fi
- fi
-}
-
-# Main function
-main() {
- display
-}
-
-main "$@"