base
This commit is contained in:
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Dependencies: hyprctl
|
||||
# Wait until the window exists
|
||||
|
||||
keepassxc &
|
||||
|
||||
NAME="KeePassXC"
|
||||
CLASS="org.keepassxc.KeePassXC"
|
||||
WORKSPACE=401
|
||||
|
||||
while true; do
|
||||
WIN=$(hyprctl clients -j | jq -r '.[] | select(.class == "'$CLASS'") | .address')
|
||||
|
||||
if [ -n "$WIN" ]; then
|
||||
echo "Found window: $WIN"
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Waiting for $NAME window..."
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
# Move to workspace
|
||||
while true; do
|
||||
# Focus the window
|
||||
hyprctl dispatch focuswindow address:$WIN
|
||||
|
||||
sleep 0.1
|
||||
|
||||
ACTIVE=$(hyprctl activewindow -j | jq -r '.address')
|
||||
|
||||
if [ "$ACTIVE" = "$WIN" ]; then
|
||||
echo "Window is now focused: $WIN"
|
||||
hyprctl dispatch movetoworkspace $WORKSPACE
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Waiting for focus..."
|
||||
sleep $((RANDOM % 3))
|
||||
done
|
||||
Reference in New Issue
Block a user