]> git.pld-linux.org Git - packages/feh.git/commitdiff
up to 3.10.2 master auto/th/feh-3.10.2-1
authorJan Palus <atler@pld-linux.org>
Thu, 14 Dec 2023 00:21:42 +0000 (01:21 +0100)
committerJan Palus <atler@pld-linux.org>
Thu, 14 Dec 2023 00:21:42 +0000 (01:21 +0100)
feh-bash-completion
feh-install.patch [deleted file]
feh-zsh-completion [new file with mode: 0644]
feh.spec

index 78c781cb6c32db400c4c51f60338b3e0d8dbf0e7..5ba9751f7fd618d4c4b7da660fb8c9000f9aee3d 100644 (file)
-# feh bash_completition - made by uzsolt
-# TODO: add more file extensions
+# bash completion for feh(1)                               -*- shell-script -*-
 
-_feh() 
+_comp_cmd_feh()
 {
-       local cur
+    local cur prev words cword was_split comp_args
+    _comp_initialize -s -- "$@" || return
 
-       COMPREPLY=()
-       cur=${COMP_WORDS[COMP_CWORD]}
+    local noargopts='!(-*|*[foO|KCjeM@TSRHWEyJabgLD~^]*)'
+    # shellcheck disable=SC2254
+    case "$prev" in
+        --image-bg | -B)
+            _comp_compgen -- -W 'checks white black'
+            return
+            ;;
+        --filelist | --output | --output-only | --start-at | -${noargopts}[foO\|])
+            _comp_compgen_filedir
+            return
+            ;;
+        --caption-path | --fontpath | --output-dir | -${noargopts}[KCj])
+            _comp_compgen_filedir -d
+            return
+            ;;
+        --font | --menu-font | --title-font | -${noargopts}[eM@])
+            # expect string like "dejavu.ttf/12"
+            if [[ $cur == */* ]]; then # expect integer value
+                _comp_compgen -R -- -P "$cur" -W '{0..9}'
+                compopt -o nospace
+                return
+            fi
+            local font_path
+            # font_path="$(imlib2-config --prefix 2>/dev/null)/share/imlib2/data/fonts"
+            # _comp_compgen -C "$font_path" -- -f -X "!*.@([tT][tT][fF])" -S /
+            for ((i = ${#words[@]} - 1; i > 0; i--)); do
+                if [[ ${words[i]} == -@(C|-fontpath) ]]; then
+                    font_path="${words[i + 1]}"
+                    _comp_compgen -aC "$font_path" -- \
+                        -f -X "!*.@([tT][tT][fF])" -S /
+                fi
+            done
+            compopt -o nospace
+            return
+            ;;
+        --theme | -${noargopts}T)
+            local conf_path=~/.config/feh/themes
+            local theme_name theme_opts
+            [[ -r $conf_path ]] || return
+            while read -r theme_name theme_opts; do
+                if [[ $theme_name == '#'* || $theme_name == "" ]]; then
+                    continue
+                fi
+                _comp_compgen -a -- -W "$theme_name"
+            done <"$conf_path"
+            return
+            ;;
+        --sort | -${noargopts}S)
+            _comp_compgen -- -W 'name filename mtime width height pixels size
+                format'
+            return
+            ;;
+        --reload | --limit-height | --limit-width | --thumb-height | --thumb-width | \
+            --thumb-redraw | --magick-timeout | -${noargopts}[RHWEyJ])
+            # expect integer value
+            _comp_compgen -aR -- -W '{0..9}'
+            compopt -o nospace
+            return
+            ;;
+        --zoom)
+            # expect integer value or "max", "fill"
+            _comp_compgen -- -W 'max fill'
+            if [[ ! $cur || ! ${COMPREPLY-} ]]; then
+                _comp_compgen -aR -- -W '{0..9}'
+                compopt -o nospace
+            fi
+            return
+            ;;
+        --alpha | -${noargopts}a)
+            _comp_compgen -- -W '{0..255}'
+            return
+            ;;
+        --bg | -${noargopts}b)
+            _comp_compgen_filedir
+            _comp_compgen -a -- -W 'trans'
+            return
+            ;;
+        --geometry | --max-dimension | --min-dimension | -${noargopts}g)
+            # expect string like 640x480
+            if [[ $cur && $cur != *x* ]]; then
+                COMPREPLY=(x)
+            fi
+            _comp_compgen -aR -- -W "{0..9}"
+            compopt -o nospace
+            return
+            ;;
+        --customlist | --index-info | --info | --slideshow-delay | --thumb-title | \
+            --title | -${noargopts}[LD~^])
+            # argument required but no completions available
+            return
+            ;;
+    esac
 
-       case "$cur" in
-           -*)
-               COMPREPLY=( $( compgen -W ' -1 -2 -4 -5 -6 -7 -8 -9\
-                    -a -A --action1 --action2 --action3 --action4 --action5 --action6 --action7 --action8 --action9\
-                    --alpha --auto-zoom -b --bg --bg-center --bg-scale --bg-seamless --bg-tile --blur-button\
-                    --borderless --builtin -c --cache-thumbnails --caption-path --collage --customlist --cycle-once\
-                    -d -D --draw-filename -e -E -f -F --filelist --fontpath --fullindex --full-screen -g -G --geometry\
-                    -h -H --help --hide-pointer -i -I --ignore-aspect --index -j -k --keep-http -l -L --limit-height \
-                    --limit-width --list --loadable -m -M --menu-bg --menu-border --menu-button --menu-ctrl-mask \
-                    --menu-font --menu-style --montage --multiwindow -n -N --next-button --no-blur-ctrl-mask \
-                    --no-jump-on-resort --no-menus --no-rotate-ctrl-mask -o -O --output-dir -p --preload -q -Q \
-                    --quiet -r -R --randomize --rcfile --recursive --reload --reverse --rotate-button -s -S 
-                    --scale-down --screen-clip --slideshow-delay --sort --stretch -t -T --theme --thumb-height \
-                    --thumbnails --thumb-width --title --title-font -u -U --unloadable -v -V --verbose --version \
-                    -w -W --wget-timestamp -x -X --xinerama -y -z -Z --zoom --zoom-button' -- $cur ) )
-               ;;
-           *)
-                _filedir '@(jpg|jpeg|png|gif|bmp|ppm|xpm|JPG|JPEG|PNG|GIF|BMP|PPM)'
-               ;;
-       esac
-  
-       return 0
+    [[ $was_split ]] && return
 
-}
-complete -F _feh -o filenames feh
+    if [[ $cur == -* ]]; then
+        # Some versions of feh just output "See 'man feh'" for --help :(
+        _comp_compgen_help
+        if [[ ${COMPREPLY-} ]]; then
+            [[ $COMPREPLY == *= ]] && compopt -o nospace
+            return
+        fi
+    fi
+
+    # FIXME: It is hard to determine correct supported extensions.
+    # feh can handle any format that imagemagick can plus some others
+    _comp_compgen_filedir 'xpm|tif?(f)|png|p[npgba]m|iff|?(i)lbm|jp?(e)g|jfi?(f)|gif|bmp|arg?(b)|tga|xcf|ani|ico|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf|ff?(.gz|.bz2)|webp'
+} &&
+    complete -F _comp_cmd_feh feh
+
+# ex: filetype=sh
diff --git a/feh-install.patch b/feh-install.patch
deleted file mode 100644 (file)
index afad07f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
---- feh-1.11.2/Makefile~       2011-02-09 20:19:58.000000000 +0100
-+++ feh-1.11.2/Makefile        2011-02-10 11:28:34.954408659 +0100
-@@ -22,39 +22,31 @@
-       @echo installing manuals to ${man_dir}
-       @mkdir -p ${man_dir}/man1
-       @cp man/*.1 ${man_dir}/man1
--      @chmod 644 ${man_dir}/man1/feh.1 ${man_dir}/man1/feh-cam.1 \
--              ${man_dir}/man1/gen-cam-menu.1
- install-doc:
-       @echo installing docs to ${doc_dir}
-       @mkdir -p ${doc_dir}
-       @cp AUTHORS ChangeLog README TODO ${doc_dir}
--      @chmod 644 ${doc_dir}/*
- install-bin:
-       @echo installing executables to ${bin_dir}
-       @mkdir -p ${bin_dir}
-       @cp src/feh cam/feh-cam cam/gen-cam-menu ${bin_dir}
--      @chmod 755 ${bin_dir}/feh ${bin_dir}/feh-cam \
--              ${bin_dir}/gen-cam-menu
- install-font:
-       @echo installing fonts to ${font_dir}
-       @mkdir -p ${font_dir}
-       @cp share/fonts/* ${font_dir}
--      @chmod 644 ${font_dir}/*
- install-img:
-       @echo installing images to ${image_dir}
-       @mkdir -p ${image_dir}
-       @cp share/images/* ${image_dir}
--      @chmod 644 ${image_dir}/*
- install-examples:
-       @echo installing examples to ${example_dir}
-       @mkdir -p ${example_dir}
-       @cp examples/* ${example_dir}
--      @chmod 644 ${example_dir}/*
- uninstall:
diff --git a/feh-zsh-completion b/feh-zsh-completion
new file mode 100644 (file)
index 0000000..a65437e
--- /dev/null
@@ -0,0 +1,128 @@
+#compdef feh
+## completion for feh 3.0, based on feh(1)
+
+function _feh_theme {
+       [[ -r ~/.config/feh/themes ]] || return
+       typeset -a themes
+       typeset -i cont=0
+       typeset cur_theme cur_desc
+
+       while read theme_name theme_options; do
+
+               if [[ ${theme_name} == '#'* ]] {
+                       continue
+               }
+
+               if (( ! ${#theme_name} && ! ${#theme_options} )) {
+                       continue
+               }
+
+               themes+="${theme_name}:${theme_options}"
+
+       done < ~/.config/feh/themes
+
+       _describe 'theme' themes
+}
+
+function _feh_button {
+       typeset expl
+       _wanted button expl button \
+       compadd {0..5}
+}
+
+function _feh_background {
+       _alternative \
+       'file:file:_files' \
+       'mode:mode:(trans)'
+}
+
+function _feh {
+       _arguments -s -S \
+       '(--action -A)'{-A,--action}'[action to perform on images]:shell command:_cmdstring' \
+       --action{1..9}'[additional action]:shell command:_cmdstring' \
+       '--auto-rotate[automatically rotate images based on EXIF data]' \
+       '(--auto-zoom -Z)'{-Z,--auto-zoom}'[zoom pictures to screen]' \
+       '(--borderless -x)'{-x,--borderless}'[create borderless windows]' \
+       '--cache-size[Imlib2 in-memory cache size]:cache size in MiB' \
+       '(--cache-thumbnails -P)'{--cache-thumbnails,-P}'[cache thumbnails]' \
+       '(--caption-path -K)'{--caption-path,-K+}'[enable caption mode]:caption directory:_files -/' \
+       '--conversion-timeout[set ImageMagick conversion timeout for unlodable files]:timeout in seconds (-1 to disable)' \
+       '(--customlist -L)'{--customlist,-L}'[custom list mode]:feh format string' \
+       '(--draw-actions -G)'{--draw-actions,-G}'[show defined actions]' \
+       '--draw-exif[show EXIF data]' \
+       '(--draw-filename -d)'{--draw-filename,-d}'[show filename]' \
+       '--draw-tinted[show overlay texts on tinted background]' \
+       '--edit[change files in-place when using rotate and mirror keys]' \
+       '(--filelist -f)'{--filelist,-f}'[load from/save to filelist]:filelist:_files' \
+       '(--font -e)'{--font,-e+}'[set global font]:font' \
+       '(--fontpath -C)'{--fontpath,-C+}'[set font path]:font path:_files -/' \
+       '--force-aliasing[disable antialiasing]' \
+       '(--fullindex -I)'{--fullindex,-I}'[index mode with additional information]' \
+       '(--fullscreen -F)'{--fullscreen,-F}'[start in fullscreen mode]' \
+       '(--geometry -g)'{--geometry,-g+}'[set window geometry]:WxH[+X+Y]' \
+       '(--hide-pointer -Y)'{--hide-pointer,-Y}'[hide pointer]' \
+       '(--image-bg -B)'{--image-bg,-B+}'[set image background]:background style or X11 colour:(default checks)' \
+       '(--index -i)'{--index,-i}'[index mode]' \
+       '--index-info[image info for thumbnail/index mode]:format string' \
+       '--info[filo info command]:shell command:_cmdstring' \
+       '--insecure[disable HTTPS certificate checks]' \
+       '(--keep-http -k)'{--keep-http,-k}'[keep cached HTTP files]' \
+       '--keep-zoom-vp[keep zoom and viewport when switching images]' \
+       '(--list -l)'{--list,-l}'[list mode]' \
+       '(--loadable -U)'{--loadable,-U}'[list loadable images]' \
+       '--max-dimension[set maximum image dimensions]:WxH' \
+       '(--menu-font -M)'{--menu-font,-M+}'[set menu font]:menu font' \
+       '--min-dimension[set minimum image dimensions]:WxH' \
+       '(--montage -m)'{--montage,-m}'[montage mode]' \
+       '(--multiwindow -w)'{--multiwindow,-w}'[multiwindow mode]' \
+       '--no-jump-on-resort[do not jump to first image after resorting]' \
+       '(--no-menus -N)'{--no-menus,-N}'[disable menus]' \
+       '--no-screen-clip[disable window size limits]' \
+       '--no-xinerama[disable Xinerama support]' \
+       '--on-last-slide[set behaviour when advancing past the last slide]:behaviour:(hold quit resume)' \
+       '(--output-dir -j)'{--output-dir,-j+}'[set temporary file location]:directory:_files -/' \
+       '(--preload -p)'{--preload,-p}'[eliminate unloadable images before starting]' \
+       '(--quiet -q)'{--quiet,-q}'[do not report non-fatal errors]' \
+       '(--randomize -z)'{--randomize,-z}'[randomize filelist]' \
+       '(--recursive -r)'{--recursive,-r}'[recurse into subdirectories]' \
+       '--no-recursive[do not recurse into subdirectories]' \
+       '(--reload -R)'{--reload,-R+}'[regularly reload filelist and current image]:seconds' \
+       '(--reverse -n)'{--reverse,-n}'[reverse sort order]' \
+       '(--scale-down -.)'{--scale-down,-.}'[scale down too large images]' \
+       '--scroll-step[set scroll granularity]:pixels per scroll step' \
+       '(--slideshow-delay -D)'{--slideshow-delay,-D+}'[set slideshow delay]:seconds' \
+       '(--sort -S)'{--sort,-S}'[sort images]:sort key:(name filename dirname mtime width height pixels size format)' \
+       '(--start-at -|)'{--start-at,-'|'+}'[start slideshow at file]:start file:_files' \
+       '(--theme -T)'{--theme,-T+}'[set theme]: :_feh_theme' \
+       '(--thumbnails -t)'{--thumbnails,-t}'[thumbnail mode]' \
+       '(--thumb-title -~)'{--thumb-title,-'~'+}'[set thumbnail window title]:feh format string' \
+       '(--title -^)'{--title,-'^'}'[set window title]:feh format string' \
+       '(--unloadable -u)'{--unloadable,-u}'[list unloadable images]' \
+       '(--verbose -V)'{--verbose,-V}'[verbose mode]' \
+       '--version-sort[use natural sorting for --sort]' \
+       '--zoom[set default zoom level]:percent' \
+       \
+       '(--alpha -a)'{--alpha,-a}'[set thumbnail transparency]:alpha level' \
+       '(--bg -b)'{--bg,-b}'[set montage background]: :_feh_background' \
+       '(--ignore-aspect -X)'{--ignore-aspect,-X}'[ignore aspect in montage mode]' \
+       '(--limit-height -H)'{--limit-height,-H}'[limit montage height]:pixels' \
+       '(--limit-width -W)'{--limit-width,-W}'[limit montage width]:pixels' \
+       '(--output -o)'{--output,-o}'[save created montage]:output file:_files' \
+       '(--output-only -O)'{--output-only,-O}'[only save created montage]:output file:_files' \
+       '(--stretch -s)'{--stretch,-s}'[enlarge too small images in montage mode]' \
+       '(--thumb-height -E)'{--thumb-height,-E}'[set montage mode thumbnail height]:pixels' \
+       '(--thumb-width -y)'{--thumb-width,-y}'[set montage mode thumbnail width]:pixels' \
+       '(--thumb-redraw -J)'{--thumb-redraw,-J}'[set thumbnail mode redraw interval]:interval' \
+       \
+       '--bg-center[set centered background]' \
+       '--bg-fill[set filled background (zoom until filled)]' \
+       '--bg-max[set maxed background (zoom until image fits)]' \
+       '--bg-scale[set background without preserving aspect ratio]' \
+       '--bg-tile[set tiled background]' \
+       \
+       '(--title-font -@)'{--title-font,-'@'}'[set title font]:font' \
+       '*:image, directory or URL:_files'
+}
+
+_feh "$@"
+
index fb359c5176ade3c38029d39cdcb5fcd925e7aef9..48492c979f9d2fbef8524b0a7f570c586a93fc86 100644 (file)
--- a/feh.spec
+++ b/feh.spec
@@ -2,22 +2,30 @@ Summary:      Fast image viewer/indexer/montager
 Summary(hu.UTF-8):     Gyors képnézegető/indexelő/montázsoló
 Summary(pl.UTF-8):     Szybki program do przeglądania/indeksowania/montowania obrazów
 Name:          feh
-Version:       2.5
-Release:       3
+Version:       3.10.2
+Release:       1
 License:       BSD
 Group:         X11/Applications/Graphics
-Source0:       https://derf.homelinux.org/~derf/projects/feh/%{name}-%{version}.tar.bz2
-# Source0-md5: d5f6048f79005c05b51060beafd1f08d
-URL:           http://feh.finalrewind.org/
-# Patch0:              %{name}-install.patch
+Source0:       https://feh.finalrewind.org/%{name}-%{version}.tar.bz2
+# Source0-md5: 0a780bf321c0653d03e3e18410f4d1ba
+URL:           https://feh.finalrewind.org/
+# Bash completion by https://github.com/scop/bash-completion/blob/master/completions/feh
 Source1:       %{name}-bash-completion
-BuildRequires: giblib-devel >= 1.2.4
+# zsh completion by https://git.finalrewind.org/zsh/plain/etc/completions/_feh
+Source2:       %{name}-zsh-completion
+BuildRequires: curl-devel
 BuildRequires: imlib2-devel >= 1.0.0
+BuildRequires: libexif-devel
 BuildRequires: libjpeg-devel
+BuildRequires: libmagic-devel
 BuildRequires: libpng-devel
+BuildRequires: rpm-build >= 4.6
 BuildRequires: sed >= 4.0
+BuildRequires: xorg-lib-libX11-devel
 BuildRequires: xorg-lib-libXinerama-devel
 BuildRequires: xorg-lib-libXt-devel
+Suggests:      ImageMagick
+Suggests:      imlib2_loaders
 Provides:      WallpaperChanger
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -50,53 +58,89 @@ rekursywne otwieranie plików (pokaz slajdów z hierarchii katalogów),
 oraz sterowanie z klawiatury/myszki (też z kółkiem).
 
 %package -n bash-completion-feh
-Summary:       bash-completion to feh
-Summary(pl.UTF-8):     bashowe dopełnianie linii poleceń programu feh
+Summary:       Bash completion for feh
+Summary(pl.UTF-8):     Dopełnianie parametrów feh dla powłoki Bash
 Group:         Applications/Shells
-Requires:      bash-completion
+Requires:      bash-completion >= 1:2.0
+Requires:      %{name} = %{version}-%{release}
 Obsoletes:     feh-bash-completion
-%if "%{_rpmversion}" >= "5"
 BuildArch:     noarch
-%endif
 
 %description -n bash-completion-feh
-bash-completion to feh.
+Bash completion for feh.
 
 %description -n bash-completion-feh -l pl.UTF-8
-bashowe dopełnianie linii poleceń programu feh.
+Dopełnianie parametrów feh dla powłoki Bash.
+
+%package -n zsh-completion-feh
+Summary:       ZSH completion for feh
+Summary(pl.UTF-8):     Dopełnianie parametrów feh dla powłoki ZSH
+Group:         Applications/Shells
+Requires:      %{name} = %{version}-%{release}
+BuildArch:     noarch
+
+%description -n zsh-completion-feh
+ZSH completion for feh.
+
+%description -n zsh-completion-feh -l pl.UTF-8
+Dopełnianie parametrów feh dla powłoki ZSH.
 
 %prep
 %setup -q
-# %patch0 -p1
-%{__sed} -i "s|CFLAGS ?=.*|CFLAGS = %{rpmcflags}|" config.mk
 
 %build
+CFLAGS="%{rpmcflags} %{rpmcppflags}" \
+LDFLAGS="%{rpmldflags}" \
 %{__make} \
        CC="%{__cc}" \
-       PREFIX=%{_prefix}
+       PREFIX=%{_prefix} \
+       exif=1 \
+       help=1 \
+       inotify=1 \
+       magic=1
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
+install -d $RPM_BUILD_ROOT{%{bash_compdir},%{zsh_compdir}}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT \
-       PREFIX=%{_prefix}
+       PREFIX="%{_prefix}" \
+       bin_dir="$RPM_BUILD_ROOT%{_bindir}" \
+       man_dir="$RPM_BUILD_ROOT%{_mandir}" \
+       desktop_dir="$RPM_BUILD_ROOT%{_desktopdir}" \
+       icon_dir="$RPM_BUILD_ROOT%{_iconsdir}/hicolor"
 
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/%{name}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{bash_compdir}/%{name}
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{zsh_compdir}/_%{name}
 
 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+%update_icon_cache hicolor
+%update_desktop_database
+
+%postun
+%update_icon_cache hicolor
+%update_desktop_database
+
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS COPYING ChangeLog examples README TODO
-%attr(755,root,root) %{_bindir}/*
+%doc AUTHORS COPYING ChangeLog examples README.md TODO
+%attr(755,root,root) %{_bindir}/feh
 %{_datadir}/feh
-%{_mandir}/man1/*.1*
+%{_mandir}/man1/feh.1*
+%{_desktopdir}/feh.desktop
+%{_iconsdir}/hicolor/48x48/apps/feh.png
+%{_iconsdir}/hicolor/scalable/apps/feh.svg
 
 %files -n bash-completion-feh
 %defattr(644,root,root,755)
-%{_sysconfdir}/bash_completion.d/%{name}
+%{bash_compdir}/%{name}
+
+%files -n zsh-completion-feh
+%defattr(644,root,root,755)
+%{zsh_compdir}/_%{name}
This page took 0.169832 seconds and 4 git commands to generate.