aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/HyprLayoutModule.sh
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-07-10 11:21:24 -0700
committerPinapelz <yukais@pinapelz.com>2026-07-10 11:21:24 -0700
commit24de2a31a52d17b6f7214197bdbfeab7428742dd (patch)
treef7736c4712d5a394525a3da2f2b4294e81ba9540 /config/hypr/scripts/HyprLayoutModule.sh
parent861bf5be200bfcf2440fec4cda911d29ec18493f (diff)
parentbca86bbec4757cec1f6f5bdea2ed210542f10fae (diff)
Merge remote-tracking branch 'upstream'
Diffstat (limited to 'config/hypr/scripts/HyprLayoutModule.sh')
-rwxr-xr-xconfig/hypr/scripts/HyprLayoutModule.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/config/hypr/scripts/HyprLayoutModule.sh b/config/hypr/scripts/HyprLayoutModule.sh
index 22f12920..14e3b524 100755
--- a/config/hypr/scripts/HyprLayoutModule.sh
+++ b/config/hypr/scripts/HyprLayoutModule.sh
@@ -9,8 +9,8 @@
IFS=$'\n\t'
-SCRIPTSDIR="$HOME/.config/hypr/scripts"
-rofi_config="$HOME/.config/rofi/config-waybar-layout.rasi"
+SCRIPTSDIR="${XDG_CONFIG_HOME:-$HOME/.config}/hypr/scripts"
+rofi_config="${XDG_CONFIG_HOME:-$HOME/.config}/rofi/config-layout.rasi"
change_layout="${SCRIPTSDIR}/ChangeLayout.sh"
layouts=(dwindle scrolling monocle master)
@@ -35,7 +35,17 @@ layout_name() {
}
get_layout() {
- hyprctl -j getoption general:layout 2>/dev/null | jq -r '.str // "unknown"' 2>/dev/null
+ local layout
+
+ if [[ -x "$change_layout" ]]; then
+ layout="$("$change_layout" --quiet current 2>/dev/null || true)"
+ if [[ -n "$layout" ]]; then
+ printf '%s\n' "$layout"
+ return
+ fi
+ fi
+
+ hyprctl -j activeworkspace 2>/dev/null | jq -r '.tiledLayout // .tiled_layout // "unknown"' 2>/dev/null
}
next_layout() {
@@ -68,7 +78,7 @@ show_status() {
current="$(get_layout)"
icon="$(layout_icon "$current")"
name="$(layout_name "$current")"
- tooltip="Hyprland layout: ${name} (${icon})\n\nLeft click: Select layout\nRight click: Cycle layout\n\nOptions:\nšŸ„³ Dwindle\nšŸ…‚ Scrolling\nšŸ„¼ Monocle\nā“œ Master"
+ tooltip="Workspace layout: ${name} (${icon})\n\nLeft click: Select layout for active workspace\nRight click: Cycle active workspace layout\n\nOptions:\nšŸ„³ Dwindle\nšŸ…‚ Scrolling\nšŸ„¼ Monocle\nā“œ Master"
printf '{"text":"%s","tooltip":"%s","class":"%s"}\n' "$icon" "$tooltip" "$current"
}
@@ -97,7 +107,7 @@ show_menu() {
return 0
fi
- choice="$(printf '%s\n' "${options[@]}" | rofi -i -dmenu -p "Layout" -mesg "Left click selects • Right click cycles" -selected-row "$default_row" -config "$rofi_config")"
+ choice="$(printf '%s\n' "${options[@]}" | rofi -i -dmenu -p "Workspace layout" -mesg "Select layout for this workspace" -selected-row "$default_row" -config "$rofi_config")"
[[ -z "$choice" ]] && exit 0
case "$choice" in
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage