]> code.delx.au - monosys/blob - hacks/gnome-shell-raise-window
Rename all the things
[monosys] / hacks / gnome-shell-raise-window
1 #!/bin/bash
2
3 set -eu
4
5 if [ -z "${1:-}" ]; then
6 echo "Usage: $0 title.endsWith('Page Title - Mozilla Firefox')"
7 exit 1
8 fi
9
10 MATCHER="$1"
11
12 dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:"
13 const windows = global.display.get_tab_list(0, null);
14 const matching = windows.filter((win) => {
15 const title = win.get_title();
16 return $MATCHER;
17 });
18
19 if (matching.length > 0) {
20 const win = matching[0];
21 win.get_workspace().activate_with_focus(win, true);
22 win.activate(0);
23 }
24 "