Trying some stuff
This commit is contained in:
9
scripts/focus_app.sh
Executable file
9
scripts/focus_app.sh
Executable 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
13
scripts/focus_firefox.js
Normal 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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user