summaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles')
-rw-r--r--dotfiles/hyprland/.config/hypr/hyprland.conf32
-rwxr-xr-xdotfiles/hyprland/.local/bin/cycle-layout49
-rwxr-xr-xdotfiles/hyprland/.local/bin/layout-navigate58
-rwxr-xr-xdotfiles/hyprland/.local/bin/waybar-layout52
4 files changed, 111 insertions, 80 deletions
diff --git a/dotfiles/hyprland/.config/hypr/hyprland.conf b/dotfiles/hyprland/.config/hypr/hyprland.conf
index e2afa07..bb099d8 100644
--- a/dotfiles/hyprland/.config/hypr/hyprland.conf
+++ b/dotfiles/hyprland/.config/hypr/hyprland.conf
@@ -10,6 +10,7 @@ monitor=,preferred,auto,auto
# ============================================================================
# Startup Applications
# ============================================================================
+exec-once = hyprpm reload
exec-once = waybar
exec-once = swww-daemon && sleep 1 && swww img ~/pictures/wallpaper/dark-lion.jpg
exec-once = dunst
@@ -64,6 +65,7 @@ animations {
animation = windowsOut, 1, 3, default, popin 80%
animation = fade, 1, 3, default
animation = workspaces, 1, 3, default
+ animation = specialWorkspace, 1, 3, default, slidevert
}
# ============================================================================
@@ -130,7 +132,6 @@ bind = $mod, P, exec, fuzzel
# From sxhkdrc
bind = $mod, SPACE, exec, fuzzel
-bind = $mod SHIFT, S, exec, fuzzel --dmenu < ~/.ssh/config | grep -oP '^Host\s+\K\S+' | fuzzel --dmenu --prompt "SSH: " | xargs -I{} foot ssh {}
bind = $mod SHIFT, W, exec, $ALTBROWSER
bind = CTRL ALT, W, exec, tor-browser
bind = CTRL ALT, F, exec, thunar
@@ -140,10 +141,11 @@ bind = $mod SHIFT, R, exec, shortwave
bind = $mod SHIFT, P, exec, waypaper
# Window management (from DWM)
-bind = $mod, J, layoutmsg, cyclenext
-bind = $mod, K, layoutmsg, cycleprev
-bind = $mod SHIFT, J, layoutmsg, swapnext
-bind = $mod SHIFT, K, layoutmsg, swapprev
+# Layout-aware navigation (works across master, scrolling, hy3)
+bind = $mod, J, exec, layout-navigate prev
+bind = $mod, K, exec, layout-navigate next
+bind = $mod SHIFT, J, exec, layout-navigate prev move
+bind = $mod SHIFT, K, exec, layout-navigate next move
bind = $mod, H, splitratio, -0.05
bind = $mod, L, splitratio, +0.05
bind = $mod, RETURN, layoutmsg, swapwithmaster master
@@ -151,29 +153,19 @@ bind = $mod, G, centerwindow
bind = $mod, TAB, workspace, previous
bind = $mod SHIFT, C, killactive
-# Layouts (from DWM)
-# monocle [M] - maximize window
-bind = $mod SHIFT, M, fullscreen, 1
-# tile []= - master on left (default master orientation)
+# Layouts: master -> tab group (monocle) -> scrolling -> floating
+# Click waybar layout icon to cycle, or use direct keybindings:
bind = $mod SHIFT, T, exec, hyprctl keyword general:layout master && hyprctl keyword master:orientation left
-# floating ><> - toggle floating for current window
+bind = $mod SHIFT, M, exec, hyprctl keyword general:layout hy3 && hyprctl dispatch hy3:changegroup tab
+bind = $mod SHIFT, S, exec, hyprctl keyword general:layout scrolling
bind = $mod SHIFT, F, togglefloating
bind = $mod SHIFT, SPACE, togglefloating
-# bstack TTT - master on top
-bind = $mod SHIFT, U, exec, hyprctl keyword general:layout master && hyprctl keyword master:orientation top
-# bstackhoriz === - same as bstack in Hyprland
-bind = $mod, U, exec, hyprctl keyword general:layout master && hyprctl keyword master:orientation top
-# deck [D] - use dwindle layout as approximation
-bind = $mod SHIFT, D, exec, hyprctl keyword general:layout dwindle
-# centeredmaster |M| - master in center
-bind = $mod SHIFT, I, exec, hyprctl keyword general:layout master && hyprctl keyword master:orientation center
-# centeredfloatingmaster >M> - no direct equivalent, use centered master
-bind = $mod SHIFT, O, exec, hyprctl keyword general:layout master && hyprctl keyword master:orientation center
# Master layout adjustments
bind = $mod, I, layoutmsg, addmaster
bind = $mod, D, layoutmsg, removemaster
+
# Gaps (from DWM)
bind = $mod, MINUS, exec, hyprctl keyword general:gaps_out $(( $(hyprctl getoption general:gaps_out -j | jq -r '.custom' | cut -d' ' -f1) - 5 )) && hyprctl keyword general:gaps_in $(( $(hyprctl getoption general:gaps_in -j | jq -r '.custom' | cut -d' ' -f1) - 5 ))
bind = $mod, EQUAL, exec, hyprctl keyword general:gaps_out $(( $(hyprctl getoption general:gaps_out -j | jq -r '.custom' | cut -d' ' -f1) + 5 )) && hyprctl keyword general:gaps_in $(( $(hyprctl getoption general:gaps_in -j | jq -r '.custom' | cut -d' ' -f1) + 5 ))
diff --git a/dotfiles/hyprland/.local/bin/cycle-layout b/dotfiles/hyprland/.local/bin/cycle-layout
index a3b1b1a..ebfd2e0 100755
--- a/dotfiles/hyprland/.local/bin/cycle-layout
+++ b/dotfiles/hyprland/.local/bin/cycle-layout
@@ -1,30 +1,29 @@
#!/bin/sh
# Cycle through Hyprland layouts
+# Cycle: master -> hy3 (tab/monocle) -> scrolling -> floating -> master
LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str')
-ORIENTATION=""
+FLOATING=$(hyprctl activewindow -j 2>/dev/null | jq -r '.floating // false')
-if [ "$LAYOUT" = "master" ]; then
- ORIENTATION=$(hyprctl getoption master:orientation -j | jq -r '.str')
-fi
-
-# Cycle: master-left -> master-top -> master-center -> dwindle -> master-left
-if [ "$LAYOUT" = "dwindle" ]; then
- hyprctl keyword general:layout master
- hyprctl keyword master:orientation left
-elif [ "$LAYOUT" = "master" ]; then
- case "$ORIENTATION" in
- left)
- hyprctl keyword master:orientation top
- ;;
- top)
- hyprctl keyword master:orientation center
- ;;
- center)
- hyprctl keyword general:layout dwindle
- ;;
- *)
- hyprctl keyword master:orientation left
- ;;
- esac
-fi
+# Check if we're in "all floating" mode by checking layout
+case "$LAYOUT" in
+ master)
+ hyprctl keyword general:layout hy3
+ # Create tab group for monocle behavior
+ hyprctl dispatch hy3:changegroup tab
+ ;;
+ hy3)
+ hyprctl keyword general:layout scrolling
+ ;;
+ scrolling)
+ # Switch to master but float all windows
+ hyprctl keyword general:layout master
+ hyprctl dispatch workspaceopt allfloat
+ ;;
+ *)
+ # Return to master tiled
+ hyprctl dispatch workspaceopt allfloat
+ hyprctl keyword general:layout master
+ hyprctl keyword master:orientation left
+ ;;
+esac
diff --git a/dotfiles/hyprland/.local/bin/layout-navigate b/dotfiles/hyprland/.local/bin/layout-navigate
new file mode 100755
index 0000000..ec2f659
--- /dev/null
+++ b/dotfiles/hyprland/.local/bin/layout-navigate
@@ -0,0 +1,58 @@
+#!/bin/sh
+# Layout-aware navigation for Hyprland
+# Usage: layout-navigate <direction> [move]
+# direction: next|prev
+# move: if present, move window instead of focus
+
+DIR="$1"
+MOVE="$2"
+LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str')
+
+case "$LAYOUT" in
+ scrolling)
+ if [ "$MOVE" = "move" ]; then
+ if [ "$DIR" = "next" ]; then
+ hyprctl dispatch layoutmsg movewindowto r
+ else
+ hyprctl dispatch layoutmsg movewindowto l
+ fi
+ else
+ if [ "$DIR" = "next" ]; then
+ hyprctl dispatch layoutmsg focus r
+ else
+ hyprctl dispatch layoutmsg focus l
+ fi
+ fi
+ ;;
+ hy3)
+ if [ "$MOVE" = "move" ]; then
+ if [ "$DIR" = "next" ]; then
+ hyprctl dispatch hy3:movewindow r
+ else
+ hyprctl dispatch hy3:movewindow l
+ fi
+ else
+ if [ "$DIR" = "next" ]; then
+ hyprctl dispatch hy3:movefocus r
+ else
+ hyprctl dispatch hy3:movefocus l
+ fi
+ fi
+ ;;
+ *)
+ # master, dwindle, etc.
+ if [ "$MOVE" = "move" ]; then
+ if [ "$DIR" = "next" ]; then
+ hyprctl dispatch layoutmsg swapnext
+ else
+ hyprctl dispatch layoutmsg swapprev
+ fi
+ else
+ if [ "$DIR" = "next" ]; then
+ hyprctl dispatch layoutmsg cyclenext
+ else
+ hyprctl dispatch layoutmsg cycleprev
+ fi
+ fi
+ ;;
+esac
diff --git a/dotfiles/hyprland/.local/bin/waybar-layout b/dotfiles/hyprland/.local/bin/waybar-layout
index 7ffb8a8..6c45877 100755
--- a/dotfiles/hyprland/.local/bin/waybar-layout
+++ b/dotfiles/hyprland/.local/bin/waybar-layout
@@ -1,54 +1,36 @@
#!/bin/sh
# Hyprland layout indicator for waybar
# Shows current layout with nerd font icons
+# Layouts: master -> tab group (monocle) -> scrolling -> floating
# Get current layout
LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str')
-# Get master orientation if using master layout
-ORIENTATION=""
-if [ "$LAYOUT" = "master" ]; then
- ORIENTATION=$(hyprctl getoption master:orientation -j | jq -r '.str')
-fi
-
-# Check if active window is fullscreen (monocle)
-FULLSCREEN=$(hyprctl activewindow -j | jq -r '.fullscreen')
+# Check if workspace has allfloat enabled
+ALLFLOAT=$(hyprctl activeworkspace -j | jq -r '.hasfullscreenwindow')
# Check if active window is floating
-FLOATING=$(hyprctl activewindow -j | jq -r '.floating')
+FLOATING=$(hyprctl activewindow -j 2>/dev/null | jq -r '.floating // false')
+
+# Check workspace rules for allfloat
+WSRULES=$(hyprctl activeworkspace -j | jq -r '.rules // []')
# Determine icon and tooltip
-if [ "$FULLSCREEN" = "2" ] || [ "$FULLSCREEN" = "1" ]; then
- ICON="󰊓"
- TOOLTIP="Monocle (fullscreen)"
-elif [ "$FLOATING" = "true" ]; then
+if [ "$LAYOUT" = "master" ] && echo "$WSRULES" | grep -q "allfloat"; then
ICON="󰖲"
TOOLTIP="Floating"
-elif [ "$LAYOUT" = "dwindle" ]; then
- ICON="󱒎"
- TOOLTIP="Dwindle"
+elif [ "$LAYOUT" = "scrolling" ]; then
+ ICON="󰯍"
+ TOOLTIP="Scrolling"
+elif [ "$LAYOUT" = "hy3" ]; then
+ ICON="󰖯"
+ TOOLTIP="Tab Group (Monocle)"
elif [ "$LAYOUT" = "master" ]; then
- case "$ORIENTATION" in
- left)
- ICON="󰕰"
- TOOLTIP="Master (left)"
- ;;
- top)
- ICON="󱂩"
- TOOLTIP="Master (top)"
- ;;
- center)
- ICON="󰘸"
- TOOLTIP="Master (center)"
- ;;
- *)
- ICON="󰕰"
- TOOLTIP="Master"
- ;;
- esac
+ ICON="󰕰"
+ TOOLTIP="Master"
else
ICON="󰕰"
- TOOLTIP="Unknown"
+ TOOLTIP="$LAYOUT"
fi
echo "{\"text\": \"<span size='large'>$ICON</span>\", \"tooltip\": \"$TOOLTIP\"}"