From fae5c9bf47e8eede044c791bd50e8e21c3c40718 Mon Sep 17 00:00:00 2001 From: Natalie Marks Date: Thu, 30 Oct 2025 19:48:27 -0700 Subject: [PATCH] feat (natalie): add nice functions to support awakened poe trade in wayland --- users/natalie/home/hyprland/windowrules.nix | 17 +++++++ .../home/scripts/scripts/fakefullscreen.sh | 44 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 users/natalie/home/scripts/scripts/fakefullscreen.sh diff --git a/users/natalie/home/hyprland/windowrules.nix b/users/natalie/home/hyprland/windowrules.nix index e4d0cc88f5857cb7f72017a82433b098967ff079..af902649c34e4b12ce1e92a0e039583334384f22 100644 --- a/users/natalie/home/hyprland/windowrules.nix +++ b/users/natalie/home/hyprland/windowrules.nix @@ -8,6 +8,23 @@ "pin,class:^(waypaper)$" "float,title:^(Volume Control)$" + #awakened-poe-trade + # https://github.com/SnosMe/awakened-poe-trade/issues/1137#issuecomment-2992606569 + "tag +apt, class:^(awakened-poe-trade)$" + "float, tag:apt" + "noblur, tag:apt" + "nofocus, tag:apt" + "noshadow, tag:apt" + "noborder, tag:apt" + "pin, tag:apt" + "renderunfocused, tag:apt" + "size 100% 100%, tag:apt" + "center, tag:apt" + "fullscreen, class:^(steam_app_238960)$" + # https://github.com/SnosMe/awakened-poe-trade/issues/1137#issuecomment-3037816727 + "tag +fakefullscreen, title:(Path of Exile),class:(steam_app_238960)" + "tile, tag:fakefullscreen" + "noborder, tag:fakefullscreen" # "float,title:^(Firefox — Sharing Indicator)$" # "move 0 0,title:^(Firefox — Sharing Indicator)$" # "size 700 450,title:^(Volume Control)$" diff --git a/users/natalie/home/scripts/scripts/fakefullscreen.sh b/users/natalie/home/scripts/scripts/fakefullscreen.sh new file mode 100644 index 0000000000000000000000000000000000000000..3b206da04e6dc35a114f0c3c36ae0b273fb9ac92 --- /dev/null +++ b/users/natalie/home/scripts/scripts/fakefullscreen.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p bash socat jq killall +# shellcheck disable=all + +RUNDIR=/run/user/$EUID/hypr +WAYBAR_FILE=$RUNDIR/.waybar_is_hidden + +function hide { + if [ ! -f $WAYBAR_FILE ]; then + hyprctl keyword workspace , gapsout:0 >/dev/null 2>&1 + killall -SIGUSR1 .waybar-wrapped && touch $WAYBAR_FILE + fi +} + +function show { + if [ -f $WAYBAR_FILE ]; then + hyprctl keyword workspace , gapsout:$(hyprctl getoption general:gaps_out -j | jq -r .custom | tr \ ,) >/dev/null 2>&1 + killall -SIGUSR1 .waybar-wrapped && rm $WAYBAR_FILE >/dev/null 2>&1 + fi +} + +function fakefullscreen() { + local fullscreenclients=$(hyprctl clients -j | jq -r '.[] | select(.tags | contains(["fakefullscreen"])).workspace.id') + [ -z "$fullscreenclients" -a ! -f $WAYBAR_FILE ] && return + local active=$(hyprctl activeworkspace -j | jq -r .id) + for id in $fullscreenclients; do + if [ $active -eq $id -a $(hyprctl clients -j | jq -r "[.[] | select(.workspace.id == $id) | select(.floating | not)] | length") -eq 1 ]; then + hide + return + fi + done + show +} + +sleep 1 +fakefullscreen + +socat -u "UNIX-CONNECT:$RUNDIR/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" STDOUT | while read -r event; do + case $event in + workspace\>\>* | openwindow\>\>* | closewindow\>\>*) fakefullscreen ;; + esac +done + +show -- 2.54.0