aboutsummaryrefslogtreecommitdiff
path: root/session
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2024-06-23 19:30:49 +0200
committersrdusr <trevorgray@srdusr.com>2024-06-23 19:30:49 +0200
commitf5eaa44d854d0844efa874912f0cdf8cc5907e24 (patch)
treeebefb8dcb760856a39f2ccd8aeff4664b391e227 /session
parent6710ea003bcf04749761f3774e842278edc92212 (diff)
downloaddotfiles-f5eaa44d854d0844efa874912f0cdf8cc5907e24.tar.gz
dotfiles-f5eaa44d854d0844efa874912f0cdf8cc5907e24.zip
Add session script
Diffstat (limited to 'session')
-rwxr-xr-xsession21
1 files changed, 21 insertions, 0 deletions
diff --git a/session b/session
new file mode 100755
index 0000000..c798403
--- /dev/null
+++ b/session
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Check if the desired session is provided as an argument
+if [ "$1" ]; then
+ case "$1" in
+ bspwm | sway | Hyprland)
+ echo "$1" >~/.session
+ echo "Session choice set to: $1"
+ ;;
+ *)
+ echo "Unsupported session: $1"
+ ;;
+ esac
+
+ # Kill the current X session or logout the user
+ pkill -KILL -u "$USER"
+else
+ echo "Usage: switch_session.sh <session_name>"
+ echo "Example: switch_session.sh bspwm"
+ exit 1
+fi