added maps for icons and monitors

This commit is contained in:
willifan 2024-03-19 00:10:43 +01:00
parent 618c02c14b
commit 7a315e3f38
7 changed files with 176 additions and 178 deletions

View file

@ -12,8 +12,9 @@ getIcon() {
# If not found by WM class, search by process name
if [ -z "$desktop" ] && [ -n "$2" ]; then
desktop=$(pgrep -fl "$2" | awk '{print $2}' | grep -m1 -o '[^/]*\.desktop' | head -n1)
[ -n "$desktop" ] && desktop="/usr/share/applications/$desktop"
process=$(ps -p ${2} -o comm=)
desktop=$(grep -Pl "$process" /usr/share/applications/*.desktop)
[ -n "$desktop" ] && desktop="$desktop"
fi
# If not found by WM class or process name, search by name or description