Created
October 20, 2022 11:45
-
-
Save adinan-cenci/e420e2a457aad89f9776702e9968c84c to your computer and use it in GitHub Desktop.
List all .desktop files on the system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# At the moment this will list all the .desktop files on the system | |
# even the ones not currently installed | |
# Setting IFS (input field separator) value as ":" | |
IFS=':' | |
# Reading the split string into array | |
read -ra arr <<< "$XDG_DATA_DIRS" | |
# Search for .desktop files | |
for val in "${arr[@]}"; | |
do | |
if [ -d $val ] ; then | |
find $val -name "*.desktop" -type f | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment