Files
AstroVim_Config/.config/hypr/scripts/workspacePLUS.sh
2024-10-21 16:52:57 +07:00

21 lines
650 B
Bash
Executable File

#!/bin/bash
current_monitor=$(hyprctl activewindow | grep 'monitor' | awk '{print $2}')
export PRIMARY_MONITOR_WORKSPACE=$((PRIMARY_MONITOR_WORKSPACE+2))
export SECONDARY_MONITOR_WORKSPACE=$((SECONDARY_MONITOR_WORKSPACE+2))
if [ "$PRIMARY_MONITOR_WORKSPACE" -lt 1 ]; then
export PRIMARY_MONITOR_WORKSPACE=1
exit 1
elif [ "$SECONDARY_MONITOR_WORKSPACE" -gt 10 ]; then
export SECONDARY_MONITOR_WORKSPACE=10
exit 1
fi
hyprctl dispatch focusmonitor 0
hyprctl dispatch workspace $PRIMARY_MONITOR_WORKSPACE
hyprctl dispatch focusmonitor 1
hyprctl dispatch workspace $SECONDARY_MONITOR_WORKSPACE
hyprctl dispatch focusmonitor $current_monitor