Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix showing notifications in Wayland apps when running XWayland #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions long-running.bash
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ function notify_when_long_running_commands_finish_install() {

function active_window_id () {
if [[ -n $DISPLAY ]] ; then
xprop -root _NET_ACTIVE_WINDOW | awk '{print $5}'
return
active_window=$(xprop -root _NET_ACTIVE_WINDOW)
if [ $? -eq 0 ]; then
echo "$active_window" | awk '{print $5}'
return
fi
fi
echo nowindowid
echo 0x0
}

function sec_to_human () {
Expand Down Expand Up @@ -78,7 +81,7 @@ function notify_when_long_running_commands_finish_install() {
current_window=$(active_window_id)
if [[ $current_window != $__udm_last_window ]] ||
[[ ! -z "$IGNORE_WINDOW_CHECK" ]] ||
[[ $current_window == "nowindowid" ]] ; then
[[ $current_window == "0x0" ]] ; then
local time_taken=$(( $now - $__udm_last_command_started ))
local time_taken_human=$(sec_to_human $time_taken)
local appname=$(basename "${__udm_last_command%% *}")
Expand Down