Trying some stuff

This commit is contained in:
2024-11-19 12:26:15 +02:00
parent f7aac1752c
commit 7bb4afe3fe
6 changed files with 56 additions and 31 deletions

9
scripts/focus_app.sh Executable file
View File

@@ -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

13
scripts/focus_firefox.js Normal file
View File

@@ -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");
}