diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-11-19 12:26:15 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-11-19 12:26:15 +0200 |
| commit | 7bb4afe3fe024954a18448784ef4c8ebbb0a24db (patch) | |
| tree | 01b8717062a9e87716dbb6414d985e4852ed8944 /scripts | |
| parent | f7aac1752cc2ff0811f9bcf1370c4948b27f551f (diff) | |
Trying some stuff
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/focus_app.sh | 9 | ||||
| -rw-r--r-- | scripts/focus_firefox.js | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/scripts/focus_app.sh b/scripts/focus_app.sh new file mode 100755 index 0000000..955a15d --- /dev/null +++ b/scripts/focus_app.sh @@ -0,0 +1,9 @@ +APP=$1 +WID=$(xdotool search --class "$APP" | head -n 1) + +if [ -z "$WID" ]; then + nohup $APP &>/dev/null & +else + xdotool windowactivate "$WID" +fi + diff --git a/scripts/focus_firefox.js b/scripts/focus_firefox.js new file mode 100644 index 0000000..9d8c09b --- /dev/null +++ b/scripts/focus_firefox.js @@ -0,0 +1,13 @@ +var appName = "firefox"; + +// Search for a Firefox window +var client = workspace.clientList().find(c => c.resourceName === appName); + +if (client) { + // Focus the window + workspace.activeClient = client; +} else { + // Start Firefox if not running + workspace.launch("firefox"); +} + |
