-
Notifications
You must be signed in to change notification settings - Fork 11
/
lsdesktops
29 lines (23 loc) · 805 Bytes
/
lsdesktops
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
#------------------------------------------------------------------------------
# Project Name - ShellProjects/source/lsdesktops
# Started On - Sun 18 Jun 00:07:53 BST 2023
# Last Change - Mon 19 Jun 23:34:57 BST 2023
# Author E-Mail - terminalforlife@yahoo.com
# Author GitHub - https://github.com/terminalforlife
#------------------------------------------------------------------------------
# Portable script to scan the system for and list '*.desktop' files.
#------------------------------------------------------------------------------
Dirs() {
OldIFS=$IFS
IFS=':'
set -- $1
IFS=$OldIFS
for Dir in "$@"; do
Dir=${Dir%/}
for File in "$Dir"/applications/*.desktop; do
[ -f "$File" ] && printf '%s\n' "$File"
done
done
}
Dirs "$XDG_DATA_DIRS"