47 lines
1.2 KiB
Bash
Executable file
47 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
modes="std
|
|
single
|
|
single-sec
|
|
zellij"
|
|
|
|
portalo_mode_std () {
|
|
echo "Loading portalo standard screen layout"
|
|
yadm config --unset-all local.class monitor-single
|
|
yadm config --unset-all local.class monitor-single-sec
|
|
}
|
|
|
|
portalo_mode_single () {
|
|
echo "Loading portalo single screen layout"
|
|
yadm config --unset-all local.class monitor-single-sec
|
|
yadm config --add local.class monitor-single
|
|
}
|
|
|
|
portalo_mode_single_sec () {
|
|
echo "Loading portalo single screen layout on secondary screen"
|
|
yadm config --unset-all local.class monitor-single
|
|
yadm config --add local.class monitor-single-sec
|
|
}
|
|
|
|
portalo_mode_zellij () {
|
|
layout_dir="$HOME/.config/zellij/layouts"
|
|
layouts=$(\ls -1 "$layout_dir")
|
|
layout=$(echo "$layouts" | $DMENU -p "layout")
|
|
if [ -n "$layout" ]; then
|
|
$TERMINAL -e zellij --layout="$layout_dir/$layout"
|
|
fi
|
|
}
|
|
|
|
if [ -z "$1" ]; then
|
|
mode=$(echo "$modes" | $DMENU -p "mode")
|
|
else
|
|
mode=$1
|
|
fi
|
|
|
|
case $mode in
|
|
"std") portalo_mode_std ;;
|
|
"single") portalo_mode_single ;;
|
|
"single-sec") portalo_mode_single_sec ;;
|
|
"zellij") portalo_mode_zellij ;;
|
|
*) echo "'$mode' is not a valid mode (single, std)" ;;
|
|
esac
|