argen: add switch to session

This commit is contained in:
2026-06-01 23:24:09 +02:00
parent 90786cef74
commit 85f7da444e
4 changed files with 40 additions and 0 deletions

View File

@@ -150,5 +150,7 @@ for num in 1 2 3 4 5 6 7 8 9; do
"
done
argenctl binding set normal Super+Shift S exec ~/.config/argen/session.sh
# Rules
argenctl rule add float --app-id "my-app"

29
argen/.config/argen/session.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
set -eu
id=$(for name in $(ls ~/.config/argen/sessions/*.sh); do echo $(basename "${name%.sh}"); done | fuzzel -d -p'session> ')
if argenctl context list | grep "^${id}\$"; then
argenctl context switch "${id}"
exit
fi
argenctl context new "$id"
first=$(argenctl output list --json | jq -r '.[0].id')
length=$(argenctl output list --json | jq -r 'length')
for n in $(seq $length); do
current=$(argenctl output list --json | jq -r '.[] | select(.focused).id')
if [ "$current" = "$first" ]; then
break
fi
argenctl output focus next
done
if [ -e ~/.lightmode ]; then
THEME=light
else
THEME=dark
fi
export TERMINAL="footclient -o initial-color-theme=$THEME"
exec sh ~/.config/argen/sessions/"${id}.sh"

View File

@@ -0,0 +1,3 @@
argenctl output focus next
argenctl sh "$TERMINAL -D ~/dotfiles kak"

View File

@@ -0,0 +1,6 @@
argenctl exec librewolf
sleep 1
argenctl output focus next
argenctl exec qutebrowser