updated quickshell
This commit is contained in:
21
home/rofi/rofi-scripts.sh
Normal file
21
home/rofi/rofi-scripts.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# Rofi script-mode: indexes every executable user script so the launcher
|
||||
# can find shell scripts and everything else, not just .desktop apps.
|
||||
|
||||
declare -A SCRIPTS
|
||||
|
||||
for dir in "$HOME/.local/bin" "$HOME/bin" "$HOME/.cargo/bin" "$HOME/Tools/bin" "$HOME/scripts"; do
|
||||
[ -d "$dir" ] || continue
|
||||
while IFS= read -r -d '' f; do
|
||||
[ -f "$f" ] || continue
|
||||
b=$(basename "$f")
|
||||
SCRIPTS["$b"]="$f"
|
||||
done < <(find "$dir" -maxdepth 1 -type f -executable -print0 2>/dev/null)
|
||||
done
|
||||
|
||||
sel="${1:-}"
|
||||
if [ -n "$sel" ] && [ -n "${SCRIPTS[$sel]:-}" ]; then
|
||||
exec setsid "${SCRIPTS[$sel]}" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
printf '%s\n' "${!SCRIPTS[@]}" | sort
|
||||
Reference in New Issue
Block a user