⚙️ config(hypr): use new relative monitor workspace movement

removed awesome_workspace script as well
This commit is contained in:
Sergio Laín 2024-05-11 01:09:25 +02:00
parent eedde78e8a
commit dbb91c9b97
No known key found for this signature in database
GPG key ID: FB00AF7015FFE76B
2 changed files with 27 additions and 59 deletions

View file

@ -92,37 +92,37 @@ bind = SUPER, C, exec, hyprctl dispatch centerwindow 1
# Workspaces # Workspaces
# Focusing other workspaces # Focusing other workspaces
bind = SUPER, 1, exec, $workspace 1 switch bind = SUPER, 1, workspace, r~1
bind = SUPER, 2, exec, $workspace 2 switch bind = SUPER, 2, workspace, r~2
bind = SUPER, 3, exec, $workspace 3 switch bind = SUPER, 3, workspace, r~3
bind = SUPER, 4, exec, $workspace 4 switch bind = SUPER, 4, workspace, r~4
bind = SUPER, 5, exec, $workspace 5 switch bind = SUPER, 5, workspace, r~5
bind = SUPER, 6, exec, $workspace 6 switch bind = SUPER, 6, workspace, r~6
bind = SUPER, 7, exec, $workspace 7 switch bind = SUPER, 7, workspace, r~7
bind = SUPER, 8, exec, $workspace 8 switch bind = SUPER, 8, workspace, r~8
bind = SUPER, 9, exec, $workspace 9 switch bind = SUPER, 9, workspace, r~9
# Moving windows to other workspaces # Moving windows to other workspaces
bind = SUPERSHIFT, 1, exec, $workspace 1 move bind = SUPERSHIFT, 1, movetoworkspace, r~1
bind = SUPERSHIFT, 2, exec, $workspace 2 move bind = SUPERSHIFT, 2, movetoworkspace, r~2
bind = SUPERSHIFT, 3, exec, $workspace 3 move bind = SUPERSHIFT, 3, movetoworkspace, r~3
bind = SUPERSHIFT, 4, exec, $workspace 4 move bind = SUPERSHIFT, 4, movetoworkspace, r~4
bind = SUPERSHIFT, 5, exec, $workspace 5 move bind = SUPERSHIFT, 5, movetoworkspace, r~5
bind = SUPERSHIFT, 6, exec, $workspace 6 move bind = SUPERSHIFT, 6, movetoworkspace, r~6
bind = SUPERSHIFT, 7, exec, $workspace 7 move bind = SUPERSHIFT, 7, movetoworkspace, r~7
bind = SUPERSHIFT, 8, exec, $workspace 8 move bind = SUPERSHIFT, 8, movetoworkspace, r~8
bind = SUPERSHIFT, 9, exec, $workspace 9 move bind = SUPERSHIFT, 9, movetoworkspace, r~9
# Moving windows to other workspaces (silent) # Moving windows to other workspaces (silent)
bind = SUPERALT, 1, exec, $workspace 1 silent bind = SUPERALT, 1, movetoworkspacesilent, r~1
bind = SUPERALT, 2, exec, $workspace 2 silent bind = SUPERALT, 2, movetoworkspacesilent, r~2
bind = SUPERALT, 3, exec, $workspace 3 silent bind = SUPERALT, 3, movetoworkspacesilent, r~3
bind = SUPERALT, 4, exec, $workspace 4 silent bind = SUPERALT, 4, movetoworkspacesilent, r~4
bind = SUPERALT, 5, exec, $workspace 5 silent bind = SUPERALT, 5, movetoworkspacesilent, r~5
bind = SUPERALT, 6, exec, $workspace 6 silent bind = SUPERALT, 6, movetoworkspacesilent, r~6
bind = SUPERALT, 7, exec, $workspace 7 silent bind = SUPERALT, 7, movetoworkspacesilent, r~7
bind = SUPERALT, 8, exec, $workspace 8 silent bind = SUPERALT, 8, movetoworkspacesilent, r~8
bind = SUPERALT, 9, exec, $workspace 9 silent bind = SUPERALT, 9, movetoworkspacesilent, r~9
# Moving to other workspace with mouse control # Moving to other workspace with mouse control
bind = SUPER, mouse_down, workspace, m-1 bind = SUPER, mouse_down, workspace, m-1

View file

@ -1,32 +0,0 @@
#!/usr/bin/bash
monitors=($(hyprctl monitors -j | jq -r '.[].id'))
ws_per_monitor=9
monitor=$(hyprctl activeworkspace -j | jq -r '.monitorID')
calculate_index() {
local index=$(($1 + $2 * ws_per_monitor))
echo $index
}
move_workspace() {
local index=$1
local action=$2
if [[ $action == "move" ]]; then
hyprctl dispatch movetoworkspace $index
elif [[ $action == "silent" ]]; then
hyprctl dispatch movetoworkspacesilent $index
else
hyprctl dispatch workspace $index
fi
}
for ((i = 0; i < ${#monitors[@]}; i++)); do
if [[ $monitor == "${monitors[i]}" ]]; then
index=$(calculate_index $1 $i)
move_workspace $index $2
break
fi
done