removed eww and waybar added quickshell
This commit is contained in:
131
hypr/2d-nav.sh
131
hypr/2d-nav.sh
@@ -1,131 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# ~/.config/hypr/2d-nav.sh
|
||||
# 2D workspace navigation for Hyprland
|
||||
# Workspaces are named "X" (base row) or "X-Y" (sub-row, Y >= 1)
|
||||
# Usage: 2d-nav.sh [left|right|up|down|move-left|move-right|move-up|move-down]
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ACTION="${1:-}"
|
||||
|
||||
# --- Parse current workspace ---
|
||||
# Returns e.g. "3" or "3-2"
|
||||
get_current_ws() {
|
||||
hyprctl activeworkspace -j | jq -r '.name'
|
||||
}
|
||||
|
||||
# Split "X-Y" into X and Y parts
|
||||
parse_ws() {
|
||||
local name="$1"
|
||||
if [[ "$name" =~ ^([0-9]+)-([0-9]+)$ ]]; then
|
||||
echo "${BASH_REMATCH[1]} ${BASH_REMATCH[2]}"
|
||||
elif [[ "$name" =~ ^([0-9]+)$ ]]; then
|
||||
echo "${BASH_REMATCH[1]} 0"
|
||||
else
|
||||
# Named/special workspace we don't manage — bail
|
||||
echo "0 0"
|
||||
fi
|
||||
}
|
||||
|
||||
make_ws_name() {
|
||||
local x="$1" y="$2"
|
||||
if [[ "$y" -eq 0 ]]; then
|
||||
echo "$x"
|
||||
else
|
||||
echo "${x}-${y}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Check if a named workspace currently exists (has at least one window OR is active)
|
||||
ws_exists() {
|
||||
local name="$1"
|
||||
hyprctl workspaces -j | jq -e --arg n "$name" '.[] | select(.name == $n)' > /dev/null 2>&1
|
||||
}
|
||||
|
||||
# Navigate to workspace (creates it on demand if going up; smart-back if going down)
|
||||
go_to_ws() {
|
||||
local name="$1"
|
||||
hyprctl dispatch workspace "name:${name}"
|
||||
}
|
||||
|
||||
move_window_to_ws() {
|
||||
local name="$1"
|
||||
hyprctl dispatch movetoworkspace "name:${name}"
|
||||
}
|
||||
|
||||
# --- Main logic ---
|
||||
current=$(get_current_ws)
|
||||
read -r cx cy <<< "$(parse_ws "$current")"
|
||||
|
||||
# Min/max for X axis (your config has 1-5 on DP-2, 6-10 on HDMI-A-1)
|
||||
# But for 2D nav we treat X as free-range 1..10
|
||||
X_MIN=1
|
||||
X_MAX=10
|
||||
Y_MIN=0
|
||||
Y_MAX=9 # Reasonable cap for sub-workspaces
|
||||
|
||||
case "$ACTION" in
|
||||
right)
|
||||
nx=$(( cx < X_MAX ? cx + 1 : cx ))
|
||||
# When moving right, land on base row of target X (Y=0)
|
||||
target=$(make_ws_name "$nx" 0)
|
||||
go_to_ws "$target"
|
||||
;;
|
||||
left)
|
||||
nx=$(( cx > X_MIN ? cx - 1 : cx ))
|
||||
target=$(make_ws_name "$nx" 0)
|
||||
go_to_ws "$target"
|
||||
;;
|
||||
up)
|
||||
ny=$(( cy < Y_MAX ? cy + 1 : cy ))
|
||||
target=$(make_ws_name "$cx" "$ny")
|
||||
go_to_ws "$target"
|
||||
;;
|
||||
down)
|
||||
if [[ "$cy" -gt 0 ]]; then
|
||||
ny=$(( cy - 1 ))
|
||||
# If the workspace below doesn't exist, fall back to base (Y=0), not Y=(cy-1)
|
||||
target=$(make_ws_name "$cx" "$ny")
|
||||
if [[ "$ny" -gt 0 ]] && ! ws_exists "$target"; then
|
||||
target=$(make_ws_name "$cx" 0)
|
||||
fi
|
||||
else
|
||||
target=$(make_ws_name "$cx" 0)
|
||||
fi
|
||||
go_to_ws "$target"
|
||||
;;
|
||||
|
||||
# --- Move window variants ---
|
||||
move-right)
|
||||
nx=$(( cx < X_MAX ? cx + 1 : cx ))
|
||||
target=$(make_ws_name "$nx" 0)
|
||||
move_window_to_ws "$target"
|
||||
;;
|
||||
move-left)
|
||||
nx=$(( cx > X_MIN ? cx - 1 : cx ))
|
||||
target=$(make_ws_name "$nx" 0)
|
||||
move_window_to_ws "$target"
|
||||
;;
|
||||
move-up)
|
||||
ny=$(( cy < Y_MAX ? cy + 1 : cy ))
|
||||
target=$(make_ws_name "$cx" "$ny")
|
||||
move_window_to_ws "$target"
|
||||
;;
|
||||
move-down)
|
||||
if [[ "$cy" -gt 0 ]]; then
|
||||
ny=$(( cy - 1 ))
|
||||
target=$(make_ws_name "$cx" "$ny")
|
||||
if [[ "$ny" -gt 0 ]] && ! ws_exists "$target"; then
|
||||
target=$(make_ws_name "$cx" 0)
|
||||
fi
|
||||
else
|
||||
target=$(make_ws_name "$cx" 0)
|
||||
fi
|
||||
move_window_to_ws "$target"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 [left|right|up|down|move-left|move-right|move-up|move-down]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -14,7 +14,6 @@ DEPS=(
|
||||
wofi
|
||||
thunar
|
||||
fastfetch
|
||||
waybar
|
||||
jq
|
||||
python-gobject # arch
|
||||
)
|
||||
|
||||
@@ -59,10 +59,10 @@ env = HYPRCURSOR_SIZE,24
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#general
|
||||
general {
|
||||
gaps_in = 5
|
||||
gaps_out = 10
|
||||
gaps_in = 0
|
||||
gaps_out = 0
|
||||
|
||||
border_size = 2
|
||||
border_size = 0
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#variable-types for info about colors
|
||||
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
|
||||
@@ -79,8 +79,8 @@ general {
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Variables/#decoration
|
||||
decoration {
|
||||
rounding = 4
|
||||
rounding_power = 2
|
||||
rounding = 0
|
||||
rounding_power = 0
|
||||
|
||||
# Change transparency of focused and unfocused windows
|
||||
active_opacity = 1.0
|
||||
@@ -88,7 +88,7 @@ decoration {
|
||||
|
||||
shadow {
|
||||
enabled = true
|
||||
range = 4
|
||||
range = 0
|
||||
render_power = 3
|
||||
color = rgba(1a1a1aee)
|
||||
}
|
||||
@@ -96,7 +96,7 @@ decoration {
|
||||
# https://wiki.hypr.land/Configuring/Variables/#blur
|
||||
blur {
|
||||
enabled = true
|
||||
size = 3
|
||||
size = 0
|
||||
passes = 1
|
||||
|
||||
vibrancy = 0.1696
|
||||
@@ -160,8 +160,9 @@ misc {
|
||||
# https://wiki.hypr.land/Configuring/Variables/#input
|
||||
input {
|
||||
kb_layout = us,dk
|
||||
kb_variant = ,
|
||||
kb_options = grp:alt_shift_toggle
|
||||
}
|
||||
|
||||
# See https://wiki.hypr.land/Configuring/Gestures
|
||||
gesture = 3, horizontal, workspace
|
||||
|
||||
@@ -186,7 +187,9 @@ bind = $mainMod, W, killactive,
|
||||
bind = $mainMod, M, exec, command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch exit
|
||||
bind = $mainMod, R, exec, sh -c '~/.config/hypr/reload.sh'
|
||||
bind = $mainMod, V, togglefloating,
|
||||
bind = $mainMod, space, exec, $menu
|
||||
#bind = $mainMod, space, exec, $menu
|
||||
bind = SUPER, SPACE, exec, $menu
|
||||
bind = $mainMod, F, exec, $fileManager
|
||||
bind = $mainMod, P, pseudo, # dwindle
|
||||
bind = $mainMod, J, togglesplit, # dwindle
|
||||
|
||||
@@ -227,19 +230,6 @@ bind = SUPER SHIFT, left, movetoworkspacesilent, e-1
|
||||
bind = SUPER ALT, right, movefocus, r
|
||||
bind = SUPER ALT, left, movefocus, l
|
||||
|
||||
# Navigate workspaces (2D)
|
||||
#bind = SUPER, right, exec, ~/.config/hypr/2d-nav.sh right && pkill -SIGRTMIN+8 waybar
|
||||
#bind = SUPER, left, exec, ~/.config/hypr/2d-nav.sh left && pkill -SIGRTMIN+8 waybar
|
||||
#bind = SUPER, up, exec, ~/.config/hypr/2d-nav.sh up && pkill -SIGRTMIN+8 waybar
|
||||
#bind = SUPER, down, exec, ~/.config/hypr/2d-nav.sh down && pkill -SIGRTMIN+8 waybar
|
||||
|
||||
# Move window to workspace (2D)
|
||||
#bind = SUPER SHIFT, right, exec, ~/.config/hypr/2d-nav.sh move-right && pkill -SIGRTMIN+8 waybar
|
||||
#bind = SUPER SHIFT, left, exec, ~/.config/hypr/2d-nav.sh move-left && pkill -SIGRTMIN+8 waybar
|
||||
#bind = SUPER SHIFT, up, exec, ~/.config/hypr/2d-nav.sh move-up && pkill -SIGRTMIN+8 waybar
|
||||
#bind = SUPER SHIFT, down, exec, ~/.config/hypr/2d-nav.sh move-down && pkill -SIGRTMIN+8 waybar
|
||||
|
||||
|
||||
|
||||
# Example special workspace (scratchpad)
|
||||
bind = $mainMod, S, exec, grim -g "$(slurp)" - | wl-copy
|
||||
@@ -316,21 +306,21 @@ windowrule {
|
||||
}
|
||||
|
||||
# env stuff
|
||||
#exec-once = waybar --style ~/.config/waybar/style.css
|
||||
exec-once = bash ~/.config/eww/scripts/launch.sh
|
||||
exec-once = quickshell
|
||||
exec-once = hyprpaper
|
||||
exec-once = ~/.config/hypr/theme-cycle.sh
|
||||
|
||||
#rules
|
||||
windowrulev = nodecorate, class:.*
|
||||
windowrule {
|
||||
name = firefox-to-ws2
|
||||
name = firefox-to-ws1
|
||||
match:class = ^(firefox)$
|
||||
workspace = 1 silent
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = code-to-ws2
|
||||
match:class = ^(code)$
|
||||
match:class = ^(code-oss)$
|
||||
workspace = 2 silent
|
||||
}
|
||||
|
||||
@@ -341,9 +331,9 @@ windowrule {
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = vesktop-to-ws4
|
||||
name = vesktop-to-ws9
|
||||
match:class = ^(vesktop)$
|
||||
workspace = 4 silent
|
||||
workspace = 9 silent
|
||||
}
|
||||
|
||||
|
||||
@@ -353,11 +343,6 @@ windowrule {
|
||||
workspace = 5 silent
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = firefox-to-ws10
|
||||
match:class = ^(firefox)$
|
||||
workspace = 10 silent
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = eww-volume-float
|
||||
@@ -365,11 +350,19 @@ windowrule {
|
||||
float = yes
|
||||
}
|
||||
|
||||
windowrule {
|
||||
name = wofi=thing
|
||||
match:class = ^(wofi)$
|
||||
float = yes
|
||||
move = 50% 36
|
||||
}
|
||||
|
||||
|
||||
#launch apps
|
||||
exec-once = [workspace 1 silent] firefox
|
||||
exec-once = [workspace 10 silent] firefox --new-instance
|
||||
exec-once = firefox
|
||||
exec-once = code
|
||||
exec-once = vesktop
|
||||
exec-once = xwaylandvideobridge
|
||||
exec-once = vesktop --enable-features=UseOzonePlatform --ozone-platform=wayland
|
||||
exec-once = steam
|
||||
exec-once = spotify
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
pgrep -x eww >/dev/null && eww kill; bash ~/.config/eww/scripts/launch.sh
|
||||
pgrep -x quickshell >/dev/null && quickshell kill; quickshell
|
||||
|
||||
# Restart hyprpaper
|
||||
pkill hyprpaper 2>/dev/null
|
||||
|
||||
Reference in New Issue
Block a user