=== removed file 'xsession-skel/homedir/bin/open-im' --- old/xsession-skel/homedir/bin/open-im 2023-01-12 09:52:33 +0000 +++ new/xsession-skel/homedir/bin/open-im 1970-01-01 00:00:00 +0000 @@ -1,46 +0,0 @@ -#!/bin/zsh -setopt no_unset warn_create_global extended_glob - -typeset -gA app_match_title app_match_class app_cmd -typeset -g app_id=0 - -add_app() { - app_match_title[$app_id]=$1 - app_match_class[$app_id]=$2 - shift 2 - app_cmd[$app_id]="${(pj:\0:)@}" - app_id=$(( $app_id + 1 )) -} - -launch_app() { - : "${(0@)app_cmd[$1]}" -} -typeset -f -t launch_app - - -add_app '\[weechat@weechat.ccx\]*' '"abduco:weechat:weechat-ccx" "URxvt"' powerbox-plumb 'abduco/weechat.ccx/weechat/weechat-curses' -add_app '\[profanity@profanity.ccx\]*' '"abduco:profanity:profanity-ccx" "URxvt"' powerbox-plumb 'abduco/profanity.ccx/profanity/profanity' -add_app '\[void-telegram.ccx:*' '"telegram-desktop" "TelegramDesktop"' run-in-container-xpra void-telegram.ccx telegram-desktop -add_app '\[void-signal.ccx:*' '"signal" "Signal"' run-in-container-xpra void-signal.ccx signal-desktop - - -main() { - local winid title class app - xwininfo_full="$(xwininfo -tree -root)" || exit $? - sed <<<"$xwininfo_full" -nEe '/^ *0x[0-9a-f]+ ".*\+[0-9]+\+[0-9]+$/{s/^ *(0x[0-9a-f]+) "(.*)": \((.*)\) [0-9]+x[0-9]+\+[0-9]+\+[0-9]+ \+[0-9]+\+[0-9]+$/\1\t\2\t\3/;p}' |\ - while IFS=$'\t' read winid title class; do - for app in ${(k)app_match_title}; do - if [[ $title == $~app_match_title[$app] && $class == $~app_match_class[$app] ]]; then - unset "app_match_title[$app]" - unset "app_match_class[$app]" - printf 'window %s matches application %s\n' $winid $app - fi - done - done - for app in ${(k)app_match_title}; do - launch_app $app - done -} - -set -x -main