#!/bin/bash

# The Pearl dashboard displays installed applications into yad based window. 
# Created by Paweł "pavroo" Pijanowski 2018/05/09
# Copyright 2018 under the GNU GPL2 License
# Last updated 2018/05/17

if [ -d /tmp/pearl-dash ]; then
	rm -rf /tmp/pearl-dash
fi
mkdir /tmp/pearl-dash
cp -a /usr/share/applications/*.desktop /tmp/pearl-dash/
cd /tmp/pearl-dash
EXCLUDE=`find * -type f -exec grep -l 'NoDisplay=true' {} \;`
rm -f $EXCLUDE

yad --icons --read-dir=/tmp/pearl-dash --monitor --item-width=100\
 --sort-by-name --center --undecorated --skip-taskbar --borders=20\
 --button="Cancel!gtk-cancel":1 --buttons-layout=center --maximized

rm -rf /tmp/pearl-dash
exit 0
