custom-hypr - up to date
This commit is contained in:
@@ -7,7 +7,6 @@ window_info=$(hyprctl activewindow)
|
||||
window_state=$(echo "$window_info" | grep 'fullscreen:' | awk '{print $2}')
|
||||
|
||||
|
||||
|
||||
# NOTE: Di chuyển cửa sổ nếu vị trí X vượt qua ngưỡng
|
||||
if [ $window_state -eq 1 ]; then
|
||||
hyprctl dispatch focusmonitor 1
|
||||
@@ -15,4 +14,5 @@ if [ $window_state -eq 1 ]; then
|
||||
fi
|
||||
|
||||
hyprctl dispatch movefocus r
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -23,7 +23,6 @@ move(){
|
||||
|
||||
hyprctl --batch "
|
||||
dispatch movetoworkspace $((window_at_workspace-1)) ;
|
||||
dispatch focusmonitor 0 ;
|
||||
dispatch workspace $((current_workspace-2)) ;
|
||||
dispatch focusmonitor 1
|
||||
"
|
||||
|
||||
@@ -15,14 +15,9 @@ window_width=$(echo "$window_info" | grep 'size:' | awk '{print $2}' | cut -d','
|
||||
hyprctl dispatch fullscreenstate 0 # minimize trước khi di chuyển
|
||||
|
||||
move(){
|
||||
# hyprctl dispatch movetoworkspace $((window_at_workspace+1)) \
|
||||
# && hyprctl dispatch focusmonitor 1 \
|
||||
# && hyprctl dispatch workspace $((current_workspace+2)) \
|
||||
# && hyprctl dispatch focusmonitor 0
|
||||
|
||||
hyprctl --batch "
|
||||
dispatch movetoworkspace $((window_at_workspace+1)) ;
|
||||
dispatch focusmonitor 1 ;
|
||||
dispatch workspace $((current_workspace+2)) ;
|
||||
dispatch focusmonitor 0
|
||||
"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Extract workspace ID from the output of hyprctl activewindow
|
||||
current_monitor=$(hyprctl activeworkspace | grep 'monitorID' | awk '{print $2}')
|
||||
current_workspace=$(hyprctl activeworkspace | grep 'workspace' | awk '{print $3}')
|
||||
|
||||
# Determine the second workspace based on whether the current workspace is even or odd
|
||||
@@ -10,14 +9,8 @@ else
|
||||
second_workspace=$((current_workspace + 1))
|
||||
fi
|
||||
|
||||
# Assign primary and secondary monitor workspaces based on the current workspace
|
||||
if [ $((current_workspace % 2)) -eq 0 ]; then
|
||||
primary_monitor_workspace=$((second_workspace - 2)) # left
|
||||
secondary_monitor_workspace=$((current_workspace - 2)) # right
|
||||
else
|
||||
primary_monitor_workspace=$((current_workspace - 2))
|
||||
secondary_monitor_workspace=$((second_workspace - 2))
|
||||
fi
|
||||
primary_monitor_workspace=$((current_workspace - 2))
|
||||
secondary_monitor_workspace=$((second_workspace - 2))
|
||||
|
||||
# Check if primary_monitor_workspace is less than or equal to 0
|
||||
# or if secondary_monitor_workspace is greater than or equal to 11
|
||||
@@ -25,18 +18,8 @@ if [ "$primary_monitor_workspace" -le 0 ] || [ "$secondary_monitor_workspace" -g
|
||||
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
|
||||
|
||||
hyprctl --batch "
|
||||
dispatch focusmonitor 0 ;
|
||||
dispatch workspace $primary_monitor_workspace ;
|
||||
dispatch dispatch focusmonitor 1 ;
|
||||
dispatch workspace $secondary_monitor_workspace ;
|
||||
dispatch focusmonitor $current_monitor
|
||||
dispatch workspace $primary_monitor_workspace ;
|
||||
"
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -5,20 +5,17 @@ current_monitor=$(hyprctl activeworkspace | grep 'monitorID' | awk '{print $2}')
|
||||
current_workspace=$(hyprctl activeworkspace | grep 'workspace' | awk '{print $3}')
|
||||
|
||||
# Determine the second workspace based on whether the current workspace is even or odd
|
||||
echo $current_workspace
|
||||
echo $current_monitor
|
||||
|
||||
if [ $((current_workspace % 2)) -eq 0 ]; then
|
||||
second_workspace=$((current_workspace - 1))
|
||||
else
|
||||
second_workspace=$((current_workspace + 1))
|
||||
fi
|
||||
|
||||
# Assign primary and secondary monitor workspaces based on the current workspace
|
||||
if [ $((current_workspace % 2)) -eq 0 ]; then
|
||||
primary_monitor_workspace=$((second_workspace + 2)) # left
|
||||
secondary_monitor_workspace=$((current_workspace + 2)) # right
|
||||
else
|
||||
primary_monitor_workspace=$((current_workspace + 2))
|
||||
secondary_monitor_workspace=$((second_workspace + 2))
|
||||
fi
|
||||
primary_monitor_workspace=$((current_workspace + 2)) # 1 + 2 =3
|
||||
secondary_monitor_workspace=$((second_workspace + 2)) # 2 + 2 =4
|
||||
|
||||
# Check if primary_monitor_workspace is less than or equal to 0
|
||||
# or if secondary_monitor_workspace is greater than or equal to 11
|
||||
@@ -26,18 +23,9 @@ if [ "$primary_monitor_workspace" -le 0 ] || [ "$secondary_monitor_workspace" -g
|
||||
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
|
||||
|
||||
|
||||
hyprctl --batch "
|
||||
dispatch focusmonitor 0 ;
|
||||
dispatch workspace $primary_monitor_workspace ;
|
||||
dispatch dispatch focusmonitor 1 ;
|
||||
dispatch workspace $secondary_monitor_workspace ;
|
||||
dispatch focusmonitor $current_monitor
|
||||
dispatch workspace $primary_monitor_workspace ;
|
||||
"
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user