From c6267c7163c44dede98a0e19f9d541dbe0110b63 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Fri, 7 Jul 2023 00:40:25 +0200 Subject: [PATCH] Fix hyprland-handler and add wayland flags/env --- .config/chromium-flags.conf | 1 + .config/electron-flags.conf | 2 ++ .config/environment | 1 + .config/hypr/handler.sh | 18 ++++++------------ 4 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 .config/chromium-flags.conf create mode 100644 .config/electron-flags.conf diff --git a/.config/chromium-flags.conf b/.config/chromium-flags.conf new file mode 100644 index 0000000..da26db9 --- /dev/null +++ b/.config/chromium-flags.conf @@ -0,0 +1 @@ +--ozone-platform-hint=auto diff --git a/.config/electron-flags.conf b/.config/electron-flags.conf new file mode 100644 index 0000000..612fc17 --- /dev/null +++ b/.config/electron-flags.conf @@ -0,0 +1,2 @@ +--enable-features=WaylandWindowDecorations +--ozone-platform-hint=auto diff --git a/.config/environment b/.config/environment index 69fac1b..fc75632 100644 --- a/.config/environment +++ b/.config/environment @@ -32,6 +32,7 @@ export HOSTNAME="$(cat /proc/sys/kernel/hostname)" export MAKEFLAGS="-j$(grep -c ^processor /proc/cpuinfo)" export MOAR="--style=dracula" +export MOZ_ENABLE_WAYLAND=1 export PASSWORD_STORE_GENERATED_LENGTH='64' export PS1='\$ ' diff --git a/.config/hypr/handler.sh b/.config/hypr/handler.sh index 2e7242e..f0a98e5 100755 --- a/.config/hypr/handler.sh +++ b/.config/hypr/handler.sh @@ -11,24 +11,18 @@ _handler_check_ws_media_empty() { # split at ">>" and get the second part and take first part of that win_id=$(echo "$1" | cut -d'>' -f3 | cut -d',' -f1) - media_got_emptied="false" + event_on_media="false" - is_on_media_ws=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$win_id\") | .workspace.name == \"$ws_media\"") - if [ "$is_on_media_ws" == "true" ]; then - media_got_emptied="true" - fi + moved_from_media=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$win_id\") | .workspace.name == \"$ws_media\"") + closed_on_media=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$win_id\") | .at == $ws_media_at") - was_on_media_ws=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$win_id\") | .at == $ws_media_at") - if [ "$was_on_media_ws" == "true" ]; then - media_got_emptied="true" + if [ "$moved_from_media" == "true" ] || [ "$closed_on_media" == "true" ]; then + event_on_media="true" fi has_zero_windows=$(hyprctl workspaces -j | jq ".[] | select(.name == \"$ws_media\") | .windows == 0") - if [ "$has_zero_windows" == "true" ]; then - media_got_emptied="true" - fi - if [ "$media_got_emptied" == "true" ]; then + if [ "$has_zero_windows" == "true" ] && [ "$event_on_media" == "true" ]; then hyprctl dispatch workspace "$ws_voip" fi