add .desktop entries for use with desktop environments, install to /usr

instead of /usr/local by default
This commit is contained in:
speedie 2023-05-13 00:25:50 +02:00
parent 3da21bc052
commit fd67511080
7 changed files with 36 additions and 2 deletions

View file

@ -6,8 +6,9 @@ reconfigure="${reconfigure:-true}"
version="${version:-1.1}"
xresources="${xresources:-true}"
cp_build="${cp_build:-false}"
prefix="${prefix:-/usr}"
check() { [ "$mac" != "false" ] && gen_manual="false"; }
check() { [ "$mac" != "false" ] && gen_manual="false" && prefix="/usr/local"; }
loadconf() {
[ ! -f spmenu.c ] && printf "You're probably in the wrong directory.\n" && exit 1
@ -46,6 +47,7 @@ build() {
-Dlibconfig="$libconfig" \
-Dopt="$opt" \
-Dutf8="$utf8" \
--prefix "$prefix" \
build
else
meson setup \
@ -59,6 +61,7 @@ build() {
-Dlibconfig="$libconfig" \
-Dopt="$opt" \
-Dutf8="$utf8" \
--prefix "$prefix" \
build
fi

View file

@ -17,3 +17,4 @@ opt=-O2 # level of optimization
warn=true # warn about OS quirks
install=true # automatically install, if set to false an install will not be performed
reconfigure=true # reconfigure using meson
prefix=/usr # prefix

View file

@ -0,0 +1,9 @@
[Desktop Entry]
Version=2.0
Name=spmenu (Desktop)
Icon=spmenu
GenericName=Run launcher
Comment=List out .desktop entries
Exec=spmenu_run -d
Terminal=false
Type=Application

View file

@ -0,0 +1,9 @@
[Desktop Entry]
Version=2.0
Name=spmenu (File manager)
Icon=spmenu
GenericName=Run launcher
Comment=List out files and directories
Exec=spmenu_run -fm
Terminal=false
Type=Application

9
docs/spmenu_run.desktop Normal file
View file

@ -0,0 +1,9 @@
[Desktop Entry]
Version=2.0
Name=spmenu (Run)
Icon=spmenu
GenericName=Run launcher
Comment=List out PATH entries.
Exec=spmenu_run -x
Terminal=false
Type=Application

View file

@ -87,6 +87,9 @@ install_data(sources : 'docs/docs.md', install_dir : 'share/spmenu')
install_data(sources : 'docs/code-docs.md', install_dir : 'share/spmenu')
install_data(sources : 'docs/example.Xresources', install_dir : 'share/spmenu')
install_data(sources : 'docs/spmenu.conf', install_dir : 'share/spmenu')
install_data(sources : 'docs/spmenu_run.desktop', install_dir : 'share/applications')
install_data(sources : 'docs/spmenu_desktop.desktop', install_dir : 'share/applications')
install_data(sources : 'docs/spmenu_filemanager.desktop', install_dir : 'share/applications')
install_data(sources : 'scripts/spmenu_run', install_dir : 'bin')
install_data(sources : 'scripts/spmenu_test', install_dir : 'bin')

View file

@ -677,7 +677,7 @@ cache_desktop() {
}
clear_cache() {
rm -rf "${tmpdir[@]}"
rm -rf "${tmpdir[*]}"
rm -f "${TITLEFILE}" "${FILEFILE}" "${EXECFILE}" "${ICONFILE}" "${DESCFILE}"
}