refactor: hypr

This commit is contained in:
2026-03-19 02:15:30 +03:00
parent b54b5c823f
commit b467bd07a0
4 changed files with 156 additions and 30 deletions

View File

@@ -59,7 +59,7 @@ env = HYPRCURSOR_SIZE,24
general { general {
gaps_in = 15 gaps_in = 15
gaps_out = 25 gaps_out = 30
border_size = 1 border_size = 1
col.active_border = rgba(E96375ff) rgba(9E2238ff) 45deg col.active_border = rgba(E96375ff) rgba(9E2238ff) 45deg
col.inactive_border = rgba(4B535Bff) # rgba(595959aa) col.inactive_border = rgba(4B535Bff) # rgba(595959aa)
@@ -139,7 +139,7 @@ animations {
animation = fadeOut, 1, 1.46, almostLinear animation = fadeOut, 1, 1.46, almostLinear
animation = fade, 1, 3.03, quick animation = fade, 1, 3.03, quick
animation = layers, 1, 3.81, easeOutQuint animation = layers, 1, 3.81, easeOutQuint
animation = layersIn, 1, 4, easeOutQuint, fade animation = layersIn, 1, 3, easeOutQuint, fade
animation = layersOut, 1, 1.5, linear, fade animation = layersOut, 1, 1.5, linear, fade
animation = fadeLayersIn, 1, 1.79, almostLinear animation = fadeLayersIn, 1, 1.79, almostLinear
animation = fadeLayersOut, 1, 1.39, almostLinear animation = fadeLayersOut, 1, 1.39, almostLinear
@@ -151,9 +151,9 @@ animations {
animation = layers, 1, 7, default, slide animation = layers, 1, 7, default, slide
} }
workspace = 10, monitor:eDP-1 workspace = 10, monitor:HDMI-A-1
workspace = 11, monitor:eDP-1 workspace = 11, monitor:HDMI-A-1
workspace = 12, monitor:eDP-1 workspace = 12, monitor:HDMI-A-1
workspace = 1, monitor:HDMI-A-1 workspace = 1, monitor:HDMI-A-1
workspace = 2, monitor:HDMI-A-1 workspace = 2, monitor:HDMI-A-1
workspace = 3, monitor:HDMI-A-1 workspace = 3, monitor:HDMI-A-1
@@ -166,6 +166,8 @@ workspace = 9, monitor:HDMI-A-1
workspace = special:magic workspace = special:magic
workspace = special:dungeon workspace = special:dungeon
workspace = r[13-255], animation:none, on-created-empty:hyprctl dispatch workspace previous
dwindle { dwindle {
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # You probably want this preserve_split = true # You probably want this
@@ -281,6 +283,9 @@ bind = $mainMod, N, exec, $notificationCenter
# Open floating terminal # Open floating terminal
bind = $mainMod SHIFT, Return, exec, $fastTerminal --class kitty-float bind = $mainMod SHIFT, Return, exec, $fastTerminal --class kitty-float
# Open btop
bind = CTRL SHIFT, Escape, exec, kitty --class kitty-float-large btop
# Open bluetooth # Open bluetooth
bind = $mainMod, F3, exec, $fastTerminal --class kitty-float bluetui bind = $mainMod, F3, exec, $fastTerminal --class kitty-float bluetui
@@ -301,6 +306,7 @@ bind = $mainMod, S, togglefloating,
bind = $mainMod, T, settiled, bind = $mainMod, T, settiled,
bind = $mainMod, F, fullscreen, bind = $mainMod, F, fullscreen,
bind = $mainMod CTRL, P, pin bind = $mainMod CTRL, P, pin
bind = $mainMod CTRL, S, pseudo
# Bring to top # Bring to top
bind = $mainMod, Z, bringactivetotop bind = $mainMod, Z, bringactivetotop
@@ -339,18 +345,18 @@ bindr = $mainMod, minus, workspace, 11
bindr = $mainMod, equal, workspace, 12 bindr = $mainMod, equal, workspace, 12
# Switch to workspace and send it to another monitor # Switch to workspace and send it to another monitor
bindo = $mainMod, 1, exec, hyprctl dispatch workspace 1 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 1, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 1
bindo = $mainMod, 2, exec, hyprctl dispatch workspace 2 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 2, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 2
bindo = $mainMod, 3, exec, hyprctl dispatch workspace 3 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 3, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 3
bindo = $mainMod, 4, exec, hyprctl dispatch workspace 4 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 4, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 4
bindo = $mainMod, 5, exec, hyprctl dispatch workspace 5 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 5, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 5
bindo = $mainMod, 6, exec, hyprctl dispatch workspace 6 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 6, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 6
bindo = $mainMod, 7, exec, hyprctl dispatch workspace 7 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 7, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 7
bindo = $mainMod, 8, exec, hyprctl dispatch workspace 8 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 8, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 8
bindo = $mainMod, 9, exec, hyprctl dispatch workspace 9 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 9, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 9
bindo = $mainMod, 0, exec, hyprctl dispatch workspace 10 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, 0, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 10
bindo = $mainMod, minus, exec, hyprctl dispatch workspace 11 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, minus, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 11
bindo = $mainMod, equal, exec, hyprctl dispatch workspace 12 && hyprctl dispatch movecurrentworkspacetomonitor +1 bindo = $mainMod, equal, exec, ~/.config/hypr/scripts/focus_workspace_with_monitor_swap.sh 12
# Move active window to a workspace with mainMod + SHIFT + [0-9] # Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1 bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
@@ -584,6 +590,23 @@ windowrule {
match:class = ^(kitty-float)$ match:class = ^(kitty-float)$
} }
# Floating large kitty
windowrule {
name = windowrule-21
float = on
size = 1200 800
center = on
match:class = ^(kitty-float-large)$
}
# Floating large kitty
windowrule {
name = waydroid
float = on
size = 520 960
center = on
match:class = ^(Waydroid)$
}
windowrule { windowrule {
name = windowrule-3 name = windowrule-3
@@ -750,7 +773,6 @@ layerrule {
# Adjustments for certain workspaces # Adjustments for certain workspaces
workspace = special:magic, gapsin:20, gapsout:50, shadow:false workspace = special:magic, gapsin:20, gapsout:50, shadow:false
workspace = 9, gapsin:15, gapsout:40
############### ###############
### PLUGINS ### ### PLUGINS ###

View File

@@ -0,0 +1,85 @@
#!/usr/bin/env bash
# focus_workspace_with_monitor_swap.sh move workspace to the other monitor and focus it
# Usage: focus_workspace_with_monitor_swap.sh <workspace-number>
workspace="$1"
if [[ -z "$workspace" ]]; then
echo "Usage: $0 <workspace-number>"
exit 1
fi
# Get monitor information (plain text)
monitor_output=$(hyprctl monitors)
# Extract monitor IDs and find the focused one
declare -a monitor_ids=()
focused_id=""
while IFS= read -r line; do
if [[ "$line" =~ Monitor[[:space:]]([^[:space:]]+)[[:space:]]\(ID[[:space:]]([0-9]+)\) ]]; then
mon_name="${BASH_REMATCH[1]}"
mon_id="${BASH_REMATCH[2]}"
monitor_ids+=("$mon_id")
fi
if [[ "$line" =~ focused:[[:space:]]yes ]]; then
# The focused monitor is the one we just parsed (the previous line had its ID)
focused_id="$mon_id"
fi
done <<< "$monitor_output"
if [[ ${#monitor_ids[@]} -ne 2 ]]; then
echo "Warning: Expected exactly 2 monitors, found ${#monitor_ids[@]}. Using fallback (+1)."
# Fallback: just move to next monitor (original behaviour)
hyprctl dispatch moveworkspacetomonitor "$workspace" +1
hyprctl dispatch workspace "$workspace"
exit 0
fi
# Determine the "other" monitor ID
other_id=""
for id in "${monitor_ids[@]}"; do
if [[ "$id" != "$focused_id" ]]; then
other_id="$id"
break
fi
done
if [[ -z "$other_id" ]]; then
echo "Error: Could not determine the other monitor."
exit 1
fi
# Check if the workspace already exists and find its current monitor
current_monitor_id=""
workspace_output=$(hyprctl workspaces)
in_workspace_block=false
while IFS= read -r line; do
if [[ "$line" =~ workspace[[:space:]]ID[[:space:]]([0-9]+)[[:space:]] ]]; then
wid="${BASH_REMATCH[1]}"
if [[ "$wid" == "$workspace" ]]; then
in_workspace_block=true
else
in_workspace_block=false
fi
fi
if $in_workspace_block && [[ "$line" =~ monitorID:[[:space:]]([0-9]+) ]]; then
current_monitor_id="${BASH_REMATCH[1]}"
break
fi
done <<< "$workspace_output"
if [[ -n "$current_monitor_id" ]]; then
# Workspace exists move it to the monitor that is NOT its current one
if [[ "$current_monitor_id" == "$focused_id" ]]; then
target_id="$other_id"
else
target_id="$focused_id"
fi
else
# Workspace does not exist create it on the monitor that is NOT focused
target_id="$other_id"
fi
# Move the workspace (creates it if needed) and then focus it
hyprctl dispatch moveworkspacetomonitor "$workspace" "$target_id"
hyprctl dispatch workspace "$workspace"

View File

@@ -3,7 +3,7 @@
# Define the file to modify # Define the file to modify
FILE="$HOME/.config/hypr/monitors.conf" FILE="$HOME/.config/hypr/monitors.conf"
DELAY="0.5" DELAY="1"
# Get specific lines from the file # Get specific lines from the file
LINE_DISABLE=$(sed -n '3p' "$FILE") # 3rd line: disable HDMI LINE_DISABLE=$(sed -n '3p' "$FILE") # 3rd line: disable HDMI

View File

@@ -2,22 +2,41 @@
TOGGLE_FILE="/tmp/toggle_ssocks" TOGGLE_FILE="/tmp/toggle_ssocks"
kill_process() { report_running_status() {
local process_name="$1" if [ -f "$TOGGLE_FILE" ]; then
killall "$process_name" 2>/dev/null echo "true"
sleep 0.25 else
killall -9 "$process_name" 2>/dev/null 2>&1 echo "false"
fi
} }
kill_process() {
local process_name="$1"
# Graceful kill
killall "$process_name" 2>/dev/null
sleep 0.25
# Force kill if still running, suppressing all output
killall -9 "$process_name" &>/dev/null
}
# Handle the "get" command
if [ "$1" = "get" ]; then
report_running_status
exit
fi
# If no argument or any other argument, perform toggle
kill_process sslocal kill_process sslocal
kill_process spoof-dpi kill_process spoof-dpi
if [ -f "$TOGGLE_FILE" ]; then if [ -f "$TOGGLE_FILE" ]; then
echo "Enabling spoofdpi" echo "Enabling spoofdpi"
http_proxy="" spoof-dpi -addr 127.0.0.1 -port 1080 >/dev/null 2>&1 & http_proxy="" spoof-dpi -addr 127.0.0.1 -port 1080 >/dev/null 2>&1 &
rm "$TOGGLE_FILE" http_proxy="" sslocal -c /etc/shadowsocks-rust/hostvds.json >/dev/null 2>&1 &
rm "$TOGGLE_FILE"
else else
echo "Enabling shadowsocks" echo "Enabling shadowsocks"
http_proxy="" sslocal -c /etc/shadowsocks-rust/mega.json >/dev/null 2>&1 & http_proxy="" sslocal -c /etc/shadowsocks-rust/mega.json >/dev/null 2>&1 &
touch "$TOGGLE_FILE" http_proxy="" sslocal -c /etc/shadowsocks-rust/hostvds.json >/dev/null 2>&1 &
touch "$TOGGLE_FILE"
fi fi