Rename, Update Docs and Prepare for Release (#9)

Co-authored-by: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com>
Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com>
Co-authored-by: NRK <nrk@disroot.org>
Co-authored-by: Arthur Williams <taaparthur@gmail.com>
Co-authored-by: eylles <ed.ylles1997@gmail.com>
This commit is contained in:
Berke Kocaoğlu 2021-09-16 12:32:59 +03:00
parent 9c73646d9c
commit 7cce7ea857
28 changed files with 411 additions and 313 deletions

2
.gitignore vendored
View File

@ -2,5 +2,5 @@ config.h
version.h
*.d
*.o
sxiv
nsxiv
config.mk

182
CHANGELOG.md Normal file
View File

@ -0,0 +1,182 @@
nsxiv
-----
**Stable releases**
**[v27](https://github.com/nsxiv/nsxiv/archive/v27.tar.gz)**
*(September 14, 2021)*
Changes:
* Re-release under the name nsxiv
* Sxiv.foreground and Sxiv.background changed to Nsxiv.window.foreground and Nsxiv.window.background
* Rework the build system (#19). Now by default we'll build with only optional dependencies that are already installed
Added:
* Fill scale mode (#2)
* Configurable X window title (via `config.h` and the `-T` flag) (#23)
* Support custom bar colors via Xresources (#19)
* Toggle animation playback with Ctrl-a (#33)
* Set `_NET_WM_PID` and `WM_CLIENT_MACHINE` X properties (#13)
* Set ICCCM WM manager hints (#12)
Fixes:
* Cli flag `-G` not initially setting gamma (#31)
* Wrong keybinding description in the manpage (#14)
* .desktop entry not advertising webp support (#15)
* Prevent crash when embedded into transparent window (#3)
* Rare crash when showing some GIFs (#41)
* Rare event when nsxiv wouldn't close after window being destroyed (#53)
sxiv
----
**Stable releases**
**[v26](https://github.com/nsxiv/nsxiv/archive/v26.tar.gz)**
*(January 16, 2020)*
* Maintenance release
**[v25](https://github.com/nsxiv/nsxiv/archive/v25.tar.gz)**
*(January 26, 2019)*
* Support font fallback for missing glyphs
* Fix busy loop when built without inotify
* Use background/foreground colors from X resource database
**[v24](https://github.com/nsxiv/nsxiv/archive/v24.tar.gz)**
*(October 27, 2017)*
* Automatically reload the current image whenever it changes
* Support embedding into other X windows with -e (e.g. tabbed)
* New option -p prevents sxiv from creating cache and temporary files
* Simpler mouse mappings, the most basic features are accessible with the
mouse only (navigate, zoom, pan)
**[v1.3.2](https://github.com/nsxiv/nsxiv/archive/v1.3.2.tar.gz)**
*(December 20, 2015)*
* external key handler gets file paths on stdin, not as arguments
* Cache out-of-view thumbnails in the background
* Apply gamma correction to thumbnails
**[v1.3.1](https://github.com/nsxiv/nsxiv/archive/v1.3.1.tar.gz)**
*(November 16, 2014)*
* Fixed build error, caused by delayed config.h creation
* Fixed segfault when run with -c
**[v1.3](https://github.com/nsxiv/nsxiv/archive/v1.3.tar.gz)**
*(October 24, 2014)*
* Extract thumbnails from EXIF tags (requires libexif)
* Zoomable thumbnails, supported sizes defined in config.h
* Fixed build error with giflib version >= 5.1.0
**[v1.2](https://github.com/nsxiv/nsxiv/archive/v1.2.tar.gz)**
*(April 24, 2014)*
* Added external key handler, called on keys prefixed with `Ctrl-x`
* New keybinding `{`/`}` to change gamma (by András Mohari)
* Support for slideshows, enabled with `-S` option & toggled with `s`
* Added application icon (created by 0ion9)
* Checkerboard background for alpha layer
* Option `-o` only prints files marked with `m` key
* Fixed rotation/flipping of multi-frame images (gifs)
**[v1.1.1](https://github.com/nsxiv/nsxiv/archive/v1.1.1.tar.gz)**
*(June 2, 2013)*
* Various bug fixes
**[v1.1](https://github.com/nsxiv/nsxiv/archive/v1.1.tar.gz)**
*(March 30, 2013)*
* Added status bar on bottom of window with customizable content
* New keyboard shortcuts `\`/`|`: flip image vertically/horizontally
* New keyboard shortcut `Ctrl-6`: go to last/alternate image
* Added own EXIF orientation handling, removed dependency on libexif
* Fixed various bugs
**[v1.0](https://github.com/nsxiv/nsxiv/archive/v1.0.tar.gz)**
*(October 31, 2011)*
* Support for multi-frame images & GIF animations
* POSIX compliant (IEEE Std 1003.1-2001)
**[v0.9](https://github.com/nsxiv/nsxiv/archive/v0.9.tar.gz)**
*(August 17, 2011)*
* Made key and mouse mappings fully configurable in config.h
* Complete code refactoring
**[v0.8.2](https://github.com/nsxiv/nsxiv/archive/v0.8.2.tar.gz)**
*(June 29, 2011)*
* POSIX-compliant Makefile; compiles under NetBSD
**[v0.8.1](https://github.com/nsxiv/nsxiv/archive/v0.8.1.tar.gz)**
*(May 8, 2011)*
* Fixed fullscreen under window managers, which are not fully EWMH-compliant
**[v0.8](https://github.com/nsxiv/nsxiv/archive/v0.8.tar.gz)**
*(April 18, 2011)*
* Support for thumbnail caching
* Ability to run external commands (e.g. jpegtran, convert) on current image
**[v0.7](https://github.com/nsxiv/nsxiv/archive/v0.7.tar.gz)**
*(February 26, 2011)*
* Sort directory entries when using `-r` command line option
* Hide cursor in image mode
* Full functional thumbnail mode, use Return key to switch between image and
thumbnail mode
**[v0.6](https://github.com/nsxiv/nsxiv/archive/v0.6.tar.gz)**
*(February 16, 2011)*
* Bug fix: Correctly display filenames with umlauts in window title
* Basic support of thumbnails
**[v0.5](https://github.com/nsxiv/nsxiv/archive/v0.5.tar.gz)**
*(February 6, 2011)*
* New command line option: `-r`: open all images in given directories
* New key shortcuts: `w`: resize image to fit into window; `W`: resize window
to fit to image
**[v0.4](https://github.com/nsxiv/nsxiv/archive/v0.4.tar.gz)**
*(February 1, 2011)*
* New command line option: `-F`, `-g`: use fixed window dimensions and apply
a given window geometry
* New key shortcut: `r`: reload current image
**[v0.3.1](https://github.com/nsxiv/nsxiv/archive/v0.3.1.tar.gz)**
*(January 30, 2011)*
* Bug fix: Do not set setuid bit on executable when using `make install`
* Pan image with mouse while pressing middle mouse button
**[v0.3](https://github.com/nsxiv/nsxiv/archive/v0.3.tar.gz)**
*(January 29, 2011)*
* New command line options: `-d`, `-f`, `-p`, `-s`, `-v`, `-w`, `-Z`, `-z`
* More mouse mappings: Go to next/previous image with left/right click,
scroll image with mouse wheel (horizontally if Shift key is pressed),
zoom image with mouse wheel if Ctrl key is pressed
**[v0.2](https://github.com/nsxiv/nsxiv/archive/v0.2.tar.gz)**
*(January 23, 2011)*
* Bug fix: Handle window resizes correctly
* New keyboard shortcuts: `g`/`G`: go to first/last image; `[`/`]`: go 10
images back/forward
* Support for mouse wheel zooming (by Dave Reisner)
* Added fullscreen mode
**[v0.1](https://github.com/nsxiv/nsxiv/archive/v0.1.tar.gz)**
*(January 21, 2011)*
* Initial release

23
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,23 @@
Contribution Guideline
----------------------
The scope and aim of nsxiv are:
* Bug fixes and maintenance
* Prioritize extensibility and simplicity
* Do not make the codebase more complex, keep it simple to hack on
* Do not add extra dependency (if we do, add compile time switch to disable it)
* New features may be added if it cannot be achieved (easily) via a shell script,
doesn't break backwards compatibility and doesn't violate any of the above rules.
When contributing, make sure:
* Your contribution falls under nsxiv's scope and aim
* You follow the existing code style (see [.editorconfig](.editorconfig))
* You open the pull request from a new branch, not from master
If your contribution is not suitable for general use, it will not be included in nsxiv.
For changes that are very much up to preference, such as changing values in config.h,
please do not open a pull request unless you have an objective explanation.
See [TODO.md](TODO.md) or the [open issues](https://github.com/nsxiv/nsxiv/issues) to find something to work on.

View File

@ -3,8 +3,8 @@ ifneq (clean,$(filter clean,$(MAKECMDGOALS)))
-include config.mk
endif
# sxiv version
VERSION = 26
# nsxiv version
VERSION = 27
# PREFIX for install
PREFIX ?= /usr/local
@ -40,9 +40,9 @@ OBJS = autoreload_$(AUTORELOAD).o commands.o image.o main.o options.o \
.SUFFIXES:
.SUFFIXES: .c .o
all: sxiv
all: nsxiv
sxiv: $(OBJS)
nsxiv: $(OBJS)
@echo "LINK $@"
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
@ -50,7 +50,7 @@ sxiv: $(OBJS)
@echo "CC $@"
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
$(OBJS): Makefile sxiv.h commands.lst config.h config.mk
$(OBJS): Makefile nsxiv.h commands.lst config.h config.mk
options.o: version.h
window.o: icon/data.h
@ -73,24 +73,24 @@ version.h: Makefile .git/index
echo "#define VERSION \"$${v:-$(VERSION)}\"" >$@
clean:
$(RM) *.o sxiv
$(RM) *.o nsxiv
install: all
@echo "INSTALL bin/sxiv"
install -Dt $(DESTDIR)$(PREFIX)/bin sxiv
@echo "INSTALL sxiv.1"
@echo "INSTALL bin/nsxiv"
install -Dt $(DESTDIR)$(PREFIX)/bin nsxiv
@echo "INSTALL nsxiv.1"
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
sed "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" sxiv.1 \
>$(DESTDIR)$(MANPREFIX)/man1/sxiv.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
@echo "INSTALL share/sxiv/"
install -Dt $(DESTDIR)$(PREFIX)/share/sxiv/exec exec/*
sed "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" nsxiv.1 \
>$(DESTDIR)$(MANPREFIX)/man1/nsxiv.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/nsxiv.1
@echo "INSTALL share/nsxiv/"
install -Dt $(DESTDIR)$(PREFIX)/share/nsxiv/exec exec/*
uninstall:
@echo "REMOVE bin/sxiv"
rm -f $(DESTDIR)$(PREFIX)/bin/sxiv
@echo "REMOVE sxiv.1"
rm -f $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
@echo "REMOVE share/sxiv/"
rm -rf $(DESTDIR)$(PREFIX)/share/sxiv
@echo "REMOVE bin/nsxiv"
rm -f $(DESTDIR)$(PREFIX)/bin/nsxiv
@echo "REMOVE nsxiv.1"
rm -f $(DESTDIR)$(MANPREFIX)/man1/nsxiv.1
@echo "REMOVE share/nsxiv/"
rm -rf $(DESTDIR)$(PREFIX)/share/nsxiv

239
README.md
View File

@ -1,11 +1,16 @@
![sxiv](http://muennich.github.com/sxiv/img/logo.png "sxiv")
![nsxiv](https://raw.githubusercontent.com/nsxiv/nsxiv/gh-pages/img/logo.png "nsxiv")
**Simple X Image Viewer**
**Neo (or New or Not) Simple (or Small or Suckless) X Image Viewer**
--------------------------------------------------------------------
The sole purpose of sxiv is to be the perfect image viewer for me. It is free
software so that you can use it and modify it for your needs. Please file a bug
report if something does not work as documented or expected. Contributions are
welcome but there is no guarantee that they will be incorporated.
nsxiv is a fork of now unmaintained [sxiv](https://github.com/muennich/sxiv)
with the purpose of maintaining it and adding simple, sensible features.
nsxiv is free software licensed under GPLv2 and aims to be easy to modify and customize.
Please file a bug report if something does not work as documented or
expected in *this* repository, after making sure you are using the latest
release of nsxiv. Contributions are welcome, see [CONTRIBUTING.md](CONTRIBUTING.md)
for details.
Features
@ -16,26 +21,27 @@ Features
* Thumbnail mode: grid of selectable previews of all images
* Ability to cache thumbnails for fast re-loading
* Basic support for multi-frame images
* Load all frames from GIF files and play GIF animations
* Play GIF animations
* Display image information in status bar
* Display image name/path in X title
Screenshots
-----------
**Image mode:**
**Image mode: (Default colors)**
![Image](http://muennich.github.com/sxiv/img/image.png "Image mode")
![Image](https://raw.githubusercontent.com/nsxiv/nsxiv/gh-pages/img/image.png "Image mode")
**Thumbnail mode:**
**Thumbnail mode: (Custom colors)**
![Thumb](http://muennich.github.com/sxiv/img/thumb.png "Thumb mode")
![Thumb](https://raw.githubusercontent.com/nsxiv/nsxiv/gh-pages/img/thumb.png "Thumb mode")
Dependencies
------------
sxiv requires the following software to be installed:
nsxiv requires the following software to be installed:
* Imlib2
* X11
@ -46,21 +52,16 @@ sxiv requires the following software to be installed:
* libexif (optional, automatically enabled if installed)
Please make sure to install the corresponding development packages in case that
you want to build sxiv on a distribution with separate runtime and development
packages (e.g. *-dev on Debian).
you want to build nsxiv on a distribution with separate runtime and development
packages (e.g. \*-dev on Debian).
Building
--------
sxiv is built using the commands:
nsxiv is built using the commands:
$ make
# make install
Please note, that the latter one requires root privileges.
By default, sxiv is installed using the prefix "/usr/local", so the full path
of the executable will be "/usr/local/bin/sxiv".
Running make will automatically detect if libexif and libgif are available and
enable them if so. CLI arguments will override any automatic detection.
@ -71,12 +72,19 @@ For example:
will always disable libgif.
Alternatively, they can be disabled via editing `config.mk`.
You can install sxiv into a directory of your choice by changing the second
command to:
Installing nsxiv:
# make PREFIX="/your/dir" install
# make install
The build-time specific settings of sxiv can be found in the file *config.h*.
Please note, that this requires root privileges.
By default, nsxiv is installed using the prefix "/usr/local", so the full path
of the executable will be "/usr/local/bin/nsxiv".
You can install nsxiv into a directory of your choice by changing this command to:
$ make PREFIX="/your/dir" install
The build-time specific settings of nsxiv can be found in the file *config.h*.
Please check and change them, so that they fit your needs.
If the file *config.h* does not already exist, then you have to create it with
the following command:
@ -87,167 +95,32 @@ the following command:
Usage
-----
Please see the [man page](http://muennich.github.com/sxiv/sxiv.1.html) for
information on how to use sxiv.
Please see man page for information on how to use nsxiv. To do so, execute the
following after the installation:
$ man nsxiv
Download & Changelog
--------------------
F.A.Q
-----
You can [browse](https://github.com/muennich/sxiv) the source code repository
* Can I open remote urls with nsxiv? <br>
Yes, see [nsxiv-url](https://github.com/nsxiv/nsxiv/wiki/nsxiv-url)
* Can I open all the images in a directory? <br>
Yes, see [nsxiv-rifle](https://github.com/nsxiv/nsxiv/wiki/nsxiv-rifle)
* Can I set default arguments for nsxiv? <br>
Yes, see [nsxiv-env](https://github.com/nsxiv/nsxiv/wiki/nsxiv-env)
* Can I pipe images into nsxiv? <br>
No, not yet. See https://github.com/nsxiv/nsxiv/issues/32
Download
--------
You can [browse](https://github.com/nsxiv/nsxiv) the source code repository
on GitHub or get a copy using git with the following command:
git clone https://github.com/muennich/sxiv.git
**Stable releases**
**[v26](https://github.com/muennich/sxiv/archive/v26.tar.gz)**
*(January 16, 2020)*
* Maintenance release
**[v25](https://github.com/muennich/sxiv/archive/v25.tar.gz)**
*(January 26, 2019)*
* Support font fallback for missing glyphs
* Fix busy loop when built without inotify
* Use background/foreground colors from X resource database
**[v24](https://github.com/muennich/sxiv/archive/v24.tar.gz)**
*(October 27, 2017)*
* Automatically reload the current image whenever it changes
* Support embedding into other X windows with -e (e.g. tabbed)
* New option -p prevents sxiv from creating cache and temporary files
* Simpler mouse mappings, the most basic features are accessible with the
mouse only (navigate, zoom, pan)
**[v1.3.2](https://github.com/muennich/sxiv/archive/v1.3.2.tar.gz)**
*(December 20, 2015)*
* external key handler gets file paths on stdin, not as arguments
* Cache out-of-view thumbnails in the background
* Apply gamma correction to thumbnails
**[v1.3.1](https://github.com/muennich/sxiv/archive/v1.3.1.tar.gz)**
*(November 16, 2014)*
* Fixed build error, caused by delayed config.h creation
* Fixed segfault when run with -c
**[v1.3](https://github.com/muennich/sxiv/archive/v1.3.tar.gz)**
*(October 24, 2014)*
* Extract thumbnails from EXIF tags (requires libexif)
* Zoomable thumbnails, supported sizes defined in config.h
* Fixed build error with giflib version >= 5.1.0
**[v1.2](https://github.com/muennich/sxiv/archive/v1.2.tar.gz)**
*(April 24, 2014)*
* Added external key handler, called on keys prefixed with `Ctrl-x`
* New keybinding `{`/`}` to change gamma (by András Mohari)
* Support for slideshows, enabled with `-S` option & toggled with `s`
* Added application icon (created by 0ion9)
* Checkerboard background for alpha layer
* Option `-o` only prints files marked with `m` key
* Fixed rotation/flipping of multi-frame images (gifs)
**[v1.1.1](https://github.com/muennich/sxiv/archive/v1.1.1.tar.gz)**
*(June 2, 2013)*
* Various bug fixes
**[v1.1](https://github.com/muennich/sxiv/archive/v1.1.tar.gz)**
*(March 30, 2013)*
* Added status bar on bottom of window with customizable content
* New keyboard shortcuts `\`/`|`: flip image vertically/horizontally
* New keyboard shortcut `Ctrl-6`: go to last/alternate image
* Added own EXIF orientation handling, removed dependency on libexif
* Fixed various bugs
**[v1.0](https://github.com/muennich/sxiv/archive/v1.0.tar.gz)**
*(October 31, 2011)*
* Support for multi-frame images & GIF animations
* POSIX compliant (IEEE Std 1003.1-2001)
**[v0.9](https://github.com/muennich/sxiv/archive/v0.9.tar.gz)**
*(August 17, 2011)*
* Made key and mouse mappings fully configurable in config.h
* Complete code refactoring
**[v0.8.2](https://github.com/muennich/sxiv/archive/v0.8.2.tar.gz)**
*(June 29, 2011)*
* POSIX-compliant Makefile; compiles under NetBSD
**[v0.8.1](https://github.com/muennich/sxiv/archive/v0.8.1.tar.gz)**
*(May 8, 2011)*
* Fixed fullscreen under window managers, which are not fully EWMH-compliant
**[v0.8](https://github.com/muennich/sxiv/archive/v0.8.tar.gz)**
*(April 18, 2011)*
* Support for thumbnail caching
* Ability to run external commands (e.g. jpegtran, convert) on current image
**[v0.7](https://github.com/muennich/sxiv/archive/v0.7.tar.gz)**
*(February 26, 2011)*
* Sort directory entries when using `-r` command line option
* Hide cursor in image mode
* Full functional thumbnail mode, use Return key to switch between image and
thumbnail mode
**[v0.6](https://github.com/muennich/sxiv/archive/v0.6.tar.gz)**
*(February 16, 2011)*
* Bug fix: Correctly display filenames with umlauts in window title
* Basic support of thumbnails
**[v0.5](https://github.com/muennich/sxiv/archive/v0.5.tar.gz)**
*(February 6, 2011)*
* New command line option: `-r`: open all images in given directories
* New key shortcuts: `w`: resize image to fit into window; `W`: resize window
to fit to image
**[v0.4](https://github.com/muennich/sxiv/archive/v0.4.tar.gz)**
*(February 1, 2011)*
* New command line option: `-F`, `-g`: use fixed window dimensions and apply
a given window geometry
* New key shortcut: `r`: reload current image
**[v0.3.1](https://github.com/muennich/sxiv/archive/v0.3.1.tar.gz)**
*(January 30, 2011)*
* Bug fix: Do not set setuid bit on executable when using `make install`
* Pan image with mouse while pressing middle mouse button
**[v0.3](https://github.com/muennich/sxiv/archive/v0.3.tar.gz)**
*(January 29, 2011)*
* New command line options: `-d`, `-f`, `-p`, `-s`, `-v`, `-w`, `-Z`, `-z`
* More mouse mappings: Go to next/previous image with left/right click,
scroll image with mouse wheel (horizontally if Shift key is pressed),
zoom image with mouse wheel if Ctrl key is pressed
**[v0.2](https://github.com/muennich/sxiv/archive/v0.2.tar.gz)**
*(January 23, 2011)*
* Bug fix: Handle window resizes correctly
* New keyboard shortcuts: `g`/`G`: go to first/last image; `[`/`]`: go 10
images back/forward
* Support for mouse wheel zooming (by Dave Reisner)
* Added fullscreen mode
**[v0.1](https://github.com/muennich/sxiv/archive/v0.1.tar.gz)**
*(January 21, 2011)*
* Initial release
$ git clone https://github.com/nsxiv/nsxiv.git

5
TODO
View File

@ -1,5 +0,0 @@
- Load all frames from TIFF files. We have to write our own loader for this to
happen--just like we did for GIF images--because Imlib2 does not support
multiple frames. Issue #241.
- Add support for more embedded thumbnail formats. Right now, sxiv seems to use
the smallest one. Issue #238.

8
TODO.md Normal file
View File

@ -0,0 +1,8 @@
To Do
-----
* Add support for more embedded thumbnail formats. Right now, nsxiv seems to use
the smallest one. [Issue #238](https://github.com/muennich/sxiv/issues/238).
* Load all frames from TIFF files. We have to write our own loader for this to
happen--just like we did for GIF images--because Imlib2 does not support
multiple frames. [Issue #241](https://github.com/muennich/sxiv/issues/241).

View File

@ -1,22 +1,22 @@
/* Copyright 2017 Max Voit, Bert Muennich
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sxiv.h"
#include "nsxiv.h"
#include <errno.h>
#include <stdlib.h>

View File

@ -1,22 +1,22 @@
/* Copyright 2017 Max Voit
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sxiv.h"
#include "nsxiv.h"
void arl_init(arl_t *arl)
{

View File

@ -1,22 +1,22 @@
/* Copyright 2011, 2012, 2014 Bert Muennich
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sxiv.h"
#include "nsxiv.h"
#define _IMAGE_CONFIG
#include "config.h"

View File

@ -16,7 +16,7 @@ enum {
#ifdef _TITLE_CONFIG
/* default title prefix */
static const char *TITLE_PREFIX = "sxiv - ";
static const char *TITLE_PREFIX = "nsxiv - ";
/* default title suffixmode, available options are:
* SUFFIX_EMPTY

View File

@ -1,8 +1,8 @@
#!/bin/sh
# Example for $XDG_CONFIG_HOME/sxiv/exec/image-info
# Called by sxiv(1) whenever an image gets loaded.
# The output is displayed in sxiv's status bar.
# Example for $XDG_CONFIG_HOME/nsxiv/exec/image-info
# Called by nsxiv(1) whenever an image gets loaded.
# The output is displayed in nsxiv's status bar.
# Arguments:
# $1: path to image file
# $2: image width

View File

@ -1,11 +1,11 @@
#!/bin/sh
# Example for $XDG_CONFIG_HOME/sxiv/exec/key-handler
# Called by sxiv(1) after the external prefix key (C-x by default) is pressed.
# Example for $XDG_CONFIG_HOME/nsxiv/exec/key-handler
# Called by nsxiv(1) after the external prefix key (C-x by default) is pressed.
# The next key combo is passed as its first argument. Passed via stdin are the
# images to act upon, one path per line: all marked images, if in thumbnail
# mode and at least one image has been marked, otherwise the current image.
# sxiv(1) blocks until this script terminates. It then checks which images
# nsxiv(1) blocks until this script terminates. It then checks which images
# have been modified and reloads them.
# The key combo argument has the following form: "[C-][M-][S-]KEY",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 620 B

View File

@ -7,6 +7,6 @@ install:
for f in $(ICONS); do \
dir="$(DESTDIR)$(PREFIX)/share/icons/hicolor/$${f%.png}/apps"; \
mkdir -p "$$dir"; \
cp "$$f" "$$dir/sxiv.png"; \
chmod 644 "$$dir/sxiv.png"; \
cp "$$f" "$$dir/nsxiv.png"; \
chmod 644 "$$dir/nsxiv.png"; \
done

10
image.c
View File

@ -1,22 +1,22 @@
/* Copyright 2011, 2012 Bert Muennich
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sxiv.h"
#include "nsxiv.h"
#define _IMAGE_CONFIG
#include "config.h"

17
main.c
View File

@ -1,22 +1,22 @@
/* Copyright 2011-2013 Bert Muennich
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sxiv.h"
#include "nsxiv.h"
#define _MAPPINGS_CONFIG
#include "config.h"
@ -136,7 +136,7 @@ void remove_file(int n, bool manual)
if (filecnt == 1) {
if (!manual)
fprintf(stderr, "sxiv: no more files to display, aborting\n");
fprintf(stderr, "nsxiv: no more files to display, aborting\n");
exit(manual ? EXIT_SUCCESS : EXIT_FAILURE);
}
if (files[n].flags & FF_MARK)
@ -919,11 +919,12 @@ int main(int argc, char **argv)
if (homedir != NULL) {
extcmd_t *cmd[] = { &info.f, &keyhandler.f };
const char *name[] = { "image-info", "key-handler" };
const char *s = "/nsxiv/exec/";
for (i = 0; i < ARRLEN(cmd); i++) {
n = strlen(homedir) + strlen(dsuffix) + strlen(name[i]) + 12;
n = strlen(homedir) + strlen(dsuffix) + strlen(name[i]) + strlen(s) + 1;
cmd[i]->cmd = (char*) emalloc(n);
snprintf(cmd[i]->cmd, n, "%s%s/sxiv/exec/%s", homedir, dsuffix, name[i]);
snprintf(cmd[i]->cmd, n, "%s%s%s%s", homedir, dsuffix, s, name[i]);
if (access(cmd[i]->cmd, X_OK) != 0)
cmd[i]->err = errno;
}

View File

@ -1,8 +1,8 @@
.TH SXIV 1 sxiv\-VERSION
.TH NSXIV 1 nsxiv\-VERSION
.SH NAME
sxiv \- Simple X Image Viewer
nsxiv \- Simple X Image Viewer
.SH SYNOPSIS
.B sxiv
.B nsxiv
.RB [ \-abcfhiopqrtvZ ]
.RB [ \-A
.IR FRAMERATE ]
@ -26,7 +26,7 @@ sxiv \- Simple X Image Viewer
.IR ZOOM ]
.IR FILE ...
.SH DESCRIPTION
sxiv is a simple image viewer for X.
nsxiv is a simple image viewer for X.
.P
It has two modes of operation: image and thumbnail mode. The default is image
mode, in which only the current image is shown. In thumbnail mode a grid of
@ -50,7 +50,7 @@ Do not show info bar on bottom of window.
Remove all orphaned cache files from the thumbnail cache directory and exit.
.TP
.BI "\-e " WID
Embed sxiv's window into window whose ID is
Embed nsxiv's window into window whose ID is
.IR WID .
.TP
.B \-f
@ -64,7 +64,7 @@ Set window position and size. See section GEOMETRY SPECIFICATIONS of X(7) for
more information on GEOMETRY argument.
.TP
.BI "\-N " NAME
Set the resource name of sxiv's X window to NAME.
Set the resource name of nsxiv's X window to NAME.
.TP
.BI "\-T " TITLE
Set the window title to TITLE. Use the format `prefix:suffixmode'. Any string
@ -77,7 +77,7 @@ literal is accepted for prefix, and the format of suffixmode is:
2 Full path to file
.EE
By defualt, prefix is set to "sxiv - " and suffixmode is set to 1 (basename).
By defualt, prefix is set to "nsxiv - " and suffixmode is set to 1 (basename).
.TP
.BI "\-n " NUM
Start at picture number NUM.
@ -92,10 +92,10 @@ Read names of files to open from standard input. Also done if FILE is `-'.
Write list of all marked files to standard output when quitting. In combination
with
.B \-i
sxiv can be used as a visual filter/pipe.
nsxiv can be used as a visual filter/pipe.
.TP
.B \-p
Enable private mode, in which sxiv does not write any cache or temporary files.
Enable private mode, in which nsxiv does not write any cache or temporary files.
.TP
.B \-q
Be quiet, disable warnings to standard error stream.
@ -134,7 +134,7 @@ Prefix the next command with a number (denoted via
.IR count ).
.TP
.B q
Quit sxiv.
Quit nsxiv.
.TP
.B Return
Switch to thumbnail mode / open selected image in image mode.
@ -414,35 +414,35 @@ Name of Xft bar font
Please see xrdb(1) on how to change them.
.SH STATUS BAR
The information displayed on the left side of the status bar can be replaced
with the output of a user-provided script, which is called by sxiv whenever an
with the output of a user-provided script, which is called by nsxiv whenever an
image gets loaded. The path of this script is
.I $XDG_CONFIG_HOME/sxiv/exec/image-info
.I $XDG_CONFIG_HOME/nsxiv/exec/image-info
and the arguments given to it are: 1) path to image file, 2) image width,
3) image height.
.P
There is also an example script installed together with sxiv as
.IR PREFIX/share/sxiv/exec/image-info .
There is also an example script installed together with nsxiv as
.IR PREFIX/share/nsxiv/exec/image-info .
.SH EXTERNAL KEY HANDLER
Additional external keyboard commands can be defined using a handler program
located in
.IR $XDG_CONFIG_HOME/sxiv/exec/key-handler .
.IR $XDG_CONFIG_HOME/nsxiv/exec/key-handler .
The handler is invoked by pressing
.BR Ctrl-x .
The next key combo is passed as its first argument. Passed via stdin are the
images to act upon, one path per line: all marked images, if in thumbnail mode
and at least one image has been marked, otherwise the current image.
sxiv(1) will block until the handler terminates. It then checks which images
nsxiv(1) will block until the handler terminates. It then checks which images
have been modified and reloads them.
The key combo argument has the following form: "[C-][M-][S-]KEY",
where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X
keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix.
There is also an example script installed together with sxiv as
.IR PREFIX/share/sxiv/exec/key-handler .
There is also an example script installed together with nsxiv as
.IR PREFIX/share/nsxiv/exec/key-handler .
.SH THUMBNAIL CACHING
sxiv stores all thumbnails under
.IR $XDG_CACHE_HOME/sxiv/ .
nsxiv stores all thumbnails under
.IR $XDG_CACHE_HOME/nsxiv/ .
.P
Use the command line option
.I \-c
@ -452,20 +452,35 @@ afterwards inside the cache directory to remove empty subdirectories:
.RS
find . \-depth \-type d \-empty ! \-name '.' \-exec rmdir {} \\;
.RE
.SH AUTHOR
.SH ORIGINAL AUTHOR
.EX
Bert Muennich <ber.t at posteo.de>
.EE
.SH CURRENT MAINTAINERS
.EX
Anupam Ashish Minz
Berke Kocaoğlu <berke.kocaoglu at metu.edu.tr>
Guilherme Freire
Kian Kasad <kian at kasad.com>
N-R-K <nrk at disroot.org>
Stein Gunnar Bakkeby <bakkeby at gmail.com>
TAAPArthur <taaparthur at gmail.com>
explosion-mental <explosion0mental at gmail.com>
eylles <ed.ylles1997 at gmail.com>
qsmodo
.EE
.SH CONTRIBUTORS
.EX
Bastien Dejean <nihilhill at gmail.com>
Dave Reisner <d at falconindy.com>
Fung SzeTat <sthorde at gmail.com>
Max Voit <mvdev at with-eyes.net>
For additional contributors, run `git shortlog -s` in the nsxiv repository.
.EE
.SH HOMEPAGE
.EX
https://github.com/muennich/sxiv
https://github.com/nsxiv/nsxiv
.EE
.SH SEE ALSO
.BR X (7),

View File

@ -1,8 +1,8 @@
[Desktop Entry]
Type=Application
Name=sxiv
Name=nsxiv
GenericName=Image Viewer
Exec=sxiv %F
Exec=nsxiv %F
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/png;image/tiff;image/x-bmp;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-tga;image/x-xpixmap;image/webp;
NoDisplay=true
Icon=sxiv
Icon=nsxiv

View File

@ -1,23 +1,23 @@
/* Copyright 2011 Bert Muennich
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SXIV_H
#define SXIV_H
#ifndef NSXIV_H
#define NSXIV_H
#include <stdarg.h>
#include <stdbool.h>
@ -456,5 +456,5 @@ void win_set_title(win_t*, const char*);
void win_set_cursor(win_t*, cursor_t);
void win_cursor_pos(win_t*, int*, int*);
#endif /* SXIV_H */
#endif /* NSXIV_H */

View File

@ -1,22 +1,22 @@
/* Copyright 2011 Bert Muennich
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sxiv.h"
#include "nsxiv.h"
#define _IMAGE_CONFIG
#define _TITLE_CONFIG
#include "config.h"
@ -31,14 +31,14 @@ const opt_t *options = (const opt_t*) &_options;
void print_usage(void)
{
printf("usage: sxiv [-abcfhiopqrtvZ] [-A FRAMERATE] [-e WID] [-G GAMMA] "
printf("usage: nsxiv [-abcfhiopqrtvZ] [-A FRAMERATE] [-e WID] [-G GAMMA] "
"[-g GEOMETRY] [-N NAME] [-T TITLE] [-n NUM] [-S DELAY] [-s MODE] "
"[-z ZOOM] FILES...\n");
}
void print_version(void)
{
puts("sxiv " VERSION);
puts("nsxiv " VERSION);
}
void parse_options(int argc, char **argv)

View File

@ -1,22 +1,22 @@
/* Copyright 2011 Bert Muennich
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sxiv.h"
#include "nsxiv.h"
#define _THUMBS_CONFIG
#include "config.h"
@ -172,10 +172,11 @@ void tns_init(tns_t *tns, fileinfo_t *files, const int *cnt, int *sel,
dsuffix = "/.cache";
}
if (homedir != NULL) {
const char *s = "/nsxiv";
free(cache_dir);
len = strlen(homedir) + strlen(dsuffix) + 6;
len = strlen(homedir) + strlen(dsuffix) + strlen(s) + 1;
cache_dir = (char*) emalloc(len);
snprintf(cache_dir, len, "%s%s/sxiv", homedir, dsuffix);
snprintf(cache_dir, len, "%s%s%s", homedir, dsuffix, s);
} else {
error(0, 0, "Cache directory not found");
}
@ -272,7 +273,7 @@ bool tns_load(tns_t *tns, int n, bool force, bool cache_only)
ExifContent *ifd;
ExifByteOrder byte_order;
int tmpfd;
char tmppath[] = "/tmp/sxiv-XXXXXX";
char tmppath[] = "/tmp/nsxiv-XXXXXX";
Imlib_Image tmpim;
if ((ed = exif_data_new_from_file(file->path)) != NULL) {

10
util.c
View File

@ -1,22 +1,22 @@
/* Copyright 2011 Bert Muennich
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sxiv.h"
#include "nsxiv.h"
#include <stdlib.h>
#include <string.h>

View File

@ -1,22 +1,22 @@
/* Copyright 2011-2013 Bert Muennich
*
* This file is part of sxiv.
* This file is a part of nsxiv.
*
* sxiv is free software; you can redistribute it and/or modify
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* sxiv is distributed in the hope that it will be useful,
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sxiv. If not, see <http://www.gnu.org/licenses/>.
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sxiv.h"
#include "nsxiv.h"
#define _WINDOW_CONFIG
#include "config.h"
#include "icon/data.h"
@ -30,7 +30,7 @@
#include <X11/Xatom.h>
#include <X11/Xresource.h>
#define RES_CLASS "Sxiv"
#define RES_CLASS "Nsxiv"
enum {
H_TEXT_PAD = 5,
@ -277,11 +277,11 @@ void win_open(win_t *win)
free(icon_data);
/* These two atoms won't change and thus only need to be set once. */
XStoreName(win->env.dpy, win->xwin, "sxiv");
XSetIconName(win->env.dpy, win->xwin, "sxiv");
XStoreName(win->env.dpy, win->xwin, "nsxiv");
XSetIconName(win->env.dpy, win->xwin, "nsxiv");
classhint.res_class = RES_CLASS;
classhint.res_name = options->res_name != NULL ? options->res_name : "sxiv";
classhint.res_name = options->res_name != NULL ? options->res_name : "nsxiv";
XSetClassHint(e->dpy, win->xwin, &classhint);
XSetWMProtocols(e->dpy, win->xwin, &atoms[ATOM_WM_DELETE_WINDOW], 1);