From f5eaa44d854d0844efa874912f0cdf8cc5907e24 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sun, 23 Jun 2024 19:30:49 +0200 Subject: Add session script --- session | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 session (limited to 'session') 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 " + echo "Example: switch_session.sh bspwm" + exit 1 +fi -- cgit v1.2.3