Skip to content

Commit

Permalink
add a desktop file (closes #98)
Browse files Browse the repository at this point in the history
  • Loading branch information
derf committed Jan 31, 2013
1 parent f104f32 commit e112160
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/share/applications/*.desktop
/src/deps.mk
/src/*.o
/src/*.inc
Expand Down
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
git HEAD
* Add --keep-zoom-vp option to keep zoom and offsets when switching
images (patch by sdaau). Press 'k' to toggle it.
* Add --sort mtime option (patch by guns)
* Add a desktop file (installed to share/applications/feh.desktop)

Mon, 24 Dec 2012 15:45:54 +0100 Daniel Friesel <[email protected]>

Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
include config.mk

all: build-src build-man
all: build-src build-man build-applications

build-src:
@${MAKE} -C src

build-man:
@${MAKE} -C man

build-applications:
@${MAKE} -C share/applications

test: all
@PACKAGE=${PACKAGE} prove test

Expand All @@ -16,7 +19,7 @@ test-x11: all
prove test/feh-bg.i

install: install-man install-doc install-bin install-font install-img
install: install-examples
install: install-examples install-applications

install-man:
@echo installing manuals to ${man_dir}
Expand Down Expand Up @@ -57,12 +60,19 @@ install-examples:
@cp examples/* ${example_dir}
@chmod 644 ${example_dir}/*

install-applications:
@echo installing desktop file to ${desktop_dir}
@mkdir -p ${desktop_dir}
@cp share/applications/feh.desktop ${desktop_dir}
@chmod 644 ${desktop_dir}/feh.desktop


uninstall:
rm -f ${man_dir}/man1/feh.1 ${man_dir}/man1/feh-cam.1
rm -f ${man_dir}/man1/gen-cam-menu.1
rm -rf ${doc_dir}
rm -f ${bin_dir}/feh ${bin_dir}/feh-cam ${bin_dir}/gen-cam-menu
rm -f ${desktop_dir}/feh.desktop
rm -rf ${font_dir}
rm -rf ${image_dir}

Expand All @@ -86,6 +96,8 @@ disttest: dist
clean:
@${MAKE} -C src clean
@${MAKE} -C man clean
@${MAKE} -C share/applications clean

.PHONY: all test test-x11 install uninstall clean install-man install-doc \
install-bin install-font install-img install-examples dist
install-bin install-font install-img install-examples \
install-applications dist
1 change: 1 addition & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ doc_dir = ${main_dir}/share/doc/feh
image_dir = ${main_dir}/share/feh/images
font_dir = ${main_dir}/share/feh/fonts
example_dir = ${main_dir}/share/doc/feh/examples
desktop_dir = ${main_dir}/share/applications

# default CFLAGS
CFLAGS ?= -g -O2
Expand Down
24 changes: 24 additions & 0 deletions share/applications/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
include ../../config.mk

SOURCES = ${shell echo *.pre}
TARGETS = ${SOURCES:.pre=.desktop}

all: ${TARGETS}

.pre.desktop:
sed \
-e 's/\$$VERSION\$$/${VERSION}/g' \
-e 's/\$$DATE\$$/'"$$(date '+%B %d, %Y')"/g \
-e 's/\$$MAN_CURL\$$/${MAN_CURL}/' \
-e 's/\$$MAN_DEBUG\$$/${MAN_DEBUG}/' \
-e 's/\$$MAN_EXIF\$$/${MAN_EXIF}/' \
-e 's/\$$MAN_XINERAMA\$$/${MAN_XINERAMA}/' \
-e 's:\$$IMAGEDIR\$$:${image_dir}:' \
< ${@:.desktop=.pre} > $@

clean:
rm -f *.1

.SUFFIXES: .pre .desktop

.PHONY: clean
10 changes: 10 additions & 0 deletions share/applications/feh.pre
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Feh
Comment=Fast Imlib2-based Image Viewer
Exec=feh %f
Terminal=false
Type=Application
Icon=$IMAGEDIR$/logo.svg
Categories=Graphics;2DGraphics;Viewer;
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-pcx;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-tga;image/x-xbitmap;
Name[en_US]=feh

0 comments on commit e112160

Please sign in to comment.