ArchRice/rofi/rofi_slide.sh
2025-05-11 17:39:22 +02:00

18 lines
595 B
Bash

#!/bin/bash
# Launch ROFI and get its window ID
rofi -show drun -theme ~/.config/rofi/themes/ayu-retro.rasi &
sleep 0.1 # Wait for the window to appear
ROFI_WID=$(xdotool search --onlyvisible --class rofi | head -n 1)
# Get screen width and calculate center position
SCREEN_WIDTH=$(xdpyinfo | awk '/dimensions/{print $2}' | cut -d'x' -f1)
WINDOW_WIDTH=$(xdotool getwindowgeometry $ROFI_WID | awk '/Geometry/{print $2}' | cut -d'x' -f1)
X_POS=$(( (SCREEN_WIDTH - WINDOW_WIDTH) / 2 ))
# Animate slide-down
for Y in $(seq -10 5 100); do
xdotool windowmove $ROFI_WID $X_POS $Y
sleep 0.01
done