Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save icyleaf/64956c7a87844e748a28b9e58290aaa0 to your computer and use it in GitHub Desktop.
Save icyleaf/64956c7a87844e748a28b9e58290aaa0 to your computer and use it in GitHub Desktop.
exec, $scrPath/workspace-switch.sh switch/movie/movesilent 1
#!/bin/bash
operation=$1
workspace=$2
monitor_id=$(hyprctl activeworkspace | grep "monitorID" | awk '{print $2}')
workspace_id=$(($monitor_id * 10 + $workspace))
echo "Final Operation: $operation to $workspace_id"
if [[ $operation == "switch" ]]; then
hyprctl dispatch moveworkspacetomonitor $workspace_id $monitor_id;
hyprctl dispatch workspace $workspace_id;
fi
if [[ $operation == "movesilent" ]]; then
hyprctl dispatch moveworkspacetomonitor $workspace_id $monitor_id;
hyprctl dispatch movetoworkspacesilent $workspace_id;
fi
if [[ $operation == "move" ]]; then
hyprctl dispatch moveworkspacetomonitor $workspace_id $monitor_id;
hyprctl dispatch movetoworkspace $workspace_id;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment