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

Display windowing system window ID in output of windows command #84

Open
taladar opened this issue Sep 22, 2022 · 2 comments
Open

Display windowing system window ID in output of windows command #84

taladar opened this issue Sep 22, 2022 · 2 comments

Comments

@taladar
Copy link

taladar commented Sep 22, 2022

To identify which window in e.g. wmctrl is which window in brotab it would be useful if brotab could display the window id by the windowing system for each window, not just its own internal id.

This would a script to e.g. open new tabs in the Firefox window on workspace x specifically and not just in the one last focussed.

@bjohas
Copy link

bjohas commented Nov 25, 2022

I would be interested in this too.

@slastra
Copy link

slastra commented Oct 1, 2023

#!/bin/bash
# Activate tab,  window, and workspace 

sep=""
tabs=`bt list | awk -v sep="$sep" -F "\t" '{print $2 sep $1}'`
tabs=`echo -e "New Window\n$tabs" `
selected=`echo "$tabs" \
| rofi -dmenu -i -select "$active_window" -p ""  -display-columns 1 -display-column-separator $sep -theme ~/.config/rofi/combi.rasi\
| head -1 `
if [ "$selected" ]; then
    if [ "$selected" == "New Window" ]; then
        brave
        exit 0
    fi
    tab_id=`echo $selected | awk -F $sep '{print $2}'`
    echo $tab_id
    bt activate $tab_id
    bt_window_id=`echo $tab_id | cut -d'.' -f2`
    active_tab_id=`bt active | grep $bt_window_id |cut -f1`
    window_name=`echo "$tabs" | grep $active_tab_id | awk -F $sep '{print $1}'`
    window_id=`wmctrl -l | grep "$window_name" | cut -f1`
    wmctrl -i -a $window_id
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants