forked from speedie/spmenu
some fixes, add to TODO
This commit is contained in:
parent
1126bf5680
commit
8e8c359d00
|
@ -337,6 +337,7 @@ xprompt</li>
|
||||||
to avoid adding more external dependencies unless it’s a common
|
to avoid adding more external dependencies unless it’s a common
|
||||||
dependency most people already have.</li>
|
dependency most people already have.</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
|
<li>X11: Move from Xlib to libXcb</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3
|
<h3
|
||||||
id="unlikely-but-maybe-at-some-point-in-the-distant-future">Unlikely,
|
id="unlikely-but-maybe-at-some-point-in-the-distant-future">Unlikely,
|
||||||
|
|
|
@ -135,6 +135,7 @@ have LibreSSL compatibility.
|
||||||
- Probably use some minimal public domain library for this, I'd
|
- Probably use some minimal public domain library for this, I'd
|
||||||
like to avoid adding more external dependencies unless it's a
|
like to avoid adding more external dependencies unless it's a
|
||||||
common dependency most people already have.
|
common dependency most people already have.
|
||||||
|
- X11: Move from Xlib to libXcb
|
||||||
|
|
||||||
### Unlikely, but maybe at some point in the distant future
|
### Unlikely, but maybe at some point in the distant future
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ USE_FULL_PATH="${USE_FULL_PATH:-false}"
|
||||||
HELP_COLOR="${HELP_COLOR:-#FFFF00}"
|
HELP_COLOR="${HELP_COLOR:-#FFFF00}"
|
||||||
DESCRIPTION_COLOR="${DESCRIPTION_COLOR:-#999888}"
|
DESCRIPTION_COLOR="${DESCRIPTION_COLOR:-#999888}"
|
||||||
DMENU_COMPAT="${DMENU_COMPAT:-false}"
|
DMENU_COMPAT="${DMENU_COMPAT:-false}"
|
||||||
|
AUTOREFRESH="${AUTOREFRESH:-false}"
|
||||||
|
|
||||||
DESKTOP_DIR="${DESKTOP_DIR:-${DESTDIR}${PREFIX}/share/applications}"
|
DESKTOP_DIR="${DESKTOP_DIR:-${DESTDIR}${PREFIX}/share/applications}"
|
||||||
ICON_DIR="${ICON_DIR:-${DESTDIR}${PREFIX}/share/icons/hicolor ${DESTDIR}${PREFIX}/share/pixmaps}"
|
ICON_DIR="${ICON_DIR:-${DESTDIR}${PREFIX}/share/icons/hicolor ${DESTDIR}${PREFIX}/share/pixmaps}"
|
||||||
|
@ -43,7 +44,7 @@ LOGFILE="${LOGFILE:-/tmp/spmenu_run.log}"
|
||||||
TITLEFILE="${TITLEFILE:-${XDG_CACHE_HOME:-$HOME/.cache}/.title}"
|
TITLEFILE="${TITLEFILE:-${XDG_CACHE_HOME:-$HOME/.cache}/.title}"
|
||||||
EXECFILE="${EXECFILE:-${XDG_CACHE_HOME:-$HOME/.cache}/.exec}"
|
EXECFILE="${EXECFILE:-${XDG_CACHE_HOME:-$HOME/.cache}/.exec}"
|
||||||
ICONFILE="${ICONFILE:-${XDG_CACHE_HOME:-$HOME/.cache}/.icon}"
|
ICONFILE="${ICONFILE:-${XDG_CACHE_HOME:-$HOME/.cache}/.icon}"
|
||||||
DESCFILE="${DESCFILE:-${XDG_CACHE_HOME:-$HOME/.cache}.desc}"
|
DESCFILE="${DESCFILE:-${XDG_CACHE_HOME:-$HOME/.cache}/.desc}"
|
||||||
FILEFILE="${FILEFILE:-${XDG_CACHE_HOME:-$HOME/.cache}/.file}"
|
FILEFILE="${FILEFILE:-${XDG_CACHE_HOME:-$HOME/.cache}/.file}"
|
||||||
|
|
||||||
# arrays containing entries
|
# arrays containing entries
|
||||||
|
@ -247,6 +248,7 @@ DESKTOP_DIR="\${DESTDIR}\${PREFIX}/share/applications" # Directories for .deskto
|
||||||
ICON_DIR="\${DESTDIR}\${PREFIX}/share/icons/hicolor \${DESTDIR}\${PREFIX}/share/pixmaps" # Directories for icons defined in the entries
|
ICON_DIR="\${DESTDIR}\${PREFIX}/share/icons/hicolor \${DESTDIR}\${PREFIX}/share/pixmaps" # Directories for icons defined in the entries
|
||||||
TEMPORARY_DIR="\$CONFDIR/spmenu/run/cache" # Directory used to store cached entries
|
TEMPORARY_DIR="\$CONFDIR/spmenu/run/cache" # Directory used to store cached entries
|
||||||
CACHE="true" # Cache entries (true/false)
|
CACHE="true" # Cache entries (true/false)
|
||||||
|
AUTOREFRESH="false" # Refresh (clear) cache if there are more entries available than cached. May cause cache to be cleared every time in some cases. (true/false)
|
||||||
IMAGE="true" # Display images (true/false)
|
IMAGE="true" # Display images (true/false)
|
||||||
DISPLAY_DESCRIPTION="true" # Display description (true/false)"
|
DISPLAY_DESCRIPTION="true" # Display description (true/false)"
|
||||||
DESCRIPTION_COLOR="#999888" # Description text color
|
DESCRIPTION_COLOR="#999888" # Description text color
|
||||||
|
@ -474,7 +476,7 @@ EOF
|
||||||
|
|
||||||
print_desktop_list() {
|
print_desktop_list() {
|
||||||
# should we use cached files?
|
# should we use cached files?
|
||||||
if [ -e "$TITLEFILE" ] && [ -e "$ICONFILE" ] && [ -e "$EXECFILE" ] && [ -e "$FILEFILE" ] && [ -e "$DESCFILE" ]; then
|
if [ -f "$TITLEFILE" ] && [ -f "$ICONFILE" ] && [ -f "$EXECFILE" ] && [ -f "$FILEFILE" ] && [ -f "$DESCFILE" ]; then
|
||||||
cfiles=true
|
cfiles=true
|
||||||
else
|
else
|
||||||
cfiles=false
|
cfiles=false
|
||||||
|
@ -488,12 +490,10 @@ print_desktop_list() {
|
||||||
it_exec=()
|
it_exec=()
|
||||||
it_file=()
|
it_file=()
|
||||||
|
|
||||||
# write to log file
|
|
||||||
[ "$cfiles" = "false" ] && \
|
|
||||||
printf "Writing cache files because none exist.\nTitle file: '%s'\nDescription file: '%s'\nIcon file: '%s'\nExec file: '%s'\nFile file: '%s'\n" "$TITLEFILE" "$DESCFILE" "$ICONFILE" "$EXECFILE" "$FILEFILE" >> "$LOGFILE"
|
|
||||||
|
|
||||||
# print data from entries
|
# print data from entries
|
||||||
if [ "$cfiles" = "false" ]; then
|
if [ "$cfiles" = "false" ]; then
|
||||||
|
printf "Writing cache files because none exist.\nTitle file: '%s'\nDescription file: '%s'\nIcon file: '%s'\nExec file: '%s'\nFile file: '%s'\n" "$TITLEFILE" "$DESCFILE" "$ICONFILE" "$EXECFILE" "$FILEFILE" >> "$LOGFILE"
|
||||||
|
|
||||||
entry_c="$(find "${desktopdir[@]}" -type f | wc -l)"
|
entry_c="$(find "${desktopdir[@]}" -type f | wc -l)"
|
||||||
cached_c="$(find "${tmpdir[@]}" -type f | wc -l)"
|
cached_c="$(find "${tmpdir[@]}" -type f | wc -l)"
|
||||||
cached="$(find "${tmpdir[@]}" -type f)";
|
cached="$(find "${tmpdir[@]}" -type f)";
|
||||||
|
@ -631,7 +631,11 @@ cache_desktop() {
|
||||||
printf "Cached: %s\n" "$cached_c" >> "$LOGFILE"
|
printf "Cached: %s\n" "$cached_c" >> "$LOGFILE"
|
||||||
printf "Entries: %s\n" "$entry_c" >> "$LOGFILE"
|
printf "Entries: %s\n" "$entry_c" >> "$LOGFILE"
|
||||||
|
|
||||||
[ "$cached_c" = "$entry_c" ] || [ "$cached_c" -gt "$entry_c" ] && return # we don't need to cache anything, it's already done
|
if [ "$AUTOREFRESH" = "true" ]; then
|
||||||
|
if [ "$cached_c" = "$entry_c" ] || [ "$cached_c" -gt "$entry_c" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
[ -f "$TITLEFILE" ] && rm -f "$TITLEFILE"
|
[ -f "$TITLEFILE" ] && rm -f "$TITLEFILE"
|
||||||
[ -f "$ICONFILE" ] && rm -f "$ICONFILE"
|
[ -f "$ICONFILE" ] && rm -f "$ICONFILE"
|
||||||
|
|
Loading…
Reference in a new issue